1.create A Directory Structure in Your Home Directory As Shown in The Diagram. Mkdir - P OFFICE/ (ADMIN/ (BMS, TMS), HR, FINANCE/ (BILLS, PAYROLL) )
1.create A Directory Structure in Your Home Directory As Shown in The Diagram. Mkdir - P OFFICE/ (ADMIN/ (BMS, TMS), HR, FINANCE/ (BILLS, PAYROLL) )
mkdir -p OFFICE/{ADMIN/{BMS,TMS},HR,FINANCE/{BILLS,PAYROLL}}
4.Create three empty files in your home directory with the names file1, file2 and file3.
cp file1.txt /home/user/OFFICE/HR
7.Copy the file file2 and file3 to the sub-directory BILLS under the sub-directory FINANCE under
OFFICE directory.
mv file2.txt billpaid.txt
mv file3.txt billdue.txt
chmod u=rwx,g=rx,o=r
cp -r /home/user/OFFICE/HR HR_new
11. Copy the file inside the directory HR to another directory with name TEMPDIR.
12.Delete the file inside the directory HR_New and then delete the directory HR_new
rm /home/user/OFFICE/HR/HR_new/hrfile.txt
rmdir /home/user/OFFICE/HR/HR_new
14. List all the files in your home directory with all the attributes.
$lsattr
$ls *.txt
$w
17. Compare the file sample.txt inside the directory ADMIN with the file hrfile.txt inside the directory
HR.
18.List the common lines between the two files mentioned in the previous question.
19. Display the lines which starts with the word “This” in the file sample.txt inside the directory
ADMIN.
20. Display the count of lines having the word “sample” in the file sample.txt. The search should be
case-insensitive.
21. Find all the empty files inside the directory OFFICE and delete them.
22. Create a file called scores.txt in your home directory with the following content
Roll No|Name|Score
1|Raghu|80
2|Hari|50
3|Ram|80
4|Asha|40
5|Radha|60
Display the name of the top 3 scorers from the data stored in the file scores.txt.