You are on page 1of 3

LAB Assignment No.

-1
Operating Systems
(UCS 303)
Faculty: - Dr. Shalini Batra, Mr.Vinay Arora
CSED, TU
1. tty

-to find the terminal id

2. who - numbe4r of users who is login


3. who am I -current user who login
4. pwd

- print the current working directories

5. clear

- clear screen

6. ls

- list all files

7. ls[option]:
-a list hidden file
-d list the name of current directory
-f
show directories with a trailing /
-g show group ownership of file in long listing
-I print the inode number of each file
-l long listing giving detail about file and directories
-r list all subdirectories encountered
-t sort by time modified instead of name
ls *s
ls s*
ls ?
ls ???s???
8

cd

- change directories

cd..

to go one folder down

10 cal:
11 cal with option

%d, %D, %m, %y, %Y

11 df - view file system disk space usage


12 df h
13 cat - describe the content of existing file or to create new file
14 mkdir

-make directory

15 mkdir[option]

16 mv -change the name of a directory


17 rmdir - remove an existing directory
18 rm r Remove directories and files with in the directories recursively
19 cp

- Copy files

20 cp[Option] copy with optiopns


21 whereis -Report all known instances of a commands
22 more
23 less

- allows files contents or piped output to be sent to the screen one page at a time
-Opposite of the more commands

Assignment -1 (Section 2nd)


Q1.
Q2.
Q3.
Q4.
Q5.
Q6.
Q8.
Q9.
Q10.
Q11.
Q12.
Q13.
Q14.
Q15.
Q16.
Q17.
Q18.
Q19.
Q20.
Q21.
Q22.
Q23.
Q24.
Q25.
Q26.

Do an "ls" to see the files you have in your directory.


Type in "pwd" . What do you see?
Type in "uname -a" . What do you see?
Type in "clear" . What happens?
Type in "man pwd" . What do you see? Use the spacebar to scroll through, and press "q" to quit.
Now type in "mkdir" and then type "mkdir labpractice"
Type "ls". Now what do you see?
Type "cd labpractice".
Type "pwd". Where are you now?
Type ls with an -al switch. What do you see? Can you tell how big the file is?
Type "cp lab3file lab3file2" . Again, type "ls". What do you see now?
Type "rm lab3file2". Again, type "ls". What is there?
Repeat the "rm" command on the other file. Do an "ls -al" to see what's in the directory. Hint: It
should be empty.
Type in "cd .." This should bring you back up one directory and put you in your home directory.
Type "ls" and then type "rm labpractice" . What happens?
Type "rm -r labpractice" and then do an "ls". What happens this time?
Type "mkdir public_html".
Type "mkdir Desktop".
Type "cd Desktop", and then type "touch file1 file2 file3 file4 file5".
Write a Linux Command to display list of files whose name is two characters long.
Write a Linux Command to display list of files whose name starts with a vowel.
Write a Linux Command to display list of files that starts with consonants.
Write a Linux Command to display list of files that contains a sub string "an".
Write a Linux Command to display list of files that contains 4th letter as a No.
Write a Linux Command to display list of files whose suffix is Not a Digit

Q27.

Type in "cat myfirstscript". What happens?

Q28.Now, type in "more myfirstscript" What do you see this time?


Q29.Now, type in "less myfirstscript" What do you see this time?

Q30.Type in "mv myfirstscript mynewnamescript" . Do an "ls -al" , what do you see?


Q31.Let's rename the script back to it's original name. "mv mynewnamescript myfirstscript"
Q32.Does it still run? (It should, but make sure.)

You might also like