Lab 5-6 Linux Assignment and Solution

Lab 5-6 Linux Assignment Requirement

This lab covers directories and links

lab5-6

Lab 5-6 Linux Assignment Solution

***************
Module 5
***************
1. touch temp1
2. script lab5-6
3. pwd
4. ls -F /
5. echo directory
9. mkdir dir1 dir2
10. pwd
    cd /home/student/harshlavingia/dir1/
11. cp ../temp1 .
12. cp temp1 ../dir2/temp2
13. cd ~
14. mv dir2 dir1/
15. ls dir1/dir2/

16. exit -> exit script utility

17. script -a lab5-6
18. ln dir1/temp1 link1
19. ln dir1/temp1 dir1/dir2/link2
20. ls -li dir1/temp1
21. ln -s ~ dir1/dir2/home
22. cd dir1/dir2
23. ls home
24. find home/ -type f -links +2
25. ls -li home/dir1/           --> temp1 inod = 32441753

find ~ -inum 32441753 --> To Do: How to skip file listing and ONLY hard links

26. which ll
27. exit
***************
Module 6
***************
1. script -a ~/lab5-6
2.
cd ~
ls -ld .
3. touch f1 f2
4. chmod 740 f1 f2
5. ls -l f1 f2
6. echo "no.  home directory don't have rwx permission for the group"
7. chmod u=rw,g=x f1
8. ls -l f1
9.

System default -> rw- rw- rw- -> 110 110 110 -> 666

Change default to -> rw- --- --- -> 110 000 000 -> 600

umask -> -> 000 110 110 -> 066

umask 066
10.
touch f3
ls -l f3
11. exit
12. cp /home/distribution/cnguyen/cis18a/clean.sh ~
13. clean.sh lab5-6
14.
- Clean typing error
- Check difference between lab5-6.cleaned and lab5-6
15. Turn in