Linux basic commands

pwd -> show the current working directory
ls -a -> show list of all files and folders (hidden also)
ls -l -> show list of all files and folders with their permissions

mkdir -> Make directory
rmdir -> Delete directory
rm -R -> Delete directory even if it is not empty

cd -> moves back to your home directory
cd .. -> moves back one directory
cd / -> moves to root directory of linux
cd ~ -> moves to home directory

touch file.txt -> create file
nano file.txt -> edit file with nano-editor
cat file.txt -> show the contents of a file
less file.txt -> show the contents of a file with scroll
mv file.txt new.txt -> rename filename
cp file.txt new.txt -> copy file
rm file.txt -> delete file
chmod -> is used to change the permissions of files or directories (example “chmod 754 myfile”)

which -> shows program or folder location
history -> show last 500 commands

ifconfig -> network info
iwconfig -> wireless info

top -> shows the top processes based on certain criterias like cpu usage or memory usage
df -> disk space

sudo apt-get install “program-name” -> install program
sudo apt-get remove “program-name” -> delete program
sudo apt-get update -> update all packages
sudo shutdown -h -> shutdown system (halt)
sudo shutdown -r -> restart system

Leave a Reply

Your email address will not be published.