0% found this document useful (0 votes)
3 views9 pages

Day 2

Uploaded by

lite66688
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views9 pages

Day 2

Uploaded by

lite66688
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

5.

’wh

o’

Com

mand

It is used to display who are the users connected to our computer currently.

Syntax : $who – option‟s

Options : -

H–Display the output with headers.


b–Display the last booting date or time or when the

system was lastely rebooted. 6.’who am i’ Command :

Display the details of the current working directory.

h
o

d
:

It

is

cl

n.

S
y

cl

0.

a
n

It help us to know about the particular command and its options & working. It is
like
„help‟ command in windows .

Syntax :

$man

<comma

nd

name>

11.LIST

Comman

d:

It is used to list all the contents in the current working directory.

Syntax : $ ls – options <arguments>


If the command does not contain any argument means it is working in the Current
directory.

Options :
a– used to list all the files
including the hidden
files. c– list all the files
columnwise.
d- list all the directories.
m- list the files separated by commas.
p- list files
include „/‟ to all
the directories.
r- list the files in
reverse
alphabetical
order.
f- list the files based
on the list
modification date. x-
list in column wise
sorted order.

DIRECTORY RELATED COMMANDS :

1. Present Working Directory Command :

To print the complete path of the current working directory.

Syntax : $pwd

2. MKDIR Command :

To create or make a new directory in a current directory .

Syntax :

$mkdir

<director

y name>

3.CD

Comman

d:

To change or move the directory to the mentioned directory .

Synt

ax :

$cd

<direc

tory

name.

4.RM
DIR

Com

mand

To remove a directory in the current directory & not the current directory itself.
Syntax : $rmdir <directory name>

FILE RELATED COMMANDS :

1.CREATE A FILE :

To create a new file in the current directory we use CAT command.

Syntax : $cat > <filename.


The > symbol is

redirectory we use cat

command. 2.DISPLAY

A FILE :

To display the content of file mentioned we use CAT command without „>‟
operator.

Syntax : $cat <filename.

Options –s = to neglect

the warning /error

message. 3.COPYING

CONTENTS :

To copy the content of one file with another. If file doesnot


exist, a new file is created and if the file exists with some
data then it is overwritten.

Syntax : $ cat <filename source> >> <destination filename>


$ cat <source filename> >> <destination filename> it is avoid overwriting.
Options :

-n content of file with numbers included with blank lines.

Syntax :
$cat –n <filename>
4. SORTING A FILE :
To sort the contents in alphabetical order in reverse order.

Syntax :
$sort <filename >

Option : $ sort –r <filename>

5. COPYING CONTENTS FROM ONE FILE TO ANOTHER :


To copy the contents from source to destination file . so that both contents are
same.

Syntax :
$cp <source filename> <destination filename>
$cp <source filename path > <destination filename path>

6. MOVE Command :
To completely move the contents from source file to
destination file and to remove the source file.
Syntax :
$ mv <source filename> <destination filename>

7. REMOVE Command :
To permanently remove the file we use this command .

Syntax :
$rm <filename>

8. WORD Command :
To list the content count of no of lines , words, characters .
Syntax :

$wc<filename>

Options :
-c – to display no of characters.
-l – to display only the lines.
-w – to display the no of words.
FILTERS AND PIPES

HEAD : It is used to display the top ten lines of file.

Syntax: $head<filename>

TAIL : This command is used to display the last ten lines of file.

Syntax: $tail<filename>

PAGE : This command shows the page by page a screen full of


information is displayed after which the page command displays a
prompt and passes for the user to strike the enter key to
continue scrolling.

Syntax: $ls –a\p

MORE : It also displays the file page by page .To continue


scrolling with more command , press the space bar key.

Syntax: $more<filename>

You might also like