Changes between Version 32 and Version 33 of cypress/BasicLinuxComands


Ignore:
Timestamp:
Mar 20, 2020 12:11:52 PM (21 months ago)
Author:
cbaribault
Comment:

Removed references to /lustre…, made obsolete due to use of github downloads. Also, replaced "flag" with the documented *nix term "option".

Legend:

Unmodified
Added
Removed
Modified
  • cypress/BasicLinuxComands

    v32 v33  
    4545}}}
    4646
    47 And you can navigate using either relative or absolute paths. That is, you can enter directory paths relative to your current location, or you can entire the entire path starting with the root directory.
     47=== Note ===
     48You can specify directories and file names as arguments for '''cd''' and most other *nix commands as needed using either relative paths (without initial "/") or absolute paths (beginning with "/").
     49When you specify directories and file names using relative paths, those paths are always interpreted relative to (or starting from) your current working directory (the result of '''pwd'''), whereas absolute paths are always interpreted independently of your current working directory (or starting from root directory /).
    4850
    4951{{{
     
    5860Lastly, if you ever get lost you can use the tilde (~ - or simply **cd** with no argument!) to return to your HOME directory.
    5961{{{
    60 [tulaneID@cypress1 home]$ cd ~
     62[tulaneID@cypress1 home]$ cd
    6163[tulaneID@cypress1 ~]$ pwd
    6264/home/tulaneID
     
    8183}}}
    8284
    83 Setting the {{{-l}}} flag will display files along with their permissions and ownership.
     85Using the {{{-l}}} option will display files using the long listing format, including their permissions, ownership, size, and last date modified.
    8486{{{
    8587[tulaneID@cypress1 ~]$ ls -l hpc-workshop
     
    142144Use Ctrl+c to exit the prompts.
    143145
    144 The {{{-r}}} flag specifies to remove files/directories recursively. {{{-i}}} specifies to prompt before deleting each file.
    145 
    146 If you are confident with the command line and your understanding of file locations you can use the {{{-f}}} flag instead of {{{-i}}} to force deletion of all files without prompting:
     146The {{{-r}}} option specifies to remove files/directories recursively. {{{-i}}} specifies to prompt before deleting each file.
     147
     148If you are confident with the command line and your understanding of file locations you can use the {{{-f}}} option instead of {{{-i}}} to force deletion of all files without prompting:
    147149{{{
    148150[tulaneID@cypress1 ~]$ rm -rf hpc-workshop
     
    180182[tulaneID@cypress1 ~]$ cp sourcefile destinationfile
    181183}}}
    182 To copy a directory and all of its contents we use the recursive flag {{{-r}}}:
     184To copy a directory and all of its contents we use the recursive option {{{-r}}}:
    183185{{{
    184186[tulaneID@cypress1 ~]$ cp -r sourcedir destinationdir
     
    199201
    200202=== Note ===
    201 Here and in the following, in order to try out the commands shown, you may copy the files needed from '''/lustre/project/workshop''' to your home directory.
    202 
    203 {{{
    204 tulaneID@cypress1 ~]$ cp /lustre/project/workshop/textfiles/daysofweek.txt .
    205 tulaneID@cypress1 ~]$ cp /lustre/project/workshop/animals .
     203Here and in the following, in order to try out the commands shown, you may copy the files needed from your downloaded '''hpc-workshop''' directory to your home directory.
     204
     205{{{
     206tulaneID@cypress1 ~]$ cp hpc-workshop/textfiles/daysofweek.txt .
     207tulaneID@cypress1 ~]$ cp hpc-workshop/animals .
    206208tulaneID@cypress1 ~]$ ls
    207209animals  daysofweek.txt  hpc-workshop
     
    241243[tulaneID@cypress1 ~]$
    242244}}}
    243 The {{{-f}}} flag can be used to tail a file interactively. New additions to the end of the file will be printed to your screen.
     245The {{{-f}}} option can be used to tail a file interactively. New additions to the end of the file will be printed to your screen as they occur.
    244246
    245247=== head ===
     
    293295}}}
    294296
    295 Additionally, the behavior of the '''ls''' command can be modified by the addition of option flags. By default '''ls''' does not list any "hidden" files and subdirectories. To display all files and subdirectories one must add the {{{-a}}} flag.
     297Additionally, the behavior of the '''ls''' command can be modified by the use of options. By default '''ls''' does not list any "hidden" files and subdirectories. To display all files and subdirectories one must add the {{{-a}}} option.
    296298
    297299{{{
     
    325327Display disk quotas.
    326328
    327 The {{{-s}}} flag translates the output into a readable format. If your blocks column is equal to or greater than the quota column, you have exceeded your available disk space.
     329The {{{-s}}} option translates the output into a readable format. If your blocks column is equal to or greater than the quota column, you have exceeded your available disk space.
    328330{{{
    329331[tulaneID@cypress1 ~]$quota -s
     
    354356[tulaneID@cypress1 ~]$
    355357}}}
    356 Use the {{{-v}}} flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.
     358Use the {{{-v}}} option to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.
    357359{{{
    358360[tulaneID@cypress1 ~]$ grep -v dog animals
     
    365367[tulaneID@cypress1 ~]$
    366368}}}
    367 The {{{-i}}} flag will search without case-sensitivity.
     369The {{{-i}}} option will search without case-sensitivity.
    368370{{{
    369371[tulaneID@cypress1 ~]$ grep -i dog animals
     
    374376[tulaneID@cypress1 ~]$
    375377}}}
    376 The {{{-i}}} and {{{-v}}} flags can be combined to exclude all lines containing the search term regardless of capitalization.
     378The {{{-i}}} and {{{-v}}} options can be combined to exclude all lines containing the search term regardless of capitalization.
    377379{{{
    378380[tulaneID@cypress1 ~]$ grep -iv dog animals
     
    386388Searches for files in a directory hierarchy. The '''find''' takes a directory as an argument and will search in that directory and all of it's subdirectories for files that match the search criteria. If no directory is specified, the current directory is used.
    387389
    388 You can search for a file by name using the {{{-name}}} flag as your search criteria
     390You can search for a file by name using the {{{-name}}} option with its accompanying argument as your search criteria
    389391{{{
    390392[tulaneID@cypress1 ~]$ find /home/tulaneID/ -name file1.txt