Sunday, January 17, 2010

UNIX Scripting

Command Summary
Here is a summary of some of the commands available. For more details refer to the manual page in Section 1 of the UNIX Reference Manual. You can see these on-line by using the man command. Just type man followed by the name of the command you want to see.
Logging out
logout
- log off UNIX
Note, on the Sun SPARCStations or Linux workstation you will need to exit the Desktop Environment instead, see Introductory Notes 301 and 302.
Files and Directories
These commands allow you to create directories and handle files.
cat
- concatenate and print data
cd
- change current directory
chgrp
- change file group
chmod
- change file mode
cp
- copy file data
file
- determine file type
find
- find files
grep
- search file for regular expression
head
- give first few lines
just
- text justification program
lpq
- spool queue examination program
lpr
- spool file for line printing
lprm, cancel
- remove jobs from line printer queue
ls
- list and generate statistics for files
mkdir
- make a new directory
more, page
- display file data at your terminal
mv
- move or rename files
pwd
- print working directory
rm, rmdir
- remove (unlink) files or directories
tail
- print last lines from file
touch
- update access and modification times of a file
Commands for accessing floppy disks
The mtools commands are for accessing MSDOS disks.
mcopy
- copy to/from floppy disk
mdir
- list directory of floppy disk
mcd
- change MSDOS directory
mdel
- delete an MSDOS file
File Editors
Editors are used to create and amend files.
emacs
- GNU project Emacs
ex, edit
- line editor
gedit
- GNOME GUI text editor
nedit
- easy-to-use GUI text editor
xemacs
- emacs with mouse action
dtpad
- Sun CDE text editor
pico
- easy text editor for vdus
vi
- standard text editor
Vi, pico and emacs are screen-based editors which run on a vdu or in a workstations terminal emulation window; dtpad, gedit, nedit and xemacs are graphical user interface (GUI) -based editors with cut and paste, mouse-controlled cursor positioning etc.
Manipulating data
The contents of files can be compared and altered with the following commands.
awk
- pattern scanning and processing language
cmp
- compare the contents of two files
comm
- compare sorted data
cut
- cut out selected fields of each line of a file
diff
- differential file comparator
expand, unexpand
- expand tabs to spaces, and vice versa
gawk
- pattern scanning and processing language
Manipulating data (cont'd)
join
- join files on some common field
look
- find lines in sorted data
perl
- data manipulation language
paste
- merge file data
sed
- stream text editor
sort
- sort file data
split
- split file into smaller files
tr
- translate characters
uniq
- report repeated lines in a file
wc
- count words, lines, and characters
Compressed files
Files may be compressed to save space. Compressed files can be created and examined.
compress
- compress files
uncompress
- uncompress files
zcat
- cat a compressed file
zcmp, zdiff
- compare compressed files
zmore
- file perusal filter for crt viewing of compressed text
gzip
- GNU alternative compression method
gunzip- uncompress gzipped files



Status
These commands list or alter information about the system.
chfn
- change your finger entry
date
- print the date
determin
- automatically find terminal type
du
- print amount of disk usage
finger
- print information about logged-in users
groups
- show group memberships
homequota
- show quota and file usage
iostat
- report I/O statistics
kill
- send a signal to a process
last
- show last logins of users
lun
- list user names or login ID
netstat
- show network status
passwd
- change your login password
printenv
- display value of a shell variable
ps
- print process status statistics
quota -v
- display disk usage and limits
reset
- reset terminal mode
script
- keep script of terminal session
stty
- set terminal options
time
- time a command
tset
- set terminal mode
tty
- print current terminal name
uptime
- display system status
users
- print names of logged in users
vmstat
- report virtual memory statistics
w
- show what logged in users are doing
who
- list logged in users
Printing

Messages between Users
The UNIX systems support on-screen messages to other users and world-wide electronic mail.
pine

- vdu-based mail utility
elm
- alternative vdu-based mail utility
frm, from
- identifies sender of mail
mail
- simple send or read mail program
dtmail
- CDE mail handling tool on SPARCStations
evolution
- GUI mail handling tool on Linux
mesg
- permit or deny messages
parcel
- send files to another user
talk
- talk to another user
write
- write message to another user
Networking
The School of Computer Science is connected to the JANET Internet Protocol Service (JIPS), the UK Universities' network.
These commands are used to send and receive files from Campus UNIX hosts and from other hosts on JIPS and the Internet around the world.
ftp
- file transfer program
rcp
- remote file copy
rlogin
- remote login to a UNIX host
rsh
- remote shell
tftp
- trivial file transfer program
telnet
- make terminal connection to another host
ssh
- secure shell terminal or command connection
scp
- secure shell remote file copy
sftp
- secure shell file transfer program
netscape
- web browser
(Some of these commands may be restricted for security reasons).

Print this post

No comments: