Task3-linux Commands

·

1 min read

BASIC LINUX COMMANDS

To view the contents written in a file

cat <Filename.txt>

To change the access permissions of files

chmod 777 <Filename.txt>

To check the commands you have run till now

history

To remove a directory/Folder

rm -r <Filename.txt/Directory name>

To create a fruits.txt file and to view the content.Enter the details-Apple,Mango,Banana,Cherry,Kiwi,Orange,Guava

cat >> <Filename.txt>

To show only top three fruits from the file

head -n3 <Filename.txt>

To show only bottom three fruits from the file

tail -n3 <Filename.txt>

To create the second file of Colors.txt and to view the content and to add details such as-Red,Pink,White,Black,Blue,Orange,Purple,Grey

cat >> <Filename.txt>

To find the difference between Fruits.txt and Colors.txt file

diff <Filename.txt> <second Filename.txt>