Practice 3Download file rolllist.txt from http://www.cs.gsu.edu/~cscyip/csc3320/rolllist.txt, search and sort of this file.1. search “Web”grep Web rolllist.txt2. search word “Web” and list the line numbergrep –wn Web rolllist.txt3. display lines without “Web”grep –v Web rolllist.txt4. display lines which start with “A”,”B”,”C”, or “D”. grep ‘^[A-D]’ rolllist.txt5. display lines which don’t start with “A”,”B”,”C”, or “D”.grep ‘^[^A-D]’ rolllist.txt6. display lines which end with “s”grep ‘s$’ rolllist.txt7. display lines which include at least 2 successive “1” egrep ‘111*’ rolllist.txtegrep ‘11+’ rolllist.txt8. search lines which include “Vi” or “Br”egrep ‘Vi|Br’ rolllist.txt9. search lines which include at least 6 “0”egrep ‘.*0.*0.*0.*0.*0.*0.*’ rolllist.txt10. search lines which include “03” or “033”egrep ‘033?’ rolllist.txt11. sort file sort rolllist.txt12. sort it in reverse ordersort –r rolllist.txt13. sort on second fieldsort +1 -2 rolllist.txt14. set “,” as separator, sort on second field sort –t, +1 -2 rolllist.txt15. set “.” As separator , sort on the third field by numeric ordersort –t. +2 -3 –n rolllist.txtcat > file1How are you?See you.See you later.cat > file2Hi,How are you?See you.See you Later.Dialog Acat > file3How are you?see you.See you later.16. compare file1 and file317. display the differences between file1 and file3 (try ignore case)18. display the differences between file1 and file2 (try ignore case)19. find c source files in the current directory or any of its subdirectoriesfind . –name ‘*.c’20. find java source files in your home directoryfind $HOME –name ‘*.java’21. grant all exe files (extended name is exe) in the current directory or its subdirectories permission 777find . -name '*.exe' -ls -exec chmod 777 {} \;22. create a hard link file1link for file1ln file1 file1link23. display the hard link count for file1 and file1linkls -l file1 file1link24. remove file1rm file125. display the hard link count for file1linkls –l file1link26. create a soft link file1 for file1linkln –s file1link file127. use ls –l display attributes of file1 and file1linkls -l file1 file1link28. remove file1linkrm file1link29. display the content of file1cat file130. use ls-l display file1ls –l file131. create a directory tartest in your home directorymkdir ~/tartest32. copy all files and directories in your home directory into tartestcp –r ~/* ~/tartest33. archive tartest to tartest.tartar –cvf tartest.tar ~/tartest34. archive tartest to tartest1.tar with gzip optiontar –zcvf tartest1.tar ~/tartest35. display file size of tartest.tar and tartest1.tarls –l tartest.tar tartest1.tar36. archive the current directory to current.tartar –cvf current.tar .37. create a directory tartest2 in your home directorymkdir ~/tartest238. extract tartest.tar tar –xvf tartest.tar 39. copy tartest1.tar to tartest2 and extract tartest1.tar in tartest2cp tartest1.tar ~/tartest2cd ~/tartest2tar –zxvf
View Full Document