Вы находитесь на странице: 1из 2

Common Unix 5VR4 Commands df -k Display free space in kilobytes for mounted file make Code compilation utility.

man Online unix manual (“man-pages”). Gives systems. mkdir dirx Creates directory dirx.
detailed instructions on all of the commands listed echo name Displays literal "name" on screen. more filename1 Displays single pages from filename1
here and a lot more. See man man for more. echo $PATH Displays PATH environment variable. pausing
filename1 List contents of file filename1 to screen. ed/edit/ex Alternative line editors, see vi. after each page. Many options.
cat filename1 > filename2 Overwrite contents of env Displays current environment variables or allows mv filename1 /usr/opt/ Moves filename1 to directory
filename2 with filename1. cat filename1» filename2 setting. /usr/opt.
Append contents of filename1 to filename2. file filename1 Determines and displays type of file for Unlike the cp (copy) command, mv removes file
cd /usr Change current directory to /usr. filename1 (text, data, executable, directory, symbolic from origin.
cd .. Change current directory to previous higher link...etc...) newgrp group1 Changes current group to group 1
directory. cd Change to home of current userid. find /usr/opt/bin -name "filename1*" print Starts news Displays unread files from /usr/news or
chgrp group 1 filename1 Change group id to group 1 searching in /usr/opt/bin for files starting with filename1. /var/news.
for filename1. If found prints the full file names. Continues nice/renice Adjusts process’ execution priority
chgrp -R group 1 * Change group id of all files in searching subdirectories. passwd Allows changing your login password
current and subdirectories to group 1. finger sam Displays data about user session for sam. ps Lists all of current user's live processes
chmod ugo+rwx filename1 Add read/write/execute ftp solar Establishes a File Transfer Protocol session ps -ef List all users processes that are executing.
permission to filename1 for user/owner, group and over the network between current host and a host pwd Displays current working directory you are in
others (world). chmod ox filename1 Remove execute named solar. See man pages for ftp to understand rcp filename1 hostb:/usr/local/bin Copies filename1
from others(world). various ftp commands. from
chmod 751 filename1 Set rwx for user/owner, rx for grep jwilson /etc/passwd Searches the file /etc/ current host system to hostb, and places it in the
group and x for others. rwx=421, r=4, w=2, x=1 passwd searching for string "jwilson". If found, /usr/local/bin directory. The .rhosts or hosts.equiv
rx=5x=7x=1. displays. files must be setup to allow action
chown sam filename1 Change owner of file filename1 grep -i Sam filename1 Search filename1 for upper/lower rksh Starts restricted Korn Shell session
to sam case rlogin hostb Logs into remote host name hostb
chown -R sam * Change owner to sam for all files string of “Sam” and display any lines found. rm filename1 Deletes filename1 from the disk without
in current and subdirectories. groups sam List groups that sam is a member of. recourse
clear Clear the terminal screen head filename1 Display first few lines of filename1. rm -i filename1 Deletes filename1 after prompting for
compress filename1 Compress file filename1. See head -50 filename1 Display first fifty lines of filename1. verification
uncompress. id List current user id and any group ids. rmdir dirx Deletes directory dirx
cp filename1 filename2 copy file filename1 to kill -9 1351 Terminate process number 1351. rmdir –r dirx Deletes directory and all contents
filename2 destroying filename2. ksh Start Korn Shell command interpreter. See man rsh Restricted version of Bourne Shell for security
cp -i * /usr/Iocal/bin Copy all files in current pages for more information. This is the preferred sar System Activity Reporter
directory to /usr/local/bin directory. Prompt before shell for most users. sh Bourne Shell command interpreter. Alternative to
overwriting files (i). ln -s filename1 /usr/opt/filename2 Create a symbolic link Korn Shell and C shell but is the default on most
cpio Copy file archives to disk/tape.See man pages. named /usr/opt/filename2 that points to filename1. See systems. Older version that is losing
crontab -e Edit crontab file for userid. man pages. popularity
crontab -e bill Edit crontab file for user bill. lp –d lp1 filename1 Print filename1 on destination printer sleep 3 Pauses for 3 seconds and continues
crontab -l List crontab entries for current userid. lp1. stty sane Attempts to restore terminal settings after
csh Start the c shell process. See man pages. lpstat -d Displays name of default printer, if any. they are hosed. Use CTRL-J with this command
cut d: fi ,5 /etc/passwd Extract username & real lpstat -a Lists printers accepting print requests. stty erase ^H Use to reset backspace/delete. ^H is
names from file /etc/passwd where delimiter is colon lpstat -s Displays most everything regarding printing key you may want to use for backspace/delete.
getting fields 1 & 5. lpstat -u sam Displays status of sam's print jobs. ls -al Typically the backspace key itself
who I cut d" "H List login names from who Displays all files in wide listing su sam Logs you on as user sam
command. date Display current date string. ls –al *.doc Displays files ending with .doc. su - sam Log on as sam, and execute his profile too
date +%D Display current date as 11/21/94 format. ls –al /bin/k* Displays files starting with "k” in /bin tail filename1 Display last few lines of filename1
dd Copy file(s) to/from raw devices, see man pages. directory. tail -50 filename1 Display last fifty lines of filename1
df Display free disk blocks and modes on file mail sam Starts mail message to sam tail -f Continually reads updating file. Great for
systems. mailx sam Nicer looking mail utility. monitoring growth of a log file while being written
tar –cvf /dev/rmt/0c /usr/bin/* Tape archive Visual Editor Commands and Navigation
utility. Copies all files in /usr/bin directory to tape Cursor Movement
device /dev/rmt/0. h,j,k,l are left, down, up and right movement. O,$ Jump to
tar –xvf /dev/rmt/0 /usr/bin/ Extracts all files front, end of line.
from tape device /dev/rmt/0 and writes them to w skip to next word.
CTRL-D Down one page.
/usr/bin/
CTRL- U Up one page.
tar-tvf /dev/rmt/0c Read tape on device G Skip to end of file.
/dev/rmt/0c and lists contents in verbose mode 1G Skip to top of file.
tee Used in scripts to split output to two outputs. CTRL-R or CTRL-L Refresh screen
Usually used with a pipe command (I) Searching
tee –a /tmp/filename1 Append the output to / text Search forward for text.
filename1 without overwriting its original content
telnet hostb Create a remote terminal on hostb
touch filename1 Creates an empty file named
? text Search backward for text.
n Repeat search after find.
Line Numbering
CTRL-G Display current line number :99 Move to line
____________
filename1. number 99
uname -a Lists 0/S revision, host name, hardware Inserting Text
info. a Append after cursor.
uncompress filename1 Uncompresses file with .Z
suffix,
A Append to end of line.
i Insert before cursor.
I Insert at beginning of line.
Common UNIX
created by compress command previously.
uptime Displays current time, time logged-in, number
of users etc.
o Open new line below cursor.
ESC Terminate edit mode return to command mode.
Changing Text
System V
users Displays current logged-in users in a listing.
uucp Unix-to-Unix Copy utility.
view filename1 A read only version of vi editor.
cw Change word.
cc Change whole line.
C Change text to end of line.
Commands
dd Delete line
w Combination of uptime, who and ps -a commands.
wall Write to all. Allows you to enter a msg to be
sent to line 25 of all terminals. End message with a
5dd Delete current line and next 4.
D Delete to end of line.
u Undo last change.
Pocket Guide
U Restore current line.
CTRL-D command.
wc -l filename1 Utility that counts the number of lines Moving Text
yy Yank a copy of current line.
in
p Insert the previously yanked line.
filename1. Download this and other pocket guides and technical
wc -c filename1 Utility that counts the number of Saving and Exiting articles from our website at:
ZZ Save and exit file.
bytes in :wq Same as ZZ.
filename1. –m provides number of characters. :q! Exit without saving. http://www.solutionbeacon.com/
wc -w filename1 Utility that counts the number of the :n Go to next file to be edited.
:w filename1 Save edited file as filename1. Contact: workshop@solutionbeacon.com
words in filename1.
whence filename2 Prints path name location of Symbols
> Redirect output Rev 06/01
executable
< Redirect input
filename2. Solution Beacon, LLC reserves the right to revise or make
>> Append to file
improvements to this document at any time without obligation
which filename2 Similiar to whence command. | Pipe Output
to notify any person of such revisions or improvements.
who -r Displays current system run level. & Run process in background
Solution Beacon does not warrant that this document is error-
; Separate cmds
who -b Displays date/time of last reboot. free. In no event shall Solution Beacon be liable for any
* Match any char(s)
who am I Displays effective user id of user. who consequential or incidental damages, including but not limited
? Match a char
to loss of business profits or any other commercial product
Prints effective username. ls fred* > file.
names herein are trademarks, registered trademarks or
service marks of their respected owners.

Вам также может понравиться