Friday, March 24, 2006
Unix commands reference card
Unix commands reference card
Environment Control
Command Description
cd d Change to directory d
mkdir d Create new directory d
rmdir d Remove directory d
mv f1 [f2...] d Move file f to directory d
mv d1 d2 Rename directory d1 as d2
passwd Change password
alias name1 name2 Create command alias (csh/tcsh)
alias name1="name2" Create command alias (ksh/bash)
unalias name1[na2...] Remove command alias na
ssh nd Login securely to remote node
exit End terminal session
setenv name v Set env var to value v (csh/tcsh)
export name="v" set environment variable to value v (ksh/bash)
Output, Communication, & Help
Command Description
lpr -P printer f
or
lp -d printer f Output file f to line printer
script [f] Save terminal session to f
exit Stop saving terminal session
mailx username Send mail to user
man name Unix manual entry for name
Process Control
Command Description
CTRL/c * Interrupt processes
CTRL/s * Stop screen scrolling
CTRL/q * Resume screen output
sleep n Sleep for n seconds
jobs Print list of jobs
kill % Kill job n
ps Print process status stats
kill -9 n Remove process n
CTRL/z * Suspend current process
stop %n Suspend background job n
cmmd& Run cmmd in background
bg [%n] Resume background job n
fg [%n] Resume foreground job n
exit Exit from shell
Environment Status
Command Description
ls [d] [f...] List files in directory
ls -1 [f...] List files in detail
alias [name] Display command aliases
printenv [name] Print environment values
quota Display disk quota
date Print date & time
who List logged in users
whoami Display current user
finger [username] Output user information
chfn Change finger information
pwd Print working directory
history Display recent commands
! n Submit recent command n
File Manipulation
Command Description
vi [f] Vi fullscreen editor
emacs [f] Emacs fullscreen editor
ed [f] Text editor
wc f Line, word, & char count
cat f List contents of file
more f List file contents by screen
cat f1 f2 >f3 Concatenates f1 & f2 into f3
chmod mode f Change protection mode of f
cmp f1 f2 Compare two files
cp f1 f2 Copy file f1 into f2
sort f Alphabetically sort f
split [-n] f Split f into n-line pieces
mv f1 f2 Rename file f1 as f2
rm f Delete (remove) file f
grep 'ptn' f Outputs lines that match ptn
diff f1 f2 Lists file differences
head f Output beginning of f
tail f Output end of f
Compiler
Command Description
cc [-o f1] f2 C compiler
lint f Check C code for errors
f77 [-o f1] f2 Fortran77 compiler
pc [-o f1] f2 Pascal compiler
Working with NFS files
Files saved on the UITS central Unix computers Steel, the Parallel PC cluster, Solar/Lunar, and the Research SP are stored on the Network File Server (NFS). That means that your files are really on one disk, in directories named for the central Unix hosts on which you have accounts.
No matter which of these computers you are logged into, you can get to your files on any of the others. Here are the commands to use to get to any system directory from any other system:
cd /N/u/username/PPPC/
cd /N/u/username/Cobalt/
cd /N/u/username/Solar/
cd /N/u/username/Steel/
cd /n/u/username/SP/
Be sure you use the capitalization just as you see above, and substitute your own username for "username".
For example, if Jessica Rabbit is logged into her account on Steel, and wants to get a file on her SP account, she would enter:
cd /N/u/jrabbit/SP/
Now when she lists her files, she'll see her SP files, even though she's actually logged into Steel.
You can use the ordinary Unix commands to move files, copy files, or make symbolic links between files. For example, if Jessica Rabbit wanted to move "file1" from her Steel directory to her SP directory, she would enter:
mv -i /N/u/jrabbit/Steel/file1 /N/u/jrabbit/SP/
This shared file system means that you can access, for example, your SP files even when you are logged into Steel, and vice versa. However, if you are logged into the SP, you can only use the software installed on SP -- only users' directories are linked together, not system directories.
Abbreviations used in this document
CTRL/x hold down control key and press x
d directory
env environment
f filename
n number
nd computer node
prtr printer
ptn pattern
var variable
[y/n] yes or no
[] optional arg
... list
http://infohost.nmt.edu/tcc/help/unix/unix_cmd.html
http://www.computerhope.com/unix.htm
http://oracle.oreilly.com/news/unix_oracle_0101.html
http://www.ss64.com/ora/index.html
http://www.ss64.com/bash/index.html
http://www.oracle-base.com/dba/DBACategories.php
http://forums.oracle.com/forums/thread.jspa?threadID=305918&tstart=0
http://viu.eng.rpi.edu/lab/1/s1_4.html
The most frequently used commands in UNIX/LINUX
Submitted by prasannakrao on Tue, 04/13/2004 - 10:54. General Interest | Quick Tips & Newbies
The following are the most frequently used commands in UNIX/LINUX:
01. "cd" - used to change directory
E.g.: cd /home/oracle - this will go inside the "/home/oracle" directory
The "chdir" command also does the same
02. "mkdir" - used to create a directory
E.g.: mkdir /home/oracle - this will create the "/home/oracle" directory
The "chdir" command also does the same
03. "ls" - used to list the contents of any directory
E.g.: ls /home/oracle - this will list the contents of the "/home/oracle" directory
04. "cp" - used to copy files
E.g.: cp /home/oracle/1.txt /home - this will copy the file "/home/oracle/1.txt" into the directory "/home"
05. "mv" - used to move files
E.g.: mv /home/oracle/1.txt /home - this will move the file "/home/oracle/1.txt" into the directory "/home"
06. "rm" - used to remove/delete a file
E.g.: rm /home/oracle/1.txt - this will remove the file "/home/oracle/1.txt"
07. "clear" - used to clear the screen
08. "pwd" - used to display the current working directory (pwd=print working dir)
09. "chmod" - used to change the permission of a file
E.g.: chmod 755 /home/oracle/1.txt - this will give all the rights except the right to edit the file 1.txt
10. "man" - provides in depth information about the requested command (man=manual)
E.g.: man pwd - this will show the online manual on the command `pwd`
11. "vi" - invokes the vi editor (vi=visual)
E.g.: vi /home/oracle/1.txt - this will invoke the vi editor for editing the file 1.txt
12. "ps" - lists the processes that are currently running
13. "find" - used to locate a particular file/folder
E.g.: find /home/oracle -type f -name 1.txt - this will look for the file 1.txt under the /home/oracle folder
14. "touch" - used to change file access and modification time or create a new file
E.g.: touch /home/oracle/1.txt - this will create a new file named 1.txt if not already present. Else, it will change the file access time
15. "more" - used to display text one screen at a time, from a file
E.g.: more /home/oracle/1.txt - this will display the contents of 1.txt one screen at a time
16. "cat" - usually used to look at the contents of a file
E.g.: cat /home/oracle/1.txt - this will display the contents of 1.txt
17. "cal" - used to display the calendar for a month and year
18. "date" - used to display the current system date
19. "exit" - used to exit from a program or shell
20. "who" - used to see which user is connected to the system
Environment Control
Command Description
cd d Change to directory d
mkdir d Create new directory d
rmdir d Remove directory d
mv f1 [f2...] d Move file f to directory d
mv d1 d2 Rename directory d1 as d2
passwd Change password
alias name1 name2 Create command alias (csh/tcsh)
alias name1="name2" Create command alias (ksh/bash)
unalias name1[na2...] Remove command alias na
ssh nd Login securely to remote node
exit End terminal session
setenv name v Set env var to value v (csh/tcsh)
export name="v" set environment variable to value v (ksh/bash)
Output, Communication, & Help
Command Description
lpr -P printer f
or
lp -d printer f Output file f to line printer
script [f] Save terminal session to f
exit Stop saving terminal session
mailx username Send mail to user
man name Unix manual entry for name
Process Control
Command Description
CTRL/c * Interrupt processes
CTRL/s * Stop screen scrolling
CTRL/q * Resume screen output
sleep n Sleep for n seconds
jobs Print list of jobs
kill % Kill job n
ps Print process status stats
kill -9 n Remove process n
CTRL/z * Suspend current process
stop %n Suspend background job n
cmmd& Run cmmd in background
bg [%n] Resume background job n
fg [%n] Resume foreground job n
exit Exit from shell
Environment Status
Command Description
ls [d] [f...] List files in directory
ls -1 [f...] List files in detail
alias [name] Display command aliases
printenv [name] Print environment values
quota Display disk quota
date Print date & time
who List logged in users
whoami Display current user
finger [username] Output user information
chfn Change finger information
pwd Print working directory
history Display recent commands
! n Submit recent command n
File Manipulation
Command Description
vi [f] Vi fullscreen editor
emacs [f] Emacs fullscreen editor
ed [f] Text editor
wc f Line, word, & char count
cat f List contents of file
more f List file contents by screen
cat f1 f2 >f3 Concatenates f1 & f2 into f3
chmod mode f Change protection mode of f
cmp f1 f2 Compare two files
cp f1 f2 Copy file f1 into f2
sort f Alphabetically sort f
split [-n] f Split f into n-line pieces
mv f1 f2 Rename file f1 as f2
rm f Delete (remove) file f
grep 'ptn' f Outputs lines that match ptn
diff f1 f2 Lists file differences
head f Output beginning of f
tail f Output end of f
Compiler
Command Description
cc [-o f1] f2 C compiler
lint f Check C code for errors
f77 [-o f1] f2 Fortran77 compiler
pc [-o f1] f2 Pascal compiler
Working with NFS files
Files saved on the UITS central Unix computers Steel, the Parallel PC cluster, Solar/Lunar, and the Research SP are stored on the Network File Server (NFS). That means that your files are really on one disk, in directories named for the central Unix hosts on which you have accounts.
No matter which of these computers you are logged into, you can get to your files on any of the others. Here are the commands to use to get to any system directory from any other system:
cd /N/u/username/PPPC/
cd /N/u/username/Cobalt/
cd /N/u/username/Solar/
cd /N/u/username/Steel/
cd /n/u/username/SP/
Be sure you use the capitalization just as you see above, and substitute your own username for "username".
For example, if Jessica Rabbit is logged into her account on Steel, and wants to get a file on her SP account, she would enter:
cd /N/u/jrabbit/SP/
Now when she lists her files, she'll see her SP files, even though she's actually logged into Steel.
You can use the ordinary Unix commands to move files, copy files, or make symbolic links between files. For example, if Jessica Rabbit wanted to move "file1" from her Steel directory to her SP directory, she would enter:
mv -i /N/u/jrabbit/Steel/file1 /N/u/jrabbit/SP/
This shared file system means that you can access, for example, your SP files even when you are logged into Steel, and vice versa. However, if you are logged into the SP, you can only use the software installed on SP -- only users' directories are linked together, not system directories.
Abbreviations used in this document
CTRL/x hold down control key and press x
d directory
env environment
f filename
n number
nd computer node
prtr printer
ptn pattern
var variable
[y/n] yes or no
[] optional arg
... list
http://infohost.nmt.edu/tcc/help/unix/unix_cmd.html
http://www.computerhope.com/unix.htm
http://oracle.oreilly.com/news/unix_oracle_0101.html
http://www.ss64.com/ora/index.html
http://www.ss64.com/bash/index.html
http://www.oracle-base.com/dba/DBACategories.php
http://forums.oracle.com/forums/thread.jspa?threadID=305918&tstart=0
http://viu.eng.rpi.edu/lab/1/s1_4.html
The most frequently used commands in UNIX/LINUX
Submitted by prasannakrao on Tue, 04/13/2004 - 10:54. General Interest | Quick Tips & Newbies
The following are the most frequently used commands in UNIX/LINUX:
01. "cd" - used to change directory
E.g.: cd /home/oracle - this will go inside the "/home/oracle" directory
The "chdir" command also does the same
02. "mkdir" - used to create a directory
E.g.: mkdir /home/oracle - this will create the "/home/oracle" directory
The "chdir" command also does the same
03. "ls" - used to list the contents of any directory
E.g.: ls /home/oracle - this will list the contents of the "/home/oracle" directory
04. "cp" - used to copy files
E.g.: cp /home/oracle/1.txt /home - this will copy the file "/home/oracle/1.txt" into the directory "/home"
05. "mv" - used to move files
E.g.: mv /home/oracle/1.txt /home - this will move the file "/home/oracle/1.txt" into the directory "/home"
06. "rm" - used to remove/delete a file
E.g.: rm /home/oracle/1.txt - this will remove the file "/home/oracle/1.txt"
07. "clear" - used to clear the screen
08. "pwd" - used to display the current working directory (pwd=print working dir)
09. "chmod" - used to change the permission of a file
E.g.: chmod 755 /home/oracle/1.txt - this will give all the rights except the right to edit the file 1.txt
10. "man" - provides in depth information about the requested command (man=manual)
E.g.: man pwd - this will show the online manual on the command `pwd`
11. "vi" - invokes the vi editor (vi=visual)
E.g.: vi /home/oracle/1.txt - this will invoke the vi editor for editing the file 1.txt
12. "ps" - lists the processes that are currently running
13. "find" - used to locate a particular file/folder
E.g.: find /home/oracle -type f -name 1.txt - this will look for the file 1.txt under the /home/oracle folder
14. "touch" - used to change file access and modification time or create a new file
E.g.: touch /home/oracle/1.txt - this will create a new file named 1.txt if not already present. Else, it will change the file access time
15. "more" - used to display text one screen at a time, from a file
E.g.: more /home/oracle/1.txt - this will display the contents of 1.txt one screen at a time
16. "cat" - usually used to look at the contents of a file
E.g.: cat /home/oracle/1.txt - this will display the contents of 1.txt
17. "cal" - used to display the calendar for a month and year
18. "date" - used to display the current system date
19. "exit" - used to exit from a program or shell
20. "who" - used to see which user is connected to the system