Sie sind auf Seite 1von 2

Goutam Kumar Kala-MCA-06

ASSIGNMENT 3
1) Open every file you have created and try to add some more content matching with the file title. [bubun@localhost ~]$ cd bubun [bubun@localhost bubun]$ cd Comp_sys [bubun@localhost Comp_sys]$ vi Key_brd [bubun@localhost Comp_sys]$ vi Monitor [bubun@localhost Comp_sys]$ vi Mouse [bubun@localhost Comp_sys]$ vi MS-OFFICE [bubun@localhost Comp_sys]$ vi OS [bubun@localhost Comp_sys]$ vi Printer [bubun@localhost Comp_sys]$ vi P_Storage [bubun@localhost Comp_sys]$ vi S_Storage [bubun@localhost Comp_sys]$ vi V_mem 2) Now open the file Monitor & toggle the case of all character in the file & save the change. [bubun@localhost Comp_sys]$ cat Monitor Monitor [bubun@localhost Comp_sys]$ vi Monitor [bubun@localhost Comp_sys]$ cat Monitor mONITOR 3) Redirect the help of the command tee in a file called teehelp. [bubun@localhost Comp_sys]$ man tee>tee help 4) Move the first four lines of the file in a file called some teehelp without exiting from the vi editor. [bubun@localhost Comp_sys]$ head -4 teehelp>somehelp 5) Try to display the content of your home directory without exiting from the vi editor. [bubun@localhost Comp_sys]$ vi teehelp

6) Add the extensions .txt to at least three files (they should reside in three different location) you have already created in our directory structures. [bubun@localhost Comp_sys]$ mv somehelp somehelp.txt 7) Make comp_sys as your current working directory. [bubun@localhost Comp_sys]$ cd Comp_sys

UNIX LAB ASSIGNMENT

Page 15

Goutam Kumar Kala-MCA-06

8) a)Search the .txt files & print their names starting from your home directory. [bubun@localhost bubun]$ find -name "*.txt"./Comp_sys/somehelp.txt b) Print the content of those files found in the previous question using a single command. [bubun@localhost bubun]$ find $HOME -name "*.txt" -ok cat {} \; < cat ... /home/bubun/bubun/Comp_sys/Key_brd.txt > ? < cat ... /home/bubun/bubun/Comp_sys/Mouse.txt > ? < cat ... /home/bubun/bubun/Comp_sys/somehelp.txt > ? 9) Create links of those files in a directory comp_sys & display the mode number for the links as well as original files. [bubun@localhost Comp_sys]$ ln MS-OFFICE MS-OFFICE ln: creating hard link `MS-OFFICE': File exists [bubun@localhost Comp_sys]$ ls -li MS-OFFICE MS-OFFICE 140127 -rw-rw-r--. 1 bubun bubun 17 Aug 29 18:03 MS-OFFICE 140127 -rw-rw-r--. 1 bubun bubun 17 Aug 29 18:03 MS-OFFICE 10) Now create symbolic links for those files in your home directory & check their inode no. with respect to original files. [bubun@localhost Comp_sys]$ ln -s Mouse Mouse [bubun@localhost Comp_sys]$ ls -li Mouse Mouse 140144 lrwxrwxrwx. 1 bubun bubun 5 Aug 29 19:09 Mouse -> Mouse 140144 lrwxrwxrwx. 1 bubun bubun 5 Aug 29 19:09 Mouse -> Mouse 11) For any file in your directory structure remove all permissions or all users using a single command. Try to display the content of the file. What is happening ? Explain reason for that. [bubun@localhost Comp_sys]$ chmod 000 Printer [bubun@localhost Comp_sys]$ cat Printer cat: Printer: Permission denied 12) Remove the read & write permissions from the directory comp_sys for all users using a single command. Now create a new file within the directory comp_sys. What is happening ? Explain reason for that. [bubun@localhost bubun]$ chmod 111 Comp_sys

UNIX LAB ASSIGNMENT

Page 16

Das könnte Ihnen auch gefallen