cat <file_name>: This command is used to view what's written in a file
cat -n <file_name>: This adds line numbers to all lines
To change the access permissions of files.
chmod: This command is used to change the permission of files
Ex. chmod 770 <file_name> , Here chmod is the command and 770(user+group+other) is the permission.
To change the owner of the files
chown <username> <filename>: This command is used to change the owner of files.
sudo: This is used to run the command with superuser privilege.
history: This command is used to check which commands you have run till now.
rmdir <directory_name>: This command is used to remove a directory.
or
rm -r <directory_name>: We used this command when a directory is not empty
vim <filename> : Vim is the text editor in Linux.
Add content in fruits.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
head -n <filename>: To show only top three fruits from the file.
tail -n <filename>: To Show only bottom three fruits from the file.
To create another file colors.txt and to view the content and add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
To find the difference between the fruits.txt and Colors.txt files.
Here we can use diff commands.
grep: This command is used to find a particular pattern or word.
Ex. grep -i pratik test.txt
find: This command is used to find the files and directories
find ./ -name test.txt
apt-get install <package>: To install package
ifconfig: Is used to get IP address
Suggestions are always welcome. Thank you !!