Commands:
View the content of a file (cat):
shellCopy code$ cat file.txt
Change the access permissions of files (chmod):
shellCopy code$ chmod permissions filename
Check the command history (history):
shellCopy code$ history
Remove a directory/folder (rmdir):
shellCopy code$ rmdir folder_name
Create a file and view the content (touch and cat):
shellCopy code$ touch fruits.txt $ cat fruits.txt
Add content to devops.txt (echo and redirect):
swiftCopy code$ echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > devops.txt
Show only the top three fruits (head):
shellCopy code$ head -n 3 devops.txt
Show only the bottom three fruits (tail):
shellCopy code$ tail -n 3 devops.txt
Create another file Colors.txt and view the content (touch and cat):
shellCopy code$ touch Colors.txt $ cat Colors.txt
Add content to Colors.txt (echo and redirect):
swiftCopy code$ echo -e "Red\nPink\nWhite\nBlack\nBlue\nOrange\nPurple\nGrey" > Colors.txt
Find the difference between fruits.txt and Colors.txt file (diff):
rubyCopy code$ diff fruits.txt Colors.txt