Skip to content

Instantly share code, notes, and snippets.

@DmitriyShaydurov
Last active December 14, 2019 07:29
Show Gist options
  • Save DmitriyShaydurov/044d7224db4ee68667705ef8b9771288 to your computer and use it in GitHub Desktop.
Save DmitriyShaydurov/044d7224db4ee68667705ef8b9771288 to your computer and use it in GitHub Desktop.
Linux commands cheat sheet

Linux Commands, Help & Tips

File system

what path you are in

pwd

show the listings

ls

show along with hidden files

ls -a

show along with extra information

ls -l

make directory

mkdir <name>

change directory

cd <name>

change directory

cd <name>

one level up

cd ..

root

cd /

home dir

cd 

~ represents home from anywhere

cd ~
cd ~/dir2

create a file

touch file.text

see what is in a file

cat file.text

see what is in a long file (PageDown, to exit press q)

less file.text

move and rename

mv test.txt test2.txt

copy file

cp test2.txt file1.txt

delete file

rm test2.txt

delete directory

rmdir <dir-name>

delete directory with files

rm -R <dir-name>

search for file location

which <name>

Miscellaneous

clear screen

clear

show history

history

show system info

uname -a

show hard drive info

blkid

show running prosesses (q to quit)

top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment