Sunday, March 30, 2014

Linux/Unix: Find Command Ignore Case Insensitive Search

I am a new Linux and Unix-command line user. I am using find command to search file called "fooBar.conf.sample" in my home directory. I do not know the case, it could be uppercase, lowercase, or a mix of both. How can search a file and ignore case on a Linux or Unix-like system?

The find command recursively descends the directory tree for each path provided, evaluating an expression. It is mainly used to search files and directories on Linux and Unix-like systems. The syntax is as follows to search files according to given criteria. You can search for files by name, owner, group, type, permissions, date, and other criteria:

Saturday, March 15, 2014

Linux / Unix: chroot Command Examples

Iam a new Linux and Unix user. How do I change the root directory of a command? How do I change the root directory of a process such as web-server using a chroot command to isolate file system? How do I use a chroot to recover password or fix the damaged Linux/Unix based environment?

Each process/command on Linux and Unix-like system has current working directory called root directory of a process/command. You can change the root directory of a command using chrootcommand, which ends up changing the root directory for both current running process and its children.

Minify and Compress CSS & Javascript Files At a Linux/Unix Shell Prompt

How do I minify and compress CSS & JS files on Linux or Unix-like system using shell prompt on my server? How can I minify JavaScripts and stylesheets at shell promot so they can download faster over the Internet without using any online tools?

You need to use "YUI Compressor" tool. It is widely used for minifying JavaScripts and stylesheets. From the project page:

Thursday, March 13, 2014

CentOS Install Lighttpd Web-server With yum Command

I know how to install nginx on a CentOS Linux using yum command. Is there is a guide to install Lighttpd web-server on a CentOS Linux or RHEL server with yum command? How can I install and configure php and mysql on a CentOS with Lighttpd web-server?

Lighttpd is a fast and secure web-server which has been optimized for high-performance environments. The server has a very low memory footprint compared to other webservers and takes care of cpu-load. It includes the following advanced features:

CentOS: rpmdb: PANIC: fatal region error detected; run recovery error and solution

I am using a CentOS Linux v6.5 on my home server and I am getting the following error when I execute yum command:
rpmdb: PANIC: fatal region error detected; run recovery
error: db3 error(-30974) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
How do I fix this problem on a CentOS / RHEL based system?

Tuesday, March 11, 2014

HowTo: Update gcutil / gcloud Components On a Linux / Unix / OS X

How can I update for Google Cloud SDK components on a Linux or OS X unix based systems?

The easiest and recommended way is to use gcloud command to update various Google cloud SDK libs, commands and other components. Open the Terminal and type the following command when you see the following message on screen:

Monday, March 10, 2014

curl Command Resume Broken Download

Iknow wget can resume a failed download. I am on a Mac OS X and do now want to install wget command. How can I resume a failed download using curl command on Linux or Unix-like systems?

You can continue getting a partially downloaded file using curl command. You need to pass the -Cor --continue-at <offset> option resume a previous file transfer at the given offset.

FreeBSD Show Disk Quota Limits Command

I'm a new FreeBSD unix user and backup file on a FreeBSD based unix server. How can I check quota limits and disk usage using shell prompt on a FreeBSD based system?

You need to use the quota command line utility to see your disk usage and limits. By default only the user quotas are printed. Disk block usage and limits are shown in 1024-byte blocks.