User Tools

Site Tools


journal:spring2019:bmather2:week2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
journal:spring2019:bmather2:week2 [2019/01/29 16:14]
bmather2
journal:spring2019:bmather2:week2 [2019/01/30 19:19] (current)
bmather2
Line 3: Line 3:
 ====January 24, 2019==== ====January 24, 2019====
  
 +Unix is a multi-user, multitasking os\\ 
 +And the class uses a customized version of linux debian\\ ​
  
  
-public dir: /​var/​public/​spring2019/​unix\\ ​ 
  
-**types of files:\\** +__**Unix Philosophy:**__ \\ 
 +-Everything is a file\\  
 +-Small is beautiful\\  
 +-Do one thing and do it extremely well\\  
 + 
 + 
 +**Types of files:** \\
 -regular\\ ​ -regular\\ ​
 -directory\\ ​ -directory\\ ​
 -special\\ ​ -special\\ ​
  
-unix is a multi user multitasking os\\  
-class runs linux debian\\ ​ 
  
-__**Unix Philosophy:\\**__  + 
--everything is a file\\  +**Various Symbols and Options:**\\
--small is beautiful\\  +
--do one thing and do it extremely well\\ +
  
 '​.'​ means current position\\ ​ '​.'​ means current position\\ ​
Line 27: Line 30:
 '​-f'​ to force command without prompt\\ ​ '​-f'​ to force command without prompt\\ ​
 '​-i'​ to give you a descriptive prompt\\ ​ '​-i'​ to give you a descriptive prompt\\ ​
 +'/​dev/​null'​ a place you can redirect things to to discard them\\
 +
 +
 +**Various commands:​**\\
  
 -'​man'​ for manual (can add option to search manual for)\\ -'​man'​ for manual (can add option to search manual for)\\
-   ​-'/'​ to search and use '​n'​ and '​N'​ to go to next an prev instances of search\\ ​+   ​-'/'​ to search and use '​n'​ and '​N'​ to go to next an previous ​instances of search\\ ​
 -'​touch'​ makes a file\\ ​ -'​touch'​ makes a file\\ ​
 -'​echo'​ displays things to terminal\\ ​ -'​echo'​ displays things to terminal\\ ​
Line 36: Line 43:
  
  
 +**Redirecting data:**\\
 <,<<,<<< ​    ​STDIN ​  file for input (keyboard)\\ ​ <,<<,<<< ​    ​STDIN ​  file for input (keyboard)\\ ​
 1>,​1>>,​1>>> ​ STDOUT ​ file for output (terminal)\\ ​ 1>,​1>>,​1>>> ​ STDOUT ​ file for output (terminal)\\ ​
 2>,​2>>,​2>>> ​ STDERR ​ file for \\  2>,​2>>,​2>>> ​ STDERR ​ file for \\ 
  
-single ​for write (overwrite)\\  +Single ​for write (overwrite)\\  
-double ​for append (new line when used with cat)\\ ​+Double ​for append (new line when used with echo or cat)\\ ​
  
-when using ls -l, the first character ​determines ​file type:\\+ 
 + 
 +**Managing File Permissions:​**\\ 
 + 
 +When using 'ls -l (filename)'​, the first character ​of output shows the file type:\\
  
 '​-'​ for regular ​             regular files\\ '​-'​ for regular ​             regular files\\
Line 56: Line 67:
 '​c'​ for character device\\ '​c'​ for character device\\
  
-next three are for the user\\ +The next three represent ​the user's permissions\\ 
-next three are for group\\ +The next three are for the group\\ 
-last three for other\\+And the last three for other\\
  
-each space showing ​a permission on that file for that user/​group/​other\\+Each space shows a permission on that file for that user/​group/​other\\
  
 '​-'​ nothing ​             0\\ '​-'​ nothing ​             0\\
Line 67: Line 78:
 '​r'​ read                 4\\ '​r'​ read                 4\\
  
-then use these numbers to compute a number ​for each section ​then putting them together to make a code to use with chmod to change permissions (i.e. 600 = "- rw- --- ---" read\write only for user)\\+Octal permissions are added together ​for each section ​and put together to make a code to use with the\\ 'chmod (permission,​ filename)'​ command ​to change permissions\\ 
 +(i.e. 600 = "- rw- --- ---" read\write only for user)\\
  
 +'​tty'​ shows your terminal number found in /dev/pts\\
 +Then you can ls your number from that directory and chmod the permissions (changing write for group disables messages)\\
  
-'​|'​ is a pipe, uses the output of the left side as input for the right\\ 
  
-Rules\\ +__**The Pipe: '​|'​ **__\\ 
-1. only use non-interactive commands\\ +It uses the output of the left side as input for the right\\ 
-2. only commands that make standard output on left\\ + 
-3. only commands that use standard input on right\\+**Rules**\\ 
 +1. Only use non-interactive commands\\ 
 +2. Only commands that make standard output on left\\ 
 +3. Only commands that use standard input on right\\ 
 + 
 + 
 +Commands commonly used with a pipe are:\\
  
 '​more'​ stops output at the end of a page\\ '​more'​ stops output at the end of a page\\
Line 81: Line 100:
 '​wc'​ shows info, lines, words, characters (-w for words -l for lines and -c? for characters only)\\ '​wc'​ shows info, lines, words, characters (-w for words -l for lines and -c? for characters only)\\
  
-'/​dev/​null'​ a place you can redirect things to to discard them\\ 
  
-'​tty'​ shows terminal number in /dev/pts\\ 
-then ls your number from that dir and you can chmod the permissions (changing write for group disables messages) 
  
journal/spring2019/bmather2/week2.txt · Last modified: 2019/01/30 19:19 by bmather2