General Linux Commands

List of common shell commands for Linux

Trying to find the right command for your Linux Box on the internet is time consuming. I often find myself looking for the same commands again and again. To fix this, I am trying to create a list of most commonly used Linux commands for my self that is easily accessible. I will keep adding to this list over the time and hope fully it will keep expanding and will benefit some of you as well.

Copy files and folders

cp -option source target

Copy a directory to another directory cp -r /home/www/public_html/test /home/www/public_html/test2/

Copy all the files from a directory to another directory cp -r /home/www/public_html/test/* /home/www/public_html/test2/

Move files and folders with mv

Zip and Unzip

Install yum install zip unzip

To compress a file zip – r zipFileName.zip fileOrDirName

extract the contents of a zip file unzip filename.zip

You can use zip to compress multiple files and directories at the same time by listing them with a space between each one.zip to compress multiple files and directories at the same time zip -r filename.zip file1 file2 file3 /usr/work/school