DEEPTHI PON GAYATHRI P
953622104017
EXERCISE 3
LINUX COMMANDS
1. Perform the following steps using Linux commands.
a.Create two sub-directories, say ‘CSE’ and ‘IT’, under the root directory.
mkdir CSE
mkdir IT
b.Enter into the sub-directory ‘IT’.
c.Create 5 files with the following names
i. rit1.txt
ii. ritcse1.txt
iii. ritcse2.txt
iv. rit2.txt
v. au1.txt
d.Add minimum of 5 sentence to each file.
DEEPTHI PON GAYATHRI P
953622104017
e.In file rit1.txt, add the following lines.
i. Hello RIT
ii.Hello RIT CSE
iii.CSE department was started in the year of 2013.
iv.CSE department has a vision to become a Centre for Excellence.
f.List the content of the following files using a single command
i. ritcse1.txt
ii. rit2.txt
iii. Ritcse2.txt
g.Redirect the number of lines in the file “rit1.txt” to the file “rit2.txt”.
DEEPTHI PON GAYATHRI P
953622104017
h.Move the file rit2.txt to CSE directory
i.The display the number of files in IT directory.
j.Merge the content of files “ritcse1.txt” and “ritcse2.txt” and stores the output in
“au1.txt”.
k.Search and display the line containing the word “CSE” in rit1.txt.
l.Display the permission modes of file “rit1.txt”.
m.Change the permission mode for the file “rit1.txt”
i. Add write permission for rit1.txt to all if not available. (User. Group and
others)
ii.Add write permission for rit1.txt to groups alone (Remove write permission
from Others).
2. Perform the following steps using basic linux commands
a.Carry out the steps from a to e in the previous question,
b.Create a file containing the text “USERS”. Now write a command to save the
list of current users who have logged in the system without overwriting the file.
Display the files with its new contents.
DEEPTHI PON GAYATHRI P
953622104017
c.Report the system’s disk space usage in percentage. (Show it in percentage,
kilobyte and file system type)
d.Write down the default permission of a file. Write a command to set all
permission for the user and remove all permission for the group and others
e.List the content of the current working directory in long format
f.List all the lines in a file which do not end with a semicolon.
DEEPTHI PON GAYATHRI P
953622104017
g.List all the lines in a file ending with a semicolon.
h.Write a command to archive multiple file into a tar file.
DEEPTHI PON GAYATHRI P
953622104017