Day 2
Day 2
’wh
o’
Com
mand
It is used to display who are the users connected to our computer currently.
Options : -
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:
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.
Syntax : $pwd
2. MKDIR Command :
Syntax :
$mkdir
<director
y name>
3.CD
Comman
d:
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>
1.CREATE A FILE :
command. 2.DISPLAY
A FILE :
To display the content of file mentioned we use CAT command without „>‟
operator.
Options –s = to neglect
message. 3.COPYING
CONTENTS :
Syntax :
$cat –n <filename>
4. SORTING A FILE :
To sort the contents in alphabetical order in reverse order.
Syntax :
$sort <filename >
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
Syntax: $head<filename>
TAIL : This command is used to display the last ten lines of file.
Syntax: $tail<filename>
Syntax: $more<filename>