Changes between Version 28 and Version 29 of cypress/BasicLinuxComands


Ignore:
Timestamp:
Aug 21, 2019 12:15:51 PM (2 years ago)
Author:
cbaribault
Comment:

For readability, changed bold to block text for command flags in in-line text, etc.

Legend:

Unmodified
Added
Removed
Modified
  • cypress/BasicLinuxComands

    v28 v29  
    7272{{{
    7373[tulaneID@cypress1 ~]$ ls
    74 woekshop
     74hpc-workshop
    7575[tulaneID@cypress1 ~]$
    7676}}}
     
    8484}}}
    8585
    86 Setting the ''-l'' flag will display files along with their permissions and ownership.
     86Setting the {{{-l}}} flag will display files along with their permissions and ownership.
    8787{{{
    8888[tulaneID@cypress1 ~]$ ls -l hpc-workshop
     
    132132{{{
    133133[tulaneID@cypress1 ~]$ rm hpc-workshop
    134 }}}
    135 If you would like to remove a directory and all of its contents use the following command:
     134rm: cannot remove `hpc-workshop': Is a directory
     135[tulaneID@cypress1 ~]$
     136}}}
     137If you would like to remove a directory and all of its contents - with prompts for each directory and subdirectory - use the following command:
    136138{{{
    137139[tulaneID@cypress1 ~]$ rm -ri hpc-workshop
     
    141143[tulaneID@cypress1 ~]$
    142144}}}
    143 ctrl+c to exit.
    144 
    145 The ''r'' flag specifies to remove files/directories recursively. ''i'' specifies to prompt before deleting each file.
    146 
    147 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:
     145Use Ctrl+c to exit the prompts.
     146
     147The {{{-r}}} flag specifies to remove files/directories recursively. {{{-i}}} specifies to prompt before deleting each file.
     148
     149If 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:
    148150{{{
    149151[tulaneID@cypress1 ~]$ rm -rf hpc-workshop
     
    175177
    176178=== cp ===
    177 Copy file to new location.  CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''.
    178 
    179 In the example below sourcefile already exists, and destinationfile may or may not exist and will become a copy of sourcefile.
     179Copy file to new location.  CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS {{{-i}}} and {{{-n}}}.
     180
     181In the example below '''sourcefile''' already exists, and '''destinationfile''' may or may not already exist and will become a copy of '''sourcefile'''.
    180182{{{
    181183[tulaneID@cypress1 ~]$ cp sourcefile destinationfile
    182184}}}
    183 To copy a directory and all of its contents we use the recursive flag '''-r''':
     185To copy a directory and all of its contents we use the recursive flag {{{-r}}}:
    184186{{{
    185187[tulaneID@cypress1 ~]$ cp -r sourcedir destinationdir
     
    188190Take note of the order here: source first, destination second. This is the standard order across most *nix commands.
    189191=== mv ===
    190 Move a file to a new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''.
     192Move a file to a new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS {{{-i}}} and {{{-n}}}.
    191193{{{
    192194[tulaneID@cypress1 ~]$ mv file1 file2
     
    231233[tulaneID@cypress1 ~]$
    232234}}}
    233 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.
     235The {{{-f}}} flag can be used to tail a file interactively. New additions to the end of the file will be printed to your screen.
    234236
    235237=== head ===
     
    283285}}}
    284286
    285 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.
     287Additionally, 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.
    286288
    287289{{{
     
    315317Display disk quotas.
    316318
    317 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.
     319The {{{-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.
    318320{{{
    319321[tulaneID@cypress1 ~]$quota -s
     
    344346[tulaneID@cypress1 ~]$
    345347}}}
    346 Use the ''-v'' flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.
     348Use the {{{-v}}} flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.
    347349{{{
    348350[tulaneID@cypress1 ~]$ grep -v dog animals
     
    355357[tulaneID@cypress1 ~]$
    356358}}}
    357 The ''-i'' flag will search without case-sensitivity.
     359The {{{-i}}} flag will search without case-sensitivity.
    358360{{{
    359361[tulaneID@cypress1 ~]$ grep -i dog animals
     
    364366[tulaneID@cypress1 ~]$
    365367}}}
    366 The ''-i'' and ''-v'' flag can be combined to exclude all lines containing the search term regardless of capitalization.
     368The {{{-i}}} and {{{-v}}} flags can be combined to exclude all lines containing the search term regardless of capitalization.
    367369{{{
    368370[tulaneID@cypress1 ~]$ grep -iv dog animals
     
    376378Searches 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.
    377379
    378 You can search for a file by name using the '''-name''' flag as your search criteria
     380You can search for a file by name using the {{{-name}}} flag as your search criteria
    379381{{{
    380382[tulaneID@cypress1 ~]$ find /home/tulaneID/ -name file1.txt
     
    452454
    453455=== chmod  ===
    454 The '''chmod''' commands allow a user to modify the permissions of files and directories that they own. To see the permissions of a file/directory we can use the '''ls -l''' command
     456The '''chmod''' commands allow a user to modify the permissions of files and directories that they own. To see the permissions of a file/directory we can use the {{{ls -l}}} command
    455457
    456458{{{