Changes between Version 3 and Version 4 of cypress/BasicLinuxComands


Ignore:
Timestamp:
05/14/15 12:08:29 (10 years ago)
Author:
cmaggio
Comment:

reformatted for trac and cypress

Legend:

Unmodified
Added
Removed
Modified
  • cypress/BasicLinuxComands

    v3 v4  
    7373
    7474In the example below file1 already exists, and file2 will become the copy.
    75 
     75{{{
    7676[tulaneID@cypress1 ~]$ cp file1 file2
     77}}}
    7778To copy a directory and all of its contents:
    78 
     79{{{
    7980[tulaneID@cypress1 ~]$ cp -r dir1 dir2
    80 mv
     81}}}
     82
     83=== mv ===
    8184Move a file to a new location.
    82 
     85{{{
    8386[tulaneID@cypress1 ~]$ mv file1 file2
    8487[tulaneID@cypress1 ~]$ ls file1
     
    8689[tulaneID@cypress1 ~]$ ls file2
    8790file2
    88 Unlike cp, the mv command does not create a second instance of the file or directory.
    89 
    90 quota
     91}}}
     92Unlike '''cp''', the '''mv''' command does not create a second instance of the file or directory.
     93
     94=== quota ===
    9195Display disk quotas.
    9296
    93 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.
    94 
    95 user@sphynx>quota -s
    96 Disk quotas for user wcurry (uid 65098):
    97 Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
    98 /scratch03  86978M   1024G   2048G            180k       0    391m       
    99 /u01        2723M  40000M  40050M           19136       0       0
    100 cat
    101 Print the entire contents of a file.
    102 
     97The '-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.
     98{{{
     99[tulaneID@cypress1 ~]$quota -s
     100Disk quotas for user tulaneID (uid 12345):
     101     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
     102master.10ge.cluster:/home
     103                  6459M  10000M  10000M           23260    250k    250k       
     104master.10ge.cluster:/share/apps
     105                  6459M  10000M  10000M           23260    250k    250k     
     106}}}
     107
     108=== cat ===
     109Print the entire contents of a file (short for conCATenate).
     110{{{
    103111[tulaneID@cypress1 ~]$ cat daysofweek.txt
    104112monday
     
    109117saturday
    110118sunday
    111 more
    112 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.
    113 
    114 grep
    115 Find text in a file. grep will return every line in the file that matches your search term.
    116 
     119}}}
     120
     121=== more ===
     122'''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.
     123
     124=== grep ===
     125Find text in a file. '''grep''' will return every line in the file that matches your search term.
     126{{{
    117127[tulaneID@cypress1 ~]$ cat animals
    118128dog
     
    126136[tulaneID@cypress1 ~]$ grep dog animals
    127137dog
    128 Use the -v flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.
    129 
     138}}}
     139Use the ''-v'' flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.
     140{{{
    130141[tulaneID@cypress1 ~]$ grep -v dog animals
    131142Dog
     
    135146bullfrog
    136147Little Doggie
    137 The -i flag will search without case-sensitivity.
    138 
     148}}}
     149The ''-i'' flag will search without case-sensitivity.
     150{{{
    139151[tulaneID@cypress1 ~]$ grep -i dog animals
    140152dog
     
    142154DOG
    143155Little Doggie
    144 The -i and -v flag can be combined to exclude all lines containing the search term regardless of capitalization.
    145 
     156}}}
     157The ''-i'' and ''-v'' flag can be combined to exclude all lines containing the search term regardless of capitalization.
     158{{{
    146159[tulaneID@cypress1 ~]$ grep -iv dog animals
    147160cat
    148161Racoon
    149162bullfrog
    150 sed
    151 sed is a powerful text stream editor. There are many uses of this program, but the most common is its search and replace function. Combined with regular expressions, this command can be used to seek out complex strings in your code and replace them with modifications. Please visit Sed - An Introduction and Tutorial for more information.
    152 
     163}}}
     164
     165=== sed ===
     166'''sed''' is a powerful text stream editor. There are many uses of this program, but the most common is its search and replace function. Combined with regular expressions, this command can be used to seek out complex strings in your code and replace them with modifications. Please visit [[http://www.grymoire.com/Unix/Sed.html|Sed - An Introduction and Tutorial]] for more information.
     167{{{
    153168[tulaneID@cypress1 ~]$ cat animals
    154169dog
     
    168183bullfrog
    169184Little Doggie
    170 awk
    171 awk is a programming language used to modify files. One common use of awk is printing specific columns of a text stream or file.
    172 
     185}}}
     186
     187=== awk ===
     188'''awk''' is a programming language used to modify files. One common use of '''awk''' is printing specific columns of a text stream or file.
     189{{{
    173190[tulaneID@cypress1 ~]$ cat sample.data
    1741910.3 0.22 1.8
     
    1801973.1 3.0
    1811980.2 3.2
    182 The above command printed out the 1st and 3rd columns of the sample.data file.
    183 
    184 For more information on awk please visit Awk - A Tutorial and Introduction.
    185 
    186 tail
     199}}}
     200The above command printed out the 1st and 3rd columns of the '''sample.data''' file.
     201For more information on awk please visit [[http://www.grymoire.com/Unix/Awk.html|Awk - A Tutorial and Introduction]].
     202
     203=== tail ===
    187204Displays lines from the end of a file. Useful for viewing recent results in an output file.
    188 
     205{{{
    189206[tulaneID@cypress1 ~]$ cat animals
    190207dog
     
    200217bullfrog
    201218Little Doggie
    202 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.
    203 
    204 head
    205 Head is much like tail, except it prints from the top of a file.
     219}}}
     220The ''-f'' flag can be used to tail a file interactively. New additions to the end of the file will be printed to your screen.
     221
     222=== head ===
     223'''head''' is much like '''tail''', except it prints from the top of a file.