CLI

Most used commands

CommandDescription
pwdpresent working directory
lsList files in the directory
cdchange the directory
touchCreate an empty file
echodisplay the string
echo -nDisplay the string without newline
echo “something” > fileRedirect the output of echo and create file
echo “another thing” >> fileAppend the string to the file
mkdirmake a new directory
cd ~home
cd -previous directory
cd ..parent directory
ls -aList all files including hidden files
cd /change to the root directory
catConcatenate the file line by line and display it on the terminal
lessPrint the big file line by line
vim <file>open the editor with <file> {a: to go to the insert mode, <ESC> + :wq to write and quit }
for var in {START..END}; do <COMMAND1>; <COMMAND2>;..; ; done
head <file>display the first 10 lines of file
tail <file>display the last 10 lines of file
head -n <file>display first n lines of file
tail -n <file>display last n lines of file
man <COMMAND>Display manual of the COMMAND