It copies a file or a group of files. Copying file overwrites without warning the destination file if it already exists.
SYNTAX: $cp <source> <target>
Example:
$cp file1 file
$cp file1 file2 dir1 (used for copying file to directory)
Showing posts with label Unix commands. Show all posts
Showing posts with label Unix commands. Show all posts
Friday, August 31, 2012
Remove Directory Command
Used to delete a directory.
SYNTAX: $rmdir <dir>
Example:
$rndir unix
SYNTAX: $rmdir <dir>
Example:
$rndir unix
Change Directory Command
It is used to change from one directory to other.
SYNTAX: $cd <dir>
Example:
$cd unix1
Note: cd.. or cd\ is used to come out from directory
SYNTAX: $cd <dir>
Example:
$cd unix1
Note: cd.. or cd\ is used to come out from directory
Making Directory Command
It is used to create directory
SYNTAX: $mkdir <dirname>
$mkdir <dir> <dir>/<subdir> <dir1>/<subdir1>
Example:
$mkdir Unix
$mkdir Unix Unix/u (Used to create sub directories)
$mkdir test
output: mkdir : can't make test directory
SYNTAX: $mkdir <dirname>
$mkdir <dir> <dir>/<subdir> <dir1>/<subdir1>
Example:
$mkdir Unix
$mkdir Unix Unix/u (Used to create sub directories)
$mkdir test
output: mkdir : can't make test directory
Uname Command
It is used to display operating system and the version user is using.
SYNTAX: $uname
Example:
$uname -r (Used to display version)
$uname -s (Used to display what is operating system & what we are using)
$uname -n (Used to display the host or server name)
SYNTAX: $uname
Example:
$uname -r (Used to display version)
$uname -s (Used to display what is operating system & what we are using)
$uname -n (Used to display the host or server name)
Echo Command
This command is used to display the message on the screen.
SYNTAX: $echo "message"
Example:
$echo "Welcome to Unix"
SYNTAX: $echo "message"
Example:
$echo "Welcome to Unix"
Who Command
This command will provide all current users of the system working on various terminals.
SYNTAX: $who
Example:
$who i am
$who -HU (used to display all details of user)
SYNTAX: $who
Example:
$who i am
$who -HU (used to display all details of user)
Thursday, August 30, 2012
Basic Calculator Command
It is used to perform arithmetic operations.
SYNTAX: $bc
Examples:
$bc
1+2
3
$1*2
2
$bc
12/2
6
$bc
0 base =2
14
1110
SYNTAX: $bc
Examples:
$bc
1+2
3
$1*2
2
$bc
12/2
6
$bc
0 base =2
14
1110
Date Command
It is used to display the current date.
SYNTAX: $date
Examples:
$date
$date +%m (this is used display no.of months)
$date +%h (this is used to display name of the month)
$date '%h%m'
$date +%y (used to display last 2 digits of year)
$date +%D (used to display mm/dd/yy)
SYNTAX: $date
Examples:
$date
$date +%m (this is used display no.of months)
$date +%h (this is used to display name of the month)
$date '%h%m'
$date +%y (used to display last 2 digits of year)
$date +%D (used to display mm/dd/yy)
Friday, August 17, 2012
Calender command
It's a handy tool that you can invoke any time to see the calender of any specific month or a complete year.
SYNTAX: $cal
Example:
$cal
$cal 03 2012
$cal 2012 | more (' |' pipe symbol is used to combine two commands. The o/p of one command may give to i/p of next command)
SYNTAX: $cal
Example:
$cal
$cal 03 2012
$cal 2012 | more (' |' pipe symbol is used to combine two commands. The o/p of one command may give to i/p of next command)
Subscribe to:
Posts (Atom)