Tarring:
tar -pczf tar_file_name.tar.gz folder_name
Untarring:
tar -zxvf tar_file_name.tar.gz
tar -zxvf tar_file_name.tar.gz
Zipping:
zip -r zip_file_name.zip folder_name
zip -r zip_file_name.zip folder_name
Unzipping:
unzip zip_file_name.zip -d folder_name
Create a symlink:
ln -s src_file_link symlink_file_name
ln -s src_file_link symlink_file_name
Remove a symlink:
unlink link_name
unlink link_name
SCP
scp rondovu_1_0_24_sep_2011.tar.gz root@dev.myserver.com:/var/ www/html/
tar -zxvf tar_file_name.tar.gz
Rsync
rsync --partial --progress --rsh=ssh /home/user/tar_file_name.tar.gz root@dev.myserver.com:/ var/www/tar_file_name.tar.gz
List the size of files/folders in a directory
du --max-depth=1 -h ./ | sort -n -r
Count the lines of code in a project
find . -name '*.php' | xargs wc -l
find . -name '*.js' | xargs wc -l
Search for a text in files with regex
egrep "User|Group|SuexecUserGroup" /etc/apache2/apache2.conf /etc/apache2/sites-available/* .conf
Know System Info (whether 32 or 64 bit)
file /usr/bin/file
Mysql dump and restore
mysqldump -u root -p db_name > db_name.sql
mysqldump -u root -p --datbases db_name1 db_name2 db_name3 > db_name.sql
mysqldump -u root -p --all-databases > db_name.sql
mysql -u root -p db_name < db_name.sql
mysql --force -u root -p db_name < db_name.sql // To import without stopping when there are no errors