cs6
play

CS6 Practical System Skills Fall 9 edition Leonhard Spiegelerg - PowerPoint PPT Presentation

CS6 Practical System Skills Fall 9 edition Leonhard Spiegelerg lspiegel@s.rown.edu . Reap 2 / 68 . Reap / / . .. ~ cd ls 3 / 68 . Reap uiz /usr/local/bin


  1. CS6 Practical System Skills Fall ���9 edition Leonhard Spiegel�erg lspiegel@�s.�rown.edu

  2. ��.�� Re�ap 2 / 68

  3. ��.�� Re�ap / ⇒ / ⇒ . .. ~ cd ls 3 / 68

  4. ��.�� Re�ap �uiz /usr/local/bin cd .. cd ./../.. cd cd ~ 4 / 68

  5. ��.�� Re�ap �uiz /usr/local/bin cd .. /usr/local cd ./../.. /usr cd HOME directory cd ~ HOME directory 5 / 68

  6. ��.�� Re�ap �uiz cwd Documents mail .backups 2018 2019 .backupdb ls Documents ls ls -a 6 / 68

  7. ��.�� Re�ap �uiz cwd Documents ls Documents mail .backups ls: Documents: No such file or directory 2018 2019 .backupdb ls mail ls -a . .. mail .backups 7 / 68

  8. �� Files CS6 Pra�ti�al System Skills Fall ���9 Leonhard Spiegel�erg lspiegel@�s.�rown.edu

  9. ��.�� C�eatin� and deletin� files mkdir directory_name touch file rmdir directory_name rm file 9 / 68

  10. ��.�� Wo�kin� �ith di�e�to�ies -p mkdir -p folder/subfolder/subsubfolder 10 / 68

  11. ��.�� Deletin� files and di�e�to�ies 11 / 68

  12. ��.�� Deletin� files -r rm -r folder/ 12 / 68

  13. ��.�� Deletin� files in a t�ee -r -i Example: rm -ri folder/ 13 / 68

  14. ��.�� Deletin� files in a t�ee -r -f Example: rm -rf folder/ 14 / 68

  15. Ba�k to the te�minal...

  16. ��.�� O��anizin� files move file from src location to dest location mv src ... dest ⇒ can be used to rename a file copy file from src location to dest cp src ... dest location 16 / 68

  17. ��.�� Cop�in� di�e�to�ies cp -R src dest / cp 17 / 68

  18. ��.�� Cop�in� di�e�to�ies Examples: cp -R folder copy cwd cwd 18 / 68

  19. ��.�� Cop�in� di�e�to�ies Examples: cp -R folder/ copy cwd cwd 19 / 68

  20. ��.�� Cop�in� di�e�to�ies Examples: cp -R folder/ . cwd cwd 20 / 68

  21. ��.�� Cop�in� di�e�to�ies Examples: cp -R folder/ dest cwd cwd 21 / 68

  22. ��.�� Cop�in� di�e�to�ies Examples: cp -R folder dest cwd cwd 22 / 68

  23. ��.�� Mo�in� di�e�to�ies mv folder dest mv folder/ dest cwd cwd 23 / 68

  24. ��.�� Renamin� files/di�e�to�ies ⇒ dest mv ⇒ -n -i cwd cwd mv folder/a.txt folder/file.txt 24 / 68

  25. ��.�� Renamin� files/di�e�to�ies ⇒ cwd cwd mv folder dir 25 / 68

  26. Ho� to m� o� �p a su�set o� files?

  27. ��.�� UNIX �ild�a�ds ⇒ 27 / 68

  28. ��.�� UNIX �ild�a�ds * ? [...] [a-z] [0-9] [a-zA-Z] [a-zA-Z0-9] [!...] [!123] Hint: escape [, *, ? using a backslash, e.g. * ⇒ \* 28 / 68

  29. ��.�� UNIX �ild�a�ds - e�ample ⇒ /*folder/file?.txt /folder/file1.txt /subfolder/filea.txt /subsubfolder/fileB.txt folder/file.txt folder/file1.txt /subfolder/a.txt /folder/subfolder/file1.txt 29 / 68

  30. ��.�� UNIX �ild�a�ds mv *.jpg images/ mv *?.jpg images/ 30 / 68

  31. ��.�� UNIX �ild�a�ds mv *.jpg images/ mv *?.jpg images/ 31 / 68

  32. ��.�� UNIX �ild�a�ds cp [0-9][0-9]_*.pdf slides/ 32 / 68

  33. ��.�� UNIX �ild�a�ds ⇒ ⇒ mv {*.png,*.jpg} images/ 33 / 68

  34. ��.�� B�a�e e�pansion {...} {*.png,*.jpg} ⇒ *.png *.jpg Example: mv {*.png,*.jpg} images/ ⇒ mv *.png *.jpg images/ 34 / 68

  35. ��.�� B�a�e e�pansion Shorter version: mv *.{png,jpg} images/ ⇒ mv *.png *.jpg images/ 35 / 68

  36. ��.�� B�a�e e�pansion Example: ls {lecture,slide*}_??.{pdf,dvi} ⇒ ls lecture_??.pdf lecture_??.dvi slide*_??.pdf slide*_??.dvi 36 / 68

  37. ��.�� B�a�e e�pansion ⇒ Examples: ls {a,b{c,d}}.txt ⇒ ls a.txt b{c,d}.txt ⇒ ls a.txt bc.txt bd.txt ls {a,{b,c}}.txt ⇒ ls a.txt b.txt c.txt 37 / 68

  38. ��.�� B�a�e e�pansion cp file{,.backup} ⇒ cp file file.backup 38 / 68

  39. ��.�� UNIX �ild�a�ds cp *.*{,.backup} ⇒ cp *.* *.*.backup ⇒ ⇒ 39 / 68

  40. Ho� �an �e a��ess the �ontents o� a file?

  41. ��.�� File t�pes ⇒ ⇒ 41 / 68

  42. ��.�� Te�t files cat file … 42 / 68

  43. ��.�� Te�t files - ASCII ⇒ ⇒ 43 / 68

  44. ��.�� Te�t files - ISO/IEC ����-� ⇒ ⇒ 44 / 68

  45. ��.�� Te�t files - ASCII and UTF-� en�odin� ⇒ 45 / 68

  46. ��.�� Te�t files - UTF-� en�odin� number of Byte 1 Byte 2 Byte 3 Byte 4 bytes 1 ASCII chars 0xxxxxxx Latin, Greek, Cyrillic, Coptic, 2 Armenian, Hebrew, Arabic, 110xxxxx 10xxxxxx Syriac, Thaana, ... 3 Chinese, Japanese, Korean, …. 1110xxxx 10xxxxxx 10xxxxxx 4 Math symbols, Emojis 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx 46 / 68

  47. ��.�� Editin� te�t files ⇒ 47 / 68

  48. ��.�� Bina�� files ⇒ hexdump file ⇒ 48 / 68

  49. ��.�� he�dump hexdump penguin.jpg 0000000 ff d8 ff e1 12 d4 45 78 69 66 00 00 4d 4d 00 2a 0000010 00 00 00 08 00 0c 01 00 00 03 00 00 00 01 08 00 0000020 00 00 01 01 00 03 00 00 00 01 0c 00 00 00 01 02 0000030 00 03 00 00 00 03 00 00 00 9e 01 06 00 03 00 00 0000040 00 01 00 02 00 00 01 12 00 03 00 00 00 01 00 01 0000050 00 00 01 15 00 03 00 00 00 01 00 03 00 00 01 1a 0000060 00 05 00 00 00 01 00 00 00 a4 01 1b 00 05 00 00 0000070 00 01 00 00 00 ac 01 28 00 03 00 00 00 01 00 02 0000080 00 00 01 31 00 02 00 00 00 24 00 00 00 b4 01 32 0000090 00 02 00 00 00 14 00 00 00 d8 87 69 00 04 00 00 ... 49 / 68

  50. ��.�� he�dump �s. �at cat file.txt Tux loves CS6 hexdump -c file.txt 0000000 T u x l o v e s C S 6 \n 000000e hexdump file.txt 0000000 54 75 78 20 6c 6f 76 65 73 20 43 53 36 0a 000000e ⇒ 50 / 68

  51. ��.�� file file file Example: file penguin.jpg ⇒ penguin.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=12, height=3072, ⇒ bps=0, PhotometricIntepretation=RGB, orientation=upper-left, width=2048], progressive, precision 8, 512x513, frames 3 51 / 68

  52. ��.�� Uni� �o�a�ula�� so �a� cd mv ls cp touch cat rm hexdump mkdir rmdir file 52 / 68

  53. �� Use�s and Pe�missions CS6 Pra�ti�al System Skills Fall ���9 Leonhard Spiegel�erg lspiegel@�s.�rown.edu

  54. ��.�� Pe�missions 54 / 68

  55. ��.�� Pe�missions 55 / 68

  56. ��.�� Pe�missions �o� di�e�to�ies 56 / 68

  57. ��.�� Use�s and pe�missions ⇒ ⇒ 57 / 68

  58. ��.�� Use�s and pe�missions ⇒ 58 / 68

  59. ��.�� ls lon��o�mat owner and user are usually the same! Terms are used interchangeably here often. ls -l total 88 -rw-r--r-- 1 sealion friends 14 9 Sep 8:01 file.txt -rw-r--r-- 1 sealion friends 40390 9 Sep 9:00 penguin.jpg 59 / 68

  60. ��.�� Pe�missions - rw- r-- --x - d l p s b c 60 / 68

  61. ��.�� Settin� pe�missions - �hmod chmod mode file … ⇒ ⇒ 61 / 68

  62. ��.�� �hmod - s�m�oli� mode chmod u=rw,g=rx,o= file.txt 62 / 68

  63. ��.�� �hmod - nume�i� mode 0 000 --- 1 001 --x 2 010 -w- 3 011 -wx 4 100 r-- 5 101 r-x 6 110 rw- 7 111 rwx chmod u=rw,g=rx,o= file.txt ⇒ chmod 650 file.txt 63 / 68

  64. Mo�e details ne�t le�tu�e!

  65. P�e�ie� ne�t le�tu�e ⇒ ⇒ ⇒ ⇒ 65 / 68

  66. P�e�ie� HW��: 66 / 68

  67. P�e�ie� La���: ⇒ 67 / 68

  68. End of lecture. Next class: Thu, �pm-�:20pm @ CIT �77

Recommend


More recommend