Common linux commands for daily use
pwd-used to check the present working directory
mkdir-used for creating directory
ls- list all files of the current directory
cd / - changes to root directory
-->Note: if we are using user who doesn’t have rights as root user then only in /home directory we are able to make the Folder.
whoami- to know the current logged in user
-->In /bin directory here all installed tools binary are present.
-->/tmp- contains temporary files
-->/var/log- here all log files are present
-->/root- who has all permissions which is also called as root user
-->~-represents the home directory
clear- used for clearing the terminal
touch hello.txt – creates a blank file called hello.txt
echo “Hello World” – prints hello world
cat hello.txt- used for viewing the contents of file
echo all good \>hello.txt- stores the text in hello.txt
mv hello.txt /test – moves the file to test directory
history- shows all commands peformed on the terminal
mkdir dev qa test –creates multiple directories
mkdir –p /dev/qa/test – creates nested directory(directory inside directory)
mkdir /student{1..10}- used for creating 10 student directory in series number
uname- shows the name of the kernel
cp- used for copying the files from source location to destination
sudo rm -r student* -removes the directories whose name consist of student
cp –r –copies the files recursively
sudo useradd rathesh- creates a user
sudo useradd -m rathesh1 – creates a user also creates directory of the same in /home
ls –la –lists all files including the hidden one with the file permission
head -n 3 stock_pack_operation_lot.py – shows the first three lines of the file
tail -3 stock_pack_operation_lot.py- shows bottom 3 lines of the file
diff stock_pack_operation_lot.py stock_pack_operation_lot_old.py – used for comparing two different files