You are on page 1of 11

SOHINI PAUL

19070122169

CS C2

OPERATING SYSTEM LAB ASSIGNMENT 2


1.

Command: date

Syntax: date

Functionality: gives the date

2.

Command: ls

Syntax: ls

Functionality: gives us all the directories and files present

3.

Command: cd

Syntax: cd (name of directory or file)

Functionality: used to change current working directory

4.

Command: calculator

Syntax: bc

Functionality: works as a normal calculator

5.

Command: time

Syntax: time

Functionality: gives the current time as an output

6.

Command/ syntax: cat>abc


Functionality: creates a file named abc

7.

Command/syntax: clear

Functionality: clear the terminal screen

8.

Command/syntax: wc

Functionality: prints newline,word and byte for each file

9.

Command: rm

Syntax: rm abc

Functionality: removes the file abc

10.

Command: mkdir

Syntax: mkdir xyz

Functionality: makes a directory xyz

11.

Command: rmdir

Syntax: rmdir xyz

Functionality: removes the directory xyz

12.

Command/syntax: cat>>abc

Functionality: appends the content in the file abc

13.

Command/syntax: echo

Functionality: prints the given statement

14.

Command: sort
Syntax: sort abc

Functionality: sorts the file abc accordingly

15.

Command: rev

Syntax: rev abc

Functionality: reverses the content in the file abc

16.

Command: nl

Syntax: nl abc

Functionality: shows the file abc according to the number of lines in it

17.

Command: head

Syntax:

example :head -2 abc

Functionality: displays the first few lines of the file abc

18.

Command: tail

Syntax:

Example: tail -2 abc

Functionality: prints the last few lines of file abc

19.

Command: file

Syntax: file abc

Functionality: gives us the type of file abc

20.

Command: cut

Syntax: cut -2 abc


Functionality: cut the first few columns of file abc

21.

Command: paste

Syntax: paste xaa xab

Functionality: paste the content of 2 files xaa and xab

22.

Command: cp

Syntax: cp xab

Functionality: copies the content of file xaa into xab

23.

Command: mv

Syntax: mv xaa xab

Functionality: moves the content of file xaa into xab

24.

Command: tr

Syntax: tr “[a-z]” “[A-Z]”<abc

Functionality: translates the content of file abc from lowercase to uppercase

25.

Command: pwd

Syntax: pwd

Functionality: It prints the working directory i.e. the position where we are
right now in the system.

26.

Command: chmod

Syntax:

Functionality: Change the file mode bits of each given file according to mode.

27.
Command: touch

Syntax: touch <filename>

Functionality: used to update the access date and/or modification date of a


computer file or directory.

28.

Command: join

Syntax: join

Functionality: joining lines of two files on a common field.

29.

Command: history

Syntax: history

Functionality: Shows us the commands we were running till we entered “history”


command in the terminal.

30.

Command: split

Syntax:(

example:split -2 abc splits file abc in 2 parts)

Functionality: splits a file into separate parts

31.

Command: bc

Syntax: :bc (Then type any calulation to solved like: ) 1+2 (hit “enter”) 3

Functionality: works like a calculator

32.

Command: who

Syntax: who

Functionality: displays the registered name of the user (EX: onworks (if we are
using the online version of Ubuntu))

33.
Command: whoami

Syntax: whoami

Functionality: displays the name of the user

34.

Command: calendar

Syntax: cal

Functionality: shows us the calendar

35.

Command: time

Syntax: time

Functionality: shows us the time

36.

Command: man

Syntax: man <tofindof>

Functionality: It shows all the documentation of the linux command that we


want information of. It shows how it should be used and what all parameters
should be followed along with the syntax and semantics.

SCREENSHOTS:

You might also like