Skip to content

Latest commit

 

History

History
51 lines (48 loc) · 1.26 KB

04-lab-working-with-shell.md

File metadata and controls

51 lines (48 loc) · 1.26 KB

Lab - Working with shell

  1. To check the home directory for a particular user say bob

    $ grep bob /etc/passwd | cut -d ":" -f6
    
  2. To check the home directory for a particular user using built in shell variables

    $ echo $HOME
    
  3. In the command echo Welcome, what does the word Welcome represent with respect to the command?

    $ echo Welcome 
      - Where Welcome is an argument
    
  4. To check git command type

    $ type git
    
  5. To create a directory

    $ mkdir /home/bob/birds
    
  6. To create directories recursively

    $  mkdir -p /home/bob/fish/salmon
    
  7. Create few more directories

    $ mkdir -p /home/bob/mammals/elephant
    $ mkdir -p /home/bob/mammals/monkey
    $ mkdir /home/bob/birds/eagle
    $ mkdir -p /home/bob/reptile/snake
    $ mkdir -p /home/bob/reptile/frog
    $ mkdir -p /home/bob/amphibian/salamander
    
  8. To move a directory

    $ mv /home/bob/reptile/frog /home/bob/amphibian
    
  9. To rename a directory

    $ mv /home/bob/reptile/snake /home/bob/reptile/crocodile
    
  10. To delete a directory

    $ rm -r /home/bob/reptile