Changes between Version 17 and Version 18 of cypress/BasicLinuxComands
- Timestamp:
- 08/23/16 16:07:35 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
cypress/BasicLinuxComands
v17 v18 116 116 117 117 == rmdir == 118 Removes directories. The '''rmdir''' is a safer approach than using '''rm -r''' as it will only act on empty directories. 118 Removes directories. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL. 119 120 The '''rmdir''' is a safer approach than using '''rm -r''' as it will only act on empty directories. 119 121 120 122 {{{ … … 131 133 132 134 === cp === 133 Copy file to new location. 135 Copy file to new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''. 134 136 135 137 In the example below sourcefile already exists, and destinationfile may or may not exist and will become a copy of sourcefile. … … 144 146 Take note of the order here: source first, destination second. This is the standard order across most *nix commands. 145 147 === mv === 146 Move a file to a new location. 148 Move a file to a new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''. 147 149 {{{ 148 150 [tulaneID@cypress1 ~]$ mv file1 file2 … … 196 198 === more === 197 199 '''more''' is like '''cat''', except it prints the file one page at a time. The spacebar is used to continue on to the next page. 200 201 === less === 202 '''less''' is like '''more''', except it handles large files more efficiently in memory and supports a bit more flexibility in file navigation. 203 204 === zmore, zless === 205 '''zmore''' and '''zless''' are the counterparts of '''more''' and '''less''', respectively, for viewing files (with extension '''.gz''') compressed via '''gzip'''. 206 207 (See also '''man gzip'''.) 198 208 199 209 == Basic Linux Commands Exercise == … … 338 348 }}} 339 349 350 === I/O Redirection ( >, >> and < ) === 351 352 Redirect input or output. CAUTION: THERE IS NO UNDOING THE REDIRECT OVERWRITE `>` COMMAND. 353 354 The redirect output operator, `>`, takes the output (see '''man stdout''') of a command and redirects it to a file. For example we could "redirect" the output of '''grep''' above to a file in order to capture the results of the above search 355 356 {{{ 357 [tulaneID@cypress1 examples]$ head -5 numbers.txt | grep 1 > grep.out 358 [tulaneID@cypress1 examples]$ cat grep.out 359 01 360 }}} 361 362 The redirect append output operator `>>` does the same as `>` except the former APPENDS whereas the latter OVERWRITES the output to the specified file. 363 364 The redirect input operator `<` is used for redirecting input 365 366 {{{ 367 [tulaneID@cypress1 examples]$ cat < grep.out 368 01 369 }}} 370 340 371 === history === 341 372 Displays the command history list with line numbers. You can add an optional integer, n, argument to display only the last n commands