Practice 2

  1. Create a directory called /root/velocity-lab
  2. Inside velocity-lab directory create two more directory practice1 and practice2
  3. Inside practice1 directory create a file and write the text below and save it with name fruits
orange
apple
pineapple
guava
pear
grape
watermelon
grapefruit
walnut
banana
mango
peanut
berry
cherry
blackberry
strawberry
badam
aanp
suntala
peach
coconut
nariwol
angur
belauti
amba
bhuinkathar
guacakomoli
avacado
  1. Copy a file called fruits  and name it fruits.txt (cp command)
  2. Move fruits.txt file inside practice2 directory (mv command)
  3. Read or display the contents of a file fruits (cat)
  4. Read the contents of a file fruits so that you can scroll up and down (less or cat | less)
  5. Copy file fruits.txt inside practice1 directory with name delete.txt (Hint: use cp, path to practice1 is /root/velocity-lab/practice1)
  6. Remove delete.txt file
  7. Create a file called a in practice1 and wtire

this is a first line

  1. create a file called b in practice2 and write

this is a second line

  1. go to practice1 folder and add the contents of file a and file b to a file called ab (>)
  2. go to a directory /var/log and create a file yourname.txt and cd /root/velocity-lab
  3. search for file yourname.txt using locate and find command
  4. show top 7 lines of fruits file that /root/velocity-lab/practice1 directory
  5. show bottom lines of fruits file that is inside /root/velocity-lab/practice1 directory
  6. put the content ab file and top 5 line of fruits file to a file called abfruits
  7. go to /root/velocity-lab, create a directory test1/test2/test3 inside velocity-lab directory
  8. copy ab fruits fruits.txt a b to test3 directory
  9. copy contents of test3 directory to test1 directory
  10. delete a directory test2
  11. list the command you have been typing and send it to the file history.txt
  12. change a directory to /root/velocity-lab make a tar archive with tar command for test1 directory with name test1.tar.gz in current working directory
  13. list the contents of test1.tar.gz
  14. extract test1.tar.gz in /tmp directory and verify if the test1 directory is creted in /tmp

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.