Friday, March 15, 2013

Useful basic liux Command

Some basic UNIX command which helps in managing server
  1. copy a directory
    cp -r dir1 /path/to/destination/dir
  2. Extract tar.gz file
    tar xvfz archive_name.tar.gz
  3. create a tar.gz file
    tar cvfz archive_name.tar.gz dirname/
  4. Search file with file name
    find . -type f -name '*.php'

Tuesday, March 12, 2013

Linux folder size from command prompt

Best way to check folder size.

du -hs /var/www/
7.8G

If want to exclude any(upload here) folder then

du -hs --exclude=upload*
2G