Beruflich Dokumente
Kultur Dokumente
Another Sample2
Paste:
It prints files side by side( i.e) horizontal merging
SYNTAX:
paste<filename1>[filename2.]
EXAMPLES:
(1) Display the contents of the file data1 and data2
horizontally
@ paste data1 and data2
A Sample file
Head:
It is used to display the no. of lines from the beginning of the file.
SYNTAX:
Head-no<filename>
Less/more:
It is used to display a page wise listing of the contents of the
specified file. Space is used to move to next page. b is used
to move previous page. q is used to quit.
SYNTAX:
Less<filename>
Cp:
cp(copy) duplicated the contents of the source file into a target file.
SYNTAX:
cp[options]<source file><target file>
Options:
-i-----------------------------> Prompts before Overwriting.
-l-----------------------------> links a file instead of copying it.
-v-----------------------------> verbose-explains what is being
done.
-r-----------------------------> copies a directory recursively.
EXAMPLES:
(1) Make a copy of file f1 as f2
@ cp f1 f2
(2) Copy the directory d2 to home/msc/d1
@ cp d2/home/msc/d1
Rm:
Rm(remove) is used to remove the specified files or directories.
SYNTAX:
Rm[options]<filename>
Options:
-i-----------------------------> Prompts before removing.
-v-----------------------------> verbose-explains what is being done.
-r/-r-----------------------------> deletes a directory recursively(i.e)
deletes a directory along with it
Subdirectories and files.
EXAMPLES:
(1) Removes the file f1
@ rm f1
(2) Remove the directory d1
@ rmr d1
Mv:
mv(move) is used to move as specified file or directory from
one location to another location. It can also be used to
change the name of the file or directory.
SYNTAX:
Mv[options]<source file><destination file>
Options:
-i-----------------------------> Prompts before moving.
-v-----------------------------> verbose-explains what is being
done.
EXAMPLES:
(1) Rename the file f2 as f3
@ mv f2 f3
DIRECTORY COMMANDS:
Mkdir:
Rmdir(remove directory) is used to delete a empty directory.
SYNTAX:
Rmid<dirname>
EXAMPLES:
(1) Delete the directory shell
@ rmdir shell
Cd:
(change directory) changes current directory to the specified
directory. .
Represents current. ..represents parents directory.
~represents home directory of the user.
SYNTAX:
cd<directory name>
EXAMPLES:
(1) Change to the directory/home/msc/d3
@ cd/home/msc/d3
Pwd
Pwd(presents working directory)display absolute pathname
of current directory.
SYNTAX:
Pwd
EXAMPLES:
(1) Display current working directory
@ pwd
/home/msc/d1
Ls
Is (list) display the names of the files and subdirectories in a
directory.
SYNTAX:
Ls[option]< directory name>
Options:
-a--------------------> list all the files including hidden files.
-f--------------------> shows the files type along with the
filename.
-R--------------------> does a recursive listing.
-r--------------------> display files and subdirectories in the
reverse order.
EXAMPLES:
Display the contents of current directory
@ id arith.sh fact.sh fr.sh, tv s stud.dat vow.sh clock.sh
dtob.sh fruits.dat names.dat d1 ucase.sh wel.sh
(2) Display long listing of files and subdirectories in the
current directory.
USER INFORMATION COMMANDS:
Who
Who display the names of all the user who are currently
logged in.
SYNTAX:
who[option]
Options:
-m--------------------> same as who am i
-q--------------------> prints only the login name and no of
user logged in.
-u--------------------> prints no of hours & minutes the user
has been idle.
EXAMPLES:
(1) Display details of user logged in @ who root:0 nov 608:1
(2) Display idle time of each user currently logged in @
who-u root:0 nov:608:51 ? 3333
Uptime:
Uptime is used to find the durations for which the system has
been running
SYNTAX:
Uptime
EXAMPLES:
(1) Display usage information of the system @ uptime
09:26:21 up 3 6 min, 2 user, load average:0.01,0.02,0.00
Man
Man shows online manuals on unix command.
SYNTAX:
Man<command name>
EXAMPLES:
(1) Display manual page of command is @ manls
Whereis
SYNTAX:
Whereis<command name>
EXAMPLES:
(1)Display the directories where command is stored. @
whereis
is:/bin/is/urs/share/man.usr/share/man1/os.1p.gz
Whatis
What is given one line description about the command.
SYNTAX:
Whatis<command name>
EXAMPLES:
(1) Display one line description of the command cp @
whatiscp
(1)-copy files and directories
MISCELLANEOUS TOOLS:
Date
Date shows the current date and time
SYNTAX:
Date[+options]
Options:
%m-----------> display month of ht year in digits
%m-----------> display day of the month in digits
%m-----------> display last two digits of the year
%m-----------> display hours
%m-----------> display minutes
EXAMPLES:
(1) Display current time @ date+%t 11.20.40
(2) Display current year in 2 digits @ date+y 08
Cal
Cal shows a calendar By default, current month calendar is
displayed.
SYNTAX:
cal[month year]
EXAMPLES:
(1) Display calendar for current month @ call
SEPTEMBER 2013
SU
MO TU
WE
TH
FR
SA
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
MO TU
WE
TH
FR
SA
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28