Navigation Commands
ls this is the list command, it will list the content of the current directory
ls -alh this lists all files and folders + permissions and sizes in a readable format
cd this is the change directory command used in conjunection with a folder name like this: cd users/foo/
this would take to to the foo directory
cd .. this cd command will bring you back one directory in the path
cd ~ this cd command will take you to your home or top directory
mv this is the move command mv foo/ /path/to/new/loc
File Commands
touch will create a file touch example.txt
pico will open a file in a basic text editor pico example.txt
vi another basic txt editor vi example.txt
more will allow you to view the file without the ability of editing more example.txt
mkdir will create a directory mkdir foo
creates a folder called foo
mkdir foo\otherfoo\morefoo this will make the directory foo with two sub directories
rm will delete a file rm example.txt
rm -rf will delete a folder and all subfolders beneath it rm -rf foo/
df gives physical disk usage report with % used
du lists all files and folder sizes – this takes awhile
du -sh this lists all the subfolders + sizes in a directory
wget archive a website wget -m http://whateverurl
ls -l | grep ^d lists all the sub directories
alias lsd=”ls -l | grep ^d” this creates the alias lsd
of ls -l | grep ^d so you can use it more efficiently. You may have to sudo this.
Tar / Compression Commands
– this will combine two files together
tar -cvzf foo.tar.gz /path/to/folder/2/compress/
– this creates a tar.gz of a dir
tar tvf foo.tar
– List all files in foo.tar.
Matt is a Systems Development Director for a multinational franchise. Matt has lived and worked in Hawaii, Chicago, South Florida and currently resides outside of Atlanta. He enjoys his hobbies including Technology, Gadgets/EDC, Fountain Pens, Wetshaving, Clocks, Antiques & Coffee. He even roasts his own coffee weekly.
Leave a Reply