Академический Документы
Профессиональный Документы
Культура Документы
Following is a very brief introduction to some useful Unix commands, including examples of how to use each command.
Note: will overwrite existing file cat test1 test2 > test3
>> Append output command > filename echo "This is the next line of the log" >> log.file
Will preserve whatever is in the log and add the text as the last line.
< Redirect an input-file command filename < filename
cd /orastage/tmp
chmod Change file permissions Command permission filename To make a file executable:
chmod +x interface.prog
find (starting directory) (matching criteria and This tries to find a file named printers.conf, in a directory called etc and
The find command will begin looking in the starting actions) when found, will display the path.
directory you specify and proceed to search through
all accessible subdirectories. You may specify more
than one starting directory for searching.
grep A utility for searching data for lines that match a given Command option filename Search for string linux in the index.html file:
pattern. Its name comes from globally search a grep linux index.html
regular expression and print.
Insensitive case search:
grep -i linux index.html
MP Tickets Page 1
ls List files in the current directory ls corp*
ls -ld sql
Returns attributes for the directory "sql"
ps report process status
pwd The present working directory
vi enter Vi editor
man Online manual that explains a command man {command} man mkdir
Rename:
mv stream_move_03.ksh STREAMJOB.prog
Rmdir Remove a directory. Directory must be empty. {command} {option} {directory name} To remove a directory called wf, enter:
rmdir wf
Shell script Shells accept commands from you via the keyboard
and execute them. These commands stored in a text
file is a shell script.
Sleep Delays for specified amount of time (seconds is the sleep NUMBER[SUFFIX] To sleep for 5 seconds, use:
default) before continuing to the next command. sleep 5
s for seconds (the default)
m for minutes To sleep for 2 minutes, use:
h for hours sleep 2m
d for days
To sleep for 3 hours, use:
sleep 3h
whatis A short explanation about a command whatis{command} whatis ls
whoami User name
wc Word count. Gives the count of characters, words, Command option filename wc *.pdb
lines. Has conditions that you can use for additional
functionality.
Or for just the number of lines in one specified file
wc -l pentane.pdb
MP Tickets Page 2