Changes between Version 19 and Version 20 of cypress/BasicLinuxComands


Ignore:
Timestamp:
08/24/16 14:25:57 (8 years ago)
Author:
cbaribault
Comment:

CEB 20160824 - added command "which", also added or corrected return prompt in multiple example CLI sites.

Legend:

Unmodified
Added
Removed
Modified
  • cypress/BasicLinuxComands

    v19 v20  
    1616[tulaneID@cypress1 ~]$ pwd
    1717/home/tulaneID
     18[tulaneID@cypress1 ~]$
    1819}}}
    1920
    2021=== cd ===
    2122
    22 The '''cd''' command changes directory.
     23The '''cd''' command changes directory. (Observe the change of directory name in the resulting system prompt as well!)
    2324
    2425{{{
    2526[tulaneID@cypress1 ~]$ cd NextDirectoryDown
    26 [tulaneID@cypress1 ~]$ pwd
     27[tulaneID@cypress1 NextDirectoryDown]$ pwd
    2728/home/tulaneID/NextDirectoryDown
     29[tulaneID@cypress1 NextDirectoryDown]$
    2830}}}
    2931
     
    3133
    3234{{{
    33 [tulaneID@cypress1 ~]$ pwd
     35[tulaneID@cypress1 NextDirectoryDown]$ pwd
    3436/home/tulaneID/NextDirectoryDown
    35 [tulaneID@cypress1 ~]$ cd ..
     37[tulaneID@cypress1 NextDirectoryDown]$ cd ..
    3638[tulaneID@cypress1 ~]$ pwd
    3739/home/tulaneID
     40[tulaneID@cypress1 ~]$
    3841}}}
    3942
     
    4447/home
    4548[tulaneID@cypress1 ~]$ cd tulaneID/NextDirectoryDown
    46 [tulaneID@cypress1 ~]$ pwd
     49[tulaneID@cypress1 NextDirectoryDown]$ pwd
    4750/home/tulaneID/NextDirectoryDown
    4851[tulaneID@cypress1 ~]$ cd /home
    4952[tulaneID@cypress1 ~]$ pwd
    5053/home
    51 }}}
    52 
    53 Lastly, if you ever get lost you can use the tilde (~) to return to your HOME directory.
     54[tulaneID@cypress1 ~]$
     55}}}
     56
     57Lastly, if you ever get lost you can use the tilde (~ - or simply **cd** with no argument!) to return to your HOME directory.
    5458{{{
    5559[tulaneID@cypress1 ~]$ cd ~
    5660[tulaneID@cypress1 ~]$ pwd
    5761/home/tulaneID
     62[tulaneID@cypress1 ~]$
    5863}}}
    5964
     
    6368[tulaneID@cypress1 ~]$ ls
    6469a.out  code.c  Makefile
     70[tulaneID@cypress1 ~]$
    6571}}}
    6672
     
    6975[tulaneID@cypress1 ~]$ ls a.out
    7076a.out
     77[tulaneID@cypress1 ~]$
    7178}}}
    7279
     
    7885-rw-r--r-- 1 tulaneID MyGroup 0 Aug 14 10:57 code.c
    7986-rw-r--r-- 1 tulaneID MyGroup 0 Aug 14 10:57 Makefile
     87[tulaneID@cypress1 ~]$
    8088}}}
    8189
     
    8795[tulaneID@cypress1 ~]$ mkdir testdir
    8896[tulaneID@cypress1 ~]$ cd testdir
    89 [tulaneID@cypress1 ~]$ pwd
     97[tulaneID@cypress1 testdir]$ pwd
    9098/home/tulaneID/testdir
     99[tulaneID@cypress1 testdir]$
    91100}}}
    92101
     
    113122[tulaneID@cypress1 ~]$ ls testdir
    114123ls: cannot access testdir: No such file or directory
     124[tulaneID@cypress1 ~]$
    115125}}}
    116126
     
    153163[tulaneID@cypress1 ~]$ ls file2
    154164file2
     165[tulaneID@cypress1 ~]$
    155166}}}
    156167Unlike '''cp''', the '''mv''' command does not create a second instance of the file or directory.
     
    167178saturday
    168179sunday
     180[tulaneID@cypress1 ~]$
    169181}}}
    170182
     
    185197bullfrog
    186198Little Doggie
     199[tulaneID@cypress1 ~]$
    187200}}}
    188201The ''-f'' flag can be used to tail a file interactively. New additions to the end of the file will be printed to your screen.
     
    194207dog
    195208Dog
     209[tulaneID@cypress1 ~]$
    196210}}}
    197211
     
    206220
    207221(See also '''man gzip'''.)
     222
     223=== which ===
     224'''which <command name>''' tells the location of the named command.
     225{{{
     226[tulaneID@cypress1 ~]$ which zless
     227/usr/bin/zless
     228[tulaneID@cypress1 ~]$
     229}}}
    208230
    209231== Basic Linux Commands Exercise ==
     
    270292master.10ge.cluster:/share/apps
    271293                  6459M  10000M  10000M           23260    250k    250k     
     294[tulaneID@cypress1 ~]$
    272295}}}
    273296
     
    283306bullfrog
    284307Little Doggie
    285 
    286308[tulaneID@cypress1 ~]$ grep dog animals
    287309dog
     310[tulaneID@cypress1 ~]$
    288311}}}
    289312Use the ''-v'' flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.
     
    296319bullfrog
    297320Little Doggie
     321[tulaneID@cypress1 ~]$
    298322}}}
    299323The ''-i'' flag will search without case-sensitivity.
     
    304328DOG
    305329Little Doggie
     330[tulaneID@cypress1 ~]$
    306331}}}
    307332The ''-i'' and ''-v'' flag can be combined to exclude all lines containing the search term regardless of capitalization.
     
    311336Racoon
    312337bullfrog
     338[tulaneID@cypress1 ~]$
    313339}}}
    314340
     
    420446-rw-r--r-- 1 tulaneID workshop    0 Aug 18 21:50 textfile01.txt
    421447-rw-r--r-- 1 tulaneID workshop    0 Aug 18 21:50 textfile02.txt
     448[tulaneID@cypress1 ~]$
    422449}}}
    423450