Changes between Version 17 and Version 18 of cypress/BasicLinuxComands


Ignore:
Timestamp:
08/23/16 16:07:35 (8 years ago)
Author:
cbaribault
Comment:

CEB 20160823 - Added CAUTION for rmdir, cp, mv. Also added commands less, zless, zmore, >, >>, <.

Legend:

Unmodified
Added
Removed
Modified
  • cypress/BasicLinuxComands

    v17 v18  
    116116
    117117== rmdir ==
    118 Removes directories. The '''rmdir''' is a safer approach than using '''rm -r''' as it will only act on empty directories.
     118Removes directories. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL.
     119
     120The '''rmdir''' is a safer approach than using '''rm -r''' as it will only act on empty directories.
    119121
    120122{{{
     
    131133
    132134=== cp ===
    133 Copy file to new location.
     135Copy file to new location.  CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''.
    134136
    135137In the example below sourcefile already exists, and destinationfile may or may not exist and will become a copy of sourcefile.
     
    144146Take note of the order here: source first, destination second. This is the standard order across most *nix commands.
    145147=== mv ===
    146 Move a file to a new location.
     148Move a file to a new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''.
    147149{{{
    148150[tulaneID@cypress1 ~]$ mv file1 file2
     
    196198=== more ===
    197199'''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'''.)
    198208
    199209== Basic Linux Commands Exercise ==
     
    338348}}}
    339349
     350=== I/O Redirection ( >, >> and < ) ===
     351
     352Redirect input or output. CAUTION: THERE IS NO UNDOING THE REDIRECT OVERWRITE `>` COMMAND.
     353
     354The 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
     35901
     360}}}
     361
     362The redirect append output operator `>>` does the same as `>` except the former APPENDS whereas the latter OVERWRITES the output to the specified file.
     363
     364The redirect input operator `<` is used for redirecting input
     365
     366{{{
     367[tulaneID@cypress1 examples]$ cat < grep.out
     36801
     369}}}
     370
    340371=== history ===
    341372Displays the command history list with line numbers. You can add an optional integer, n, argument to display only the last n commands