BT0051

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

BT0051

ASSIGNMENT SET – 01

UNIX OPERATING SYSTEMS

1. Using the following Directory tree structure, if IT is your Home directory,:

Root

IT
MBA

BSc-IT Finance
MCA
Marketing

UNIX

 Which command do use to navigate to: Bsc-IT directory?


 Which command is used to display your current directory?
 Which command is used to directly navigate to root directory from BSc-
IT directory?
 Which command is used to create a new directory in BSc-IT called
UNIX?
 Which is the command to remove directories?
 Which is the command used to move UNIX directory to Marketing
directory?

Ans ->

1 cd /IT/BSc-IT

2 pwd

3 cd

4 mkdir /IT/BSc-IT/UNIX

5 rmdir
6 mv UNIX NUNIX

2. Use cat command to:


Display text “Welcome Home” on your screen

Redirect the text “Welcome Home” to file called file-1

Append text “Friends” to the contents of file-1

Ans-> $ cat >file-1

Welcome Home

Crlt +d

$ Cat >>file-1

Friends

Crlt +d

3. Which command is used to search following patterns in file by name file-1:


“TENDULKAR,” “tendulkar,” “TeNdUlKar”?

Ans -> $ cat file-1|grep TENDULKAR

$ cat file-1|grep tendulkar

$ cat file-1|grep TeNdUlKar


BT0051

ASSIGNMENT SET – 02

UNIX OPERATING SYSTEMS

1. Define Process. Which is the command used to find out currently executing
Process in UNIX?

Ans-> A process is simply an instance of a running program. A process is said to


be born when the program starts execution and remains alive as long as the
program is active.

$ Ps –e

2. What is the output of :


$ ps-e

$ ps-a commands

Ans->

1 All processes including user and system processes

2 Processes of all user excluding process not associated with terminal

3. Which command is used to transfer a Foreground process to Background?


Give one example.

Ans-> nohup sort emp.lst &

Bg

$ bg find / name a.out –print

4. Say you have three Process P1, P2 and P3 running in background. You want to
assign priorities to them, which command is suitable give its syntax?

Ans-> $ nice

5. Which command is used to:


Fetch names from a file Name.txt sort them and remove any duplicate
entries.
Ans-> $ sort –u Name.txt

6. Which commands are used to carry out following operations in vi- Editor:
 To save a file
 To start editing a file
 To save and Quit a file
 To quit without saving (Forced quit)

Ans->

1 :w filename

2 :i

3: wq

4: q!

You might also like