0% found this document useful (0 votes)
370 views27 pages

UNIX Commands for CSE Students

This document contains sample questions and answers related to UNIX commands. It provides examples of commands for creating, modifying, combining, sorting, searching, and manipulating text files using UNIX commands like cat, cut, tr, paste, sort, grep, diff, comm, head, tail, etc. It also demonstrates piping commands together and executing multiple commands sequentially. The document is intended as a practice guide for a Computer Practice Lab course.

Uploaded by

sandeep_nayak_17
Copyright
© Attribution Non-Commercial (BY-NC)
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)
370 views27 pages

UNIX Commands for CSE Students

This document contains sample questions and answers related to UNIX commands. It provides examples of commands for creating, modifying, combining, sorting, searching, and manipulating text files using UNIX commands like cat, cut, tr, paste, sort, grep, diff, comm, head, tail, etc. It also demonstrates piping commands together and executing multiple commands sequentially. The document is intended as a practice guide for a Computer Practice Lab course.

Uploaded by

sandeep_nayak_17
Copyright
© Attribution Non-Commercial (BY-NC)
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

RAJALAKSHMI ENGINEERING COLLEGE

Rajalakshmi Nagar, Thandalam, Chennai 602 105

Department of Computer Science and Engineering

GE2155 Computer Practice Lab - II UNIX Commands Sample Q & A


Prepared by

[Link]
Senior Lecturer / CSE

GE2155 Computer Practice Lab-II UNIX Commands 1. a. Write and execute the following UNIX commands (i) Create a file. -bash-3.2$ cat > [Link] Computer Practice Lab-II. Department of CSE. Rajalakshmi Engineering College. Chennai. (ii) Display only the first two characters of all the lines from a file. -bash-3.2$ cut -c1-2 [Link] Co De Ra Ch (iii) Convert the lower case to uppercase. -bash-3.2$ tr 'a-z' 'A-Z' < [Link] COMPUTER PRACTICE LAB-II. DEPARTMENT OF CSE. RAJALAKSHMI ENGINEERING COLLEGE. CHENNAI. (iv) Combine two strings. -bash-3.2$ sh sh-3.2$ a="REC" sh-3.2$ b="RIT" sh-3.2$ c=$a$b sh-3.2$ echo $c RECRIT (v) Display the file contents in descending order. sh-3.2$ sort -r [Link] Rajalakshmi Engineering College. Department of CSE. Computer Practice Lab-II. Chennai.

BHUVANESWARAN B / SL / CSE / REC - 2

2. a. Write and execute the following UNIX commands (i) Create two files with the name of [Link], which contain only names, and [Link] with the content of register number respectively. -bash-3.2$ cat > [Link] ABARNA B ABHINANDAN SESHADRI R ABINASH R ABIRAMI K ABISHEK A -bash-3.2$ cat > [Link] 211611104001 211611104002 211611104003 211611104004 211611104005 -bash-3.2$ (ii) Combine the two files in the form of register number followed by name -bash-3.2$ paste [Link] [Link] 211611104001 ABARNA B 211611104002 ABHINANDAN SESHADRI R 211611104003 ABINASH R 211611104004 ABIRAMI K 211611104005 ABISHEK A (iii) Sort the two files in ascending order -bash-3.2$ sort [Link] ABARNA B ABHINANDAN SESHADRI R ABINASH R ABIRAMI K ABISHEK A -bash-3.2$ sort [Link] 211611104001 211611104002 211611104003 211611104004 211611104005

BHUVANESWARAN B / SL / CSE / REC - 3

(iv) Count the number of lines in the files -bash-3.2$ cat [Link] | wc -l 5 -bash-3.2$ cat [Link] | wc -l 5 (v) Rename the two files. -bash-3.2$ mv [Link] [Link] -bash-3.2$ mv [Link] [Link]

BHUVANESWARAN B / SL / CSE / REC - 4

3. a. Write and execute the following UNIX commands (i) Create two files. -bash-3.2$ cat > [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. M.B.A. M.C.A. M.S. Ph.D. -bash-3.2$ cat > [Link] Rajalakshmi Institute of Technology. B.E. [Link]. M.B.A. M.C.A. (ii) Combine the two files. sh-3.2$ cat [Link] [Link] > [Link] (iii) Search a specific word from any one of the file. sh-3.2$ grep Ph.D. [Link] Ph.D. (iv) Search a specific file from a directory. sh-3.2$ find [Link] [Link] (v) Display the common and distinct line of contents from a file. sh-3.2$ diff [Link] [Link] 1c1 < Rajalakshmi Engineering College. --> Rajalakshmi Institute of Technology. 4,5d3 < M.E. < [Link]. 8,9d5 < M.S. < Ph.D. BHUVANESWARAN B / SL / CSE / REC - 5

-bash-3.2$ cat [Link] | sort > [Link] -bash-3.2$ cat [Link] | sort > [Link] -bash-3.2$ comm -1 -2 [Link] [Link] B.E. [Link]. M.B.A. M.C.A. -bash-3.2$ cat [Link] Rajalakshmi Institute of Technology. B.E. [Link]. M.B.A. M.C.A.

BHUVANESWARAN B / SL / CSE / REC - 6

4. a. Write and execute the following UNIX commands (i) Create two files. -bash-3.2$ cat > [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. M.B.A. M.C.A. M.S. Ph.D. -bash-3.2$ cat > [Link] Rajalakshmi Institute of Technology. B.E. [Link]. M.B.A. M.C.A. (ii) Display the contents of both the files. -bash-3.2$ cat [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. M.B.A. M.C.A. M.S. Ph.D. -bash-3.2$ cat [Link] Rajalakshmi Institute of Technology. B.E. [Link]. M.B.A. M.C.A. (iii) Count the number of characters in both the files. -bash-3.2$ cat [Link] | wc -c 84 -bash-3.2$ cat [Link] | wc -c 64 BHUVANESWARAN B / SL / CSE / REC - 7

(iv) Rename the two files. -bash-3.2$ mv [Link] [Link] -bash-3.2$ mv [Link] [Link] (v) Combine the two files without duplicate. -bash-3.2$ sort [Link] [Link] | uniq > [Link] -bash-3.2$ cat [Link] B.E. [Link]. M.B.A. M.C.A. M.E. M.S. [Link]. Ph.D. Rajalakshmi Engineering College. Rajalakshmi Institute of Technology.

BHUVANESWARAN B / SL / CSE / REC - 8

5. a. Write and execute the following UNIX commands (i) To view all the files and directories page by page -bash-3.2$ ls -l | more (ii) To view only the directories page by page. -bash-3.2$ ls -d */ | more (iii) To view only the files in a directory. -bash-3.2$ -rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r-ls -l | grep ^1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan

51 84 64 61 84 65 64 85

May May May May May May May May

9 9 9 9 9 9 9 9

16:09 16:12 16:17 15:32 16:20 15:32 16:20 15:20

[Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link]

(iv) Display the working directory. -bash-3.2$ pwd /home/bhuvan (v) Display the complete path of the working directory. -bash-3.2$ pwd -P /home/bhuvan

BHUVANESWARAN B / SL / CSE / REC - 9

6. a. Write and execute the following UNIX commands (i) Display the calendar. -bash-3.2$ cal 2012
2012 January Tu We Th 3 4 5 10 11 12 17 18 19 24 25 26 31 April Tu We Th 3 4 5 10 11 12 17 18 19 24 25 26 February Su Mo Tu We Th 1 2 5 6 7 8 9 12 13 14 15 16 19 20 21 22 23 26 27 28 29 May We Th 2 3 9 10 16 17 23 24 30 31 March Su Mo Tu We Th 1 4 5 6 7 8 11 12 13 14 15 18 19 20 21 22 25 26 27 28 29

Su 1 8 15 22 29

Mo 2 9 16 23 30

Fr 6 13 20 27

Sa 7 14 21 28

Fr 3 10 17 24

Sa 4 11 18 25

Fr 2 9 16 23 30

Sa 3 10 17 24 31

Su 1 8 15 22 29

Mo 2 9 16 23 30

Fr 6 13 20 27

Sa 7 14 21 28

Su Mo Tu 1 6 7 8 13 14 15 20 21 22 27 28 29

Fr 4 11 18 25

Sa 5 12 19 26

June Su Mo Tu We Th Fr 1 3 4 5 6 7 8 10 11 12 13 14 15 17 18 19 20 21 22 24 25 26 27 28 29

Sa 2 9 16 23 30

Su 1 8 15 22 29

Mo 2 9 16 23 30

July Tu We Th 3 4 5 10 11 12 17 18 19 24 25 26 31 October Tu We Th 2 3 4 9 10 11 16 17 18 23 24 25 30 31

Fr 6 13 20 27

Sa 7 14 21 28

August Su Mo Tu We Th 1 2 5 6 7 8 9 12 13 14 15 16 19 20 21 22 23 26 27 28 29 30 November Su Mo Tu We Th 1 4 5 6 7 8 11 12 13 14 15 18 19 20 21 22 25 26 27 28 29

Fr 3 10 17 24 31

Sa 4 11 18 25

Su Mo 1 7 8 14 15 21 22 28 29

Fr 5 12 19 26

Sa 6 13 20 27

Fr 2 9 16 23 30

Sa 3 10 17 24

September Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 December Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

(ii) Execute more than one command at a time (using semi-colon ;) -bash-3.2$ whoami ; date bhuvan Wed May 9 [Link] IST 2012 (iii) Display the users full details. -bash-3.2$ finger bhuvan Login: bhuvan Name: (null) Directory: /home/bhuvan Shell: /bin/bash On since Wed May 9 15:17 (IST) on pts/1 from [Link] No mail. No Plan.

BHUVANESWARAN B / SL / CSE / REC - 10

(iv) Display the user-id / Group-id. -bash-3.2$ id uid=508(bhuvan) gid=508(bhuvan) groups=508(bhuvan) (v) Execute more than one command at a time (using logical-AND &&). -bash-3.2$ whoami && date bhuvan Wed May 9 [Link] IST 2012

BHUVANESWARAN B / SL / CSE / REC - 11

7. a. Write and execute the following UNIX commands (i) Demonstrate pipe command -bash-3.2$ who | wc -l 26 (ii) Demonstrate tee command -bash-3.2$ who | tee result | wc -l 26 -bash-3.2$ cat result (iii) Use more than one command at a time (who and date) -bash-3.2$ who ; date bhuvan pts/1 2012-05-09 15:17 ([Link]) exam04099 pts/2 2012-05-09 16:26 ([Link]) exam04116 pts/3 2012-05-09 16:30 ([Link]) bhuvan pts/4 2012-05-09 16:34 ([Link]) exam02007 pts/23 2012-05-09 14:12 ([Link]) root :0 2012-05-09 13:33 exam04048 pts/21 2012-05-09 14:58 ([Link]) exam02028 pts/45 2012-05-09 14:34 ([Link]) exam04046 pts/46 2012-05-09 14:54 ([Link]) exam02003 pts/51 2012-05-09 15:02 ([Link]) exam04040 pts/48 2012-05-09 14:59 ([Link]) exam02031 pts/58 2012-05-09 15:03 ([Link]) exam04040 pts/56 2012-05-09 15:03 ([Link]) exam02009 pts/59 2012-05-09 15:04 ([Link]) exam02015 pts/61 2012-05-09 15:04 ([Link]) exam04060 pts/62 2012-05-09 15:05 ([Link]) exam04111 pts/5 2012-05-09 16:34 ([Link]) root pts/6 2012-05-09 17:05 (:0.0) Wed May 9 [Link] IST 2012 (iv) Create a file called [Link] -bash-3.2$ cat > [Link] Computer Practice Lab-II. (v) Move the file [Link] to [Link] -bash-3.2$ mv [Link] [Link]

BHUVANESWARAN B / SL / CSE / REC - 12

8. a. Write and execute the following UNIX commands (i) Create a file -bash-3.2$ cat > [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. M.B.A. M.C.A. M.S. Ph.D. (ii) Print the specified number of lines of a file from start to end of the file. -bash-3.2$ head -5 [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. (iii) Display the file content with line number -bash-3.2$ nl [Link] 1 Rajalakshmi Engineering College. 2 B.E. 3 [Link]. 4 M.E. 5 [Link]. 6 M.B.A. 7 M.C.A. 8 M.S. 9 Ph.D. (iv) Update the file content with I/O redirection -bash-3.2$ cat >> [Link] [Link]. (v) Rename the file -bash-3.2$ mv [Link] [Link]

BHUVANESWARAN B / SL / CSE / REC - 13

9. a. Write and execute the following UNIX commands (i) Create a directory -bash-3.2$ mkdir Exam (ii) Create a file -bash-3.2$ cat > [Link] Computer Practice Lab-II. (iii) Rename the directory -bash-3.2$ mv Exam Test (iv) Rename the file -bash-3.2$ mv [Link] [Link] (v) View the file -bash-3.2$ cat [Link] Computer Practice Lab-II.

BHUVANESWARAN B / SL / CSE / REC - 14

10. a. Write and execute the following UNIX commands (i) Create a file -bash-3.2$ cat > [Link] Computer Practice Lab-II. (ii) Update the file -bash-3.2$ cat >> [Link] Common to All B.E. and [Link]. (iii) Display the file content -bash-3.2$ cat [Link] Computer Practice Lab-II. Common to All B.E. and [Link]. (iv) Display the file with line number -bash-3.2$ nl [Link] 1 Computer Practice Lab-II. 2 Common to All B.E. and [Link]. (v) Count the number of words in the file -bash-3.2$ cat [Link] | wc -w 8

BHUVANESWARAN B / SL / CSE / REC - 15

11. a. Write and execute the following UNIX commands (i) Create a Directory called main -bash-3.2$ mkdir main (ii) Create a sub-directory called sub in the main directory -bash-3.2$ cd main -bash-3.2$ mkdir sub (iii) Create a file in the main directory -bash-3.2$ cat > [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. M.B.A. M.C.A. M.S. Ph.D. (iv) Copy the file to the sub directory -bash-3.2$ cp [Link] sub (v) Delete the file in the main directory -bash-3.2$ rm [Link]

BHUVANESWARAN B / SL / CSE / REC - 16

12. a. Write and execute the following UNIX commands (i) Display the calendar -bash-3.2$ cal 2012
2012 January Tu We Th 3 4 5 10 11 12 17 18 19 24 25 26 31 April Tu We Th 3 4 5 10 11 12 17 18 19 24 25 26 February Su Mo Tu We Th 1 2 5 6 7 8 9 12 13 14 15 16 19 20 21 22 23 26 27 28 29 May We Th 2 3 9 10 16 17 23 24 30 31 March Su Mo Tu We Th 1 4 5 6 7 8 11 12 13 14 15 18 19 20 21 22 25 26 27 28 29

Su 1 8 15 22 29

Mo 2 9 16 23 30

Fr 6 13 20 27

Sa 7 14 21 28

Fr 3 10 17 24

Sa 4 11 18 25

Fr 2 9 16 23 30

Sa 3 10 17 24 31

Su 1 8 15 22 29

Mo 2 9 16 23 30

Fr 6 13 20 27

Sa 7 14 21 28

Su Mo Tu 1 6 7 8 13 14 15 20 21 22 27 28 29

Fr 4 11 18 25

Sa 5 12 19 26

June Su Mo Tu We Th Fr 1 3 4 5 6 7 8 10 11 12 13 14 15 17 18 19 20 21 22 24 25 26 27 28 29

Sa 2 9 16 23 30

Su 1 8 15 22 29

Mo 2 9 16 23 30

July Tu We Th 3 4 5 10 11 12 17 18 19 24 25 26 31 October Tu We Th 2 3 4 9 10 11 16 17 18 23 24 25 30 31

Fr 6 13 20 27

Sa 7 14 21 28

August Su Mo Tu We Th 1 2 5 6 7 8 9 12 13 14 15 16 19 20 21 22 23 26 27 28 29 30 November Su Mo Tu We Th 1 4 5 6 7 8 11 12 13 14 15 18 19 20 21 22 25 26 27 28 29

Fr 3 10 17 24 31

Sa 4 11 18 25

Su Mo 1 7 8 14 15 21 22 28 29

Fr 5 12 19 26

Sa 6 13 20 27

Fr 2 9 16 23 30

Sa 3 10 17 24

September Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 December Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

(ii) Display the date and time -bash-3.2$ date Wed May 9 [Link] IST 2012 (iii) Display the present working directory -bash-3.2$ pwd /home/bhuvan (iv) Display your user name -bash-3.2$ whoami Bhuvan

BHUVANESWARAN B / SL / CSE / REC - 17

(v) Create a file using cat command -bash-3.2$ cat > [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. M.B.A. M.C.A. M.S. Ph.D.

BHUVANESWARAN B / SL / CSE / REC - 18

13. a. Write and execute the following UNIX commands (i) Use finger command -bash-3.2$ finger bhuvan Login: bhuvan Name: (null) Directory: /home/bhuvan Shell: /bin/bash On since Wed May 9 15:17 (IST) on pts/1 from [Link] 15 minutes 59 seconds idle On since Wed May 9 16:34 (IST) on pts/4 from [Link] No mail. No Plan. (ii) Use grep command -bash-3.2$ cat > [Link] Rajalakshmi Engineering College. B.E. [Link]. M.E. [Link]. M.B.A. M.C.A. M.S. Ph.D. -bash-3.2$ grep M. [Link] M.E. [Link]. M.B.A. M.C.A. M.S. (iii) Use diff command -bash-3.2$ diff [Link] [Link] 1c1 < Rajalakshmi Engineering College. --> Rajalakshmi Institute of Technology. 4,5d3 < M.E. < [Link]. 8,9d5 < M.S. < Ph.D.

BHUVANESWARAN B / SL / CSE / REC - 19

(iv) Use uniq command -bash-3.2$ cat > [Link] ARUN A ARUN A ARUN S BABU S BABU R BABU R CHITHRA S -bash-3.2$ uniq [Link] ARUN A ARUN S BABU S BABU R CHITHRA S (v) Use cmp command -bash-3.2$ cmp [Link] [Link] [Link] [Link] differ: byte 13, line 1

BHUVANESWARAN B / SL / CSE / REC - 20

14. a. Write and execute the following UNIX commands (i) Create a directory -bash-3.2$ mkdir Exam (ii) View all directories from a user -bash-3.2$ ls -d */ CS1101/ CS1102/ Test/ (iii) Rename a directory -bash-3.2$ mv Exam Test (iv) View all the directories starting with a specific character. -bash-3.2$ ls -d C*/ CS1101/ CS1102/ (v) View only the hidden directories -bash-3.2$ ls -d .*/ ./ ../

BHUVANESWARAN B / SL / CSE / REC - 21

15. a. Write and execute the following UNIX commands (i) Create a file -bash-3.2$ cat > [Link] Anna University Chennai Practicals-May/June-2012 (ii) View only files from a directory -bash-3.2$ -rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r-ls -l | grep ^1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan 1 bhuvan bhuvan

51 84 64 61 84 65 64 85

May May May May May May May May

9 9 9 9 9 9 9 9

16:09 16:12 16:17 15:32 16:20 15:32 16:20 15:20

[Link] [Link] [Link] [Link] [Link] [Link] [Link] [Link]

(iii) Rename a file -bash-3.2$ mv [Link] [Link] (iv) View all files starting with a specific character -bash-3.2$ ls r* [Link] [Link]

[Link]

(v) View all the files which has a specific extension -bash-3.2$ ls *.txt [Link] [Link] [Link] [Link]

[Link] [Link]

[Link] [Link]

BHUVANESWARAN B / SL / CSE / REC - 22

16. a. Write and execute the following UNIX commands (i) Create a directory with the name of Exam -bash-3.2$ mkdir Exam (ii) Change the Exam directory as the working directory -bash-3.2$ cd Exam (iii) Create a file called [Link] in the Exam directory -bash-3.2$ cat > [Link] Anna University Chennai Practicals-May/June-2012 (iv) View the content of the [Link] file -bash-3.2$ cat [Link] Anna University Chennai Practicals-May/June-2012 (v) Rename the file [Link] to [Link] -bash-3.2$ mv [Link] [Link]

BHUVANESWARAN B / SL / CSE / REC - 23

17. a. Write and execute the following UNIX commands (i) To check the working directory -bash-3.2$ pwd /home/bhuvan (ii) Change the password -bash-3.2$ passwd Changing password for user bhuvan. Changing password for bhuvan (current) UNIX password: New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. (iii) To display todays date -bash-3.2$ date +%D 05/09/12 (iv) To display the calendar of this month -bash-3.2$ cal May 2012 Su Mo Tu We Th 1 2 3 6 7 8 9 10 13 14 15 16 17 20 21 22 23 24 27 28 29 30 31 5 2012 Fr 4 11 18 25 Sa 5 12 19 26

(v) To display a message University Exam using a special character -bash-3.2$ banner "University Exam"

BHUVANESWARAN B / SL / CSE / REC - 24

18. a. Write and execute the following UNIX commands (i) Create two directories called CS1101 and CS1102 -bash-3.2$ mkdir CS1101 -bash-3.2$ mkdir CS1102 (ii) Create a file called [Link] in the CS1101 directory -bash-3.2$ cd CS1101 -bash-3.2$ cat > [Link] Computer Practice Lab-II. (iii) Copy the file [Link] from CS1101 to CS1102 -bash-3.2$ cp [Link] ../CS1102 (iv) Update the file content of [Link] in the CS1102 directory -bash-3.2$ cd .. -bash-3.2$ cd CS1102 -bash-3.2$ cat >> [Link] Common to All B.E. and [Link]. -bash-3.2$ cat [Link] Computer Practice Lab-II. Common to All B.E. and [Link]. (v) Rename the file in the CS1102 with [Link] -bash-3.2$ mv [Link] [Link]

BHUVANESWARAN B / SL / CSE / REC - 25

19. a. Write and execute the following UNIX commands (i) Create a file -bash-3.2$ cat > [Link] Computer Practice Lab-II. Department of CSE. Rajalakshmi Engineering College. Chennai. (ii) Rename a file -bash-3.2$ mv [Link] [Link] (iii) Change the mode of the file to read only -bash-3.2$ chmod ugo+r-w [Link] (iv) View the content of a file -bash-3.2$ cat [Link] Computer Practice Lab-II. Department of CSE. Rajalakshmi Engineering College. Chennai. (v) Count the number of words in a file -bash-3.2$ cat [Link] | wc -l 4

BHUVANESWARAN B / SL / CSE / REC - 26

20. a. Write and execute the following UNIX commands (i) Count the specific number of lines from a file start from the beginning of the file -bash-3.2$ head -5 [Link] | wc -l 5 (ii) To destroy a specific file from a user directory -bash-3.2$ rm [Link] (iii) Send a greeting message to other user -bash-3.2$ write exam10001 Happy Birthday to you... [exam10001@sys ~]$ Message from bhuvan@[Link] on pts/2 at 09:00 ... Happy Birthday to you... EOF (iv) Execute a shell program -bash-3.2$ sh [Link] (v) To display current time -bash-3.2$ date +%T [Link]

BHUVANESWARAN B / SL / CSE / REC - 27

You might also like