0% found this document useful (0 votes)
32 views9 pages

DF Date Du Cal Who Whoami WC Head Tail BC: LAB: 2 Explore The Commands The Given Below Basic Commands

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views9 pages

DF Date Du Cal Who Whoami WC Head Tail BC: LAB: 2 Explore The Commands The Given Below Basic Commands

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

LAB : 2 Explore the commands the given below

Basic commands
df
date
du
cal
who
whoami
wc
head
tail
bc
LAB : 2 Hint : To know the type of the file
command : type filename
2. Create the short the command clear

3. list out the available short cuts

4. Delete the shortcut for the command clear

5. Create a directory unit1, demo1, demo2, unit2

6. Delete demo2 directory

7. create text files in demo1 directory

8. Delete demo1 directory

9. Create a file called “mycity.txt” , under unit1 folder

10. write 2 lines about your city in the file “mycity.txt”


11. append 2 lines about your city to the file “mycity.txt” using
cat

12. Create a backup of your mycity.txt file by copying it to a file


called mycity.bak

13. copy the file “mycity.txt ” to the folder unit2

14. Rename the file “mycity1.txt ” to “aboutcity.txt”

15. create an empty files called “file1”, “file1” , “file3” using


touch statement in demo1 folder.
Hint :
touch filename

Note:
Try to implement both absolute path and relative path
Link

Create Softlink

ln -s /absolute-path/original-file /soft-link-file

Create Hardlink

ln /absolute-path/original-file /hard-link-file
LAB : 2

Write a shell script (using vi editor) to create a directory test in


your area and copy the contents of /etc/passwd in test directory.

Explore:
Configure your bash environment by changing history size, change
prompt (HINT : PS1) , add alias to command clear and exit.
Meta characters
{}
[]
?
*
Combine these meta characters with cp,mv,ls, rm commands

Chmod

Change the permission for the file using both


Numeric and mnemonic command

You might also like