Prsentation PowerPoint - PowerPoint PPT Presentation

1 / 112
About This Presentation
Title:

Prsentation PowerPoint

Description:

More UNIX Utilities for. Shell programming. at-at, batch--execute ... If newname exists its contents are overwritten. mv file1 newname. Explanation. Example ... – PowerPoint PPT presentation

Number of Views:60
Avg rating:3.0/5.0
Slides: 113
Provided by: skander4
Category:

less

Transcript and Presenter's Notes

Title: Prsentation PowerPoint


1
More UNIX Utilities for Shell programming
2
at-at, batch--execute commands at a later time
3
awk--pattern scanning and processing language
4
banner--make posters
5
basename--with a directory name delivers portions
of the pathname
6
bc--processes precision arithmetic
7
bdiffcompares two big files
  • bdiff compares two files that are too large for
    diff.

8
caldisplays a calendar
9
catconcatenates and displays files
10
chmodchange the permissions mode of a file
11
chownchanges owner of a file
12
clear, clears the terminal screen
13
cmpcompares two files
14
compresscompress, uncompress, zcat compress,
uncompress files, or display expanded files
15
cp copies files
16
cpio copy file archives in and out
17
cronthe clock daemon
  • cron executes commands at specified dates and
    times. Regularly scheduled jobs can be specified
    in the /etc/crontab file. (Must have superuser
    privileges)

18
cryptencode or decode a file
  • crypt encrypts and decrypts the contents of a
    file. The password is a key that selects a type
    of transformation

19
cutremoves selected fields or characters from
each line of a file
20
datedisplays the date and time or sets the date
21
diffcompares two files for differences diff
-biw-c -Cn
22
dusummarizes disk usage
23
echoechoes arguments
24
egrepsearches a file for a pattern using full
regular expressions
25
exprevaluates arguments as an expression
26
fgrepsearch a file for a character string
27
filedetermines the type of a file by looking at
its contents
28
findfinds files
29
fingerdisplays information about local and
remote users
  • By default, the finger command displays
    information about each logged in user, including
    login name, full name, terminal line (prepended
    with a if write permission is denied), idle
    time, login time, and location if known

30
fmtsimple text formatters
31
foldfolds long lines
  • Fold the contents of the specified filenames, or
    the standard input if no files are specified,
    breaking the lines to have maximum width. The
    default for width is 80. Width should be a
    multiple of 8 if tabs are present, or the tabs
    should be expanded

32
ftpfile transfer program
33
getop(s)parses command line options
  • The getopts command supersede getop. getops is
    used to break up options in command lines for
    easy parsing by shell procedures and to check for
    legal options.

34
grepsearches a file or a program
35
groupsprints group membership of user
  • The command groups prints on standard output the
    groups to which you or the optionally specified
    user belong.

36
idprints the username, user ID, group name and
group ID
  • id displays your user ID,user name, group ID, and
    group name. If your real ID and your effective
    IDs do not match, both are printed.

37
jshthe standard, job control shell
  • The command jsh in an interface to the standard
    Bourne shell which provides all of the
    functionality of the Bourne shell and enables job
    control.

38
linereads one line
  • line copies one line (up to a new line) from the
    standard input and writes it on the standard
    output. It returns an exit code of one on EOF and
    always prints at least a new line. It is often
    used within shell files to read from the users
    terminal.

39
lognamegets the name of the user running the
process
40
lp(ATT)sends output to a printer
41
lpr(UCB)sends output to a printer
42
lpsat(ATT)print information about the status of
the LP print service
43
lpq(UCB)print information about the status of
the printer
44
ls lists a contents of directory
45
mailmail, rmailread mail or send mail to users
  • A recipient is usually a username recognized by
    login. When recipients are named, mail assumes a
    message is being sent. It reads from the standard
    input up to an end-of-file(Ctrl-D), or if reading
    from a terminal, until it reads a line consisting
    of just a period. When either of those indicators
    is received, mail adds the letter to the mailfile
    for each recipient.

46
mailxinteractive message processing system
  • The mail utilities listed above provide an
    interactive interface for sending, receiving, and
    manipulating mail messages. Basic networking
    utilities must be installed for some of the
    features to work. Incoming mail is stored in a
    file called mailbox, and after it is read, it
    sends to a file called mbox

47
makemaintains, updates, and regenerates groups
of related program and files
  • make updates file according to commands listed in
    a description file, and if the target file is
    newer than the dependency file of the same name,
    make will update the target file.

48
mesgpermits or denies messages resulting from
the write command
  • mesg without argument n forbids messages via
    write by revoking no user write permission on the
    users terminal. mesg with argument y reinstates
    permission. All by itself, mesg reports the
    current state without changing it.

49
mkdircreates a directory
50
morebrowse or page through a text file
  • more is a filter that displays the contents of a
    text file on the terminal, one screenful at a
    time. It normally pauses after each screenful,
    and prints More at the bottom of the screen.

51
mvmove or rename files
52
nawkpattern scanning and processing language
  • nawk scans each input filename for lines that
    match any of a set of patterns. The command
    string must be enclosed in single quotes() to
    protect it from the shell. awk programs consists
    of a set of pattern/action statements used to
    filter specific information from a file, pipe, or
    stdin.

53
newgrplog in to a new group
  • newgrp logs a user into a new group by changing a
    users real and effective group ID. The user
    remains logged in and the current directory in
    unchanged. The execution of newgrp always
    replaces the current shell with a new shell,
    even if the command terminates with an error
    (unknown group)

54
newsprints mew items
  • news is used to keep the user informed of current
    events. By convention, these events are described
    by files in the directory /var/news. When invoked
    without arguments, news prints the contents of
    all current files in /var/news, most recent
    first, with each preceded by an appropriate header

55
niceruns a command at low priority
  • /usr/bin/nice executes a command with a lower CPU
    scheduling. The invoking process (generally the
    users shell) must be the time-sharing scheduling
    class. The command is executed in the
    time-sharing class. An increment of 10 is the
    default. The increment must be a range between 1
    and 19, unless you are the superuser. Also a csh
    built-in.

56
nohupmakes commands immune to hang-ups and quits
57
odoctal dump
  • od displays filename in one or more formats, as
    selected by the first argument. If the first
    argument is missing, -o is default e.g., the
    file can be displayed in bytes octal, ASCII,
    decimal, hex, etc.

58
packpack, cat, unpack--compresses and expands
files
  • pack compresses files. Wherever possible (and
    useful), each input file name is replaced by a
    packed file name.z with the same access modes,
    access and modified dates, and owner as those of
    name. Typically, text files are reduced to 60-70
    of their original size. pcat does for packed file
    what cat does for ordinary files, except that
    pcat cannot be used as a filter. The specified
    files are unpacked and written to the standard
    output. Thus to view a packed file named name.z
    use pcat name.z or just pcat name. unpack
    expands files created by pack.

59
passwdchanges the login password and password
attributes
  • The passwd command changes the password or lists
    password attributes associated with the users
    login name. Additionally, privileged users may
    use passwd to install or change passwords and
    attributes associated with any login name.

60
pastemerges same line of several files or
subsequent lines of one file
61
pcat(see pack)
62
pgdisplays files a page at a time
  • The pg command is a filter that allows you to
    page through one sreenful at a time on a
    terminal. If no filename is specified or it
    encounters the file name -, pg reads from
    standard input. Each screenful is followed by a
    prompt. If the user types a RETURN, another page
    is displayed. It allows you to back up and review
    something that has already passed.

63
prprints file
64
psreports process status
65
pwddisplays the present working directory
66
rcpremote file copy
67
rshstarts a remote shell
68
ruptimeshows the host status of local machines
  • ruptime gives a status line like uptime for each
    machine on the local network these are formed
    from packets broadcast by each host on the
    network once a minute. Machines for which no
    status has been received for five minutes are
    shown as being down. Normally, the listing is
    sorted by host name, but this order can be
    changed by specifying one of ruptimes options

69
rwhowho is logged in on local machine
  • The rwho command produces output similar to who,
    but for all machines on your network. However, it
    does not work through gateways and host must have
    the directory /var/spool/rwho as well as the rwho
    daemon running. If no report has been received
    from a machine for five minutes, rwho assumes the
    machine is down, and does not report users last
    known to be logged into that machines. If a user
    has no typed to the system for a minute or more,
    rwho reports this idle time. If a user has not
    typed to the system for an hour or more, the user
    is omitted from the output of rwho, unless the a
    flag is given

70
scriptcreates a typescript of a terminal session
71
sedstream editor
72
sizeprints section sizes in bytes of object files
  • The size command produces segment or section size
    information in bytes for each loaded section in
    ELF or COFF objects files. size prints out the
    size of the next, data, and bss (uninitialized
    data) segments (or section) and their total

73
sleepsuspends execution for some number of
seconds
74
sortsort and/or merge file
75
spellfinds spelling errors
  • spell collects word from the named filenames and
    looks them up in a spelling list. Words that
    neither occur among nor are derivable from words
    in the spelling list are printed on the standard
    output. If no filenames are named, words are
    collected from the standard input

76
splitsplits a file into pieces
77
stringsfinds any printable string in an object
or binary file
78
sttysets the options for a terminal
79
subecome super-user or another user
  • su allows one to become another user without
    logging off. The default username is root
    (superuser). To use su, the appropriate password
    must be supplied (unless the invoker is already
    root). If the password is correct, su creates a
    new shell process that has the real and effective
    user ID, group Ids, and supplementary group list
    set to those of the specified username. The new
    shell is specified, sh (Bourne shell) is used. To
    return to normal user ID privileges, type Ctrl-D
    to exit the new shell. The - option specifies a
    complete login.

80
sumcalculates a checksum for a file
81
syncupdates the super block and sends changes
blocks to disk
82
tabssets tab stops on a terminal
83
taildisplays the tail end of a file
84
talkallows you to talk to another user
85
tarstores and retrieves files from an archive
file, normally a tape device
86
teereplicates file standard output
87
telnetcommunicates with a remote host
88
testevaluates an expression
89
timedisplays a summary of time used by this
shell and its children
90
touchupdates access time and/or modification
time of a file
91
tputinitializes a terminal or queries the term
info database
92
trtranslates characters
93
trueprovide successful exit status
  • true does nothing, successfully, meaning that it
    always returns a zero exit status, indicating
    success. Used in Bourne and Korn shell programs
    as a command to start an infinite loop
  • while true
  • do
  • command
  • done

94
tsorttopological sort
  • The tsort command produces, on the standard
    output, a totally ordered list of items
    consistent with a partial ordering of items
    mentioned in the input filename. If no filename
    is specified, the standard input is understood.
    The input consists of pairs of items (nonempty
    strings) separated by blanks. Pairs of different
    items indicate ordering. Pairs of identical items
    indicate presence, but not ordering

95
ttygets the name of the terminal
  • tty prints the path name of users terminal

96
umasksets file-creation mode mask for permissions
97
unameprints name of current machine
98
uncompressrestores files to their original state
after they have been compressed using the
compress command
99
uniqreports on duplicate lines in a file
100
unitsconverts quantities expressed in standard
scales to other scales
  • units converts quantities expressed in various
    standard scales to their equivalents in other
    scales. It works interactively in this fashion
  • You haveinch
  • You wantcm
  • 2.540000e00
  • /3.937008e-01

101
unpackexpands files created by pack
  • unpack expands files created by pack. For each
    filename specified in the command, a search is
    made for a file called name.z (or just name, if
    name ends in .z). If this file appears to be
    packed file, it is replaced by its expanded
    version. The new file has the .z suffix stripped
    from its name, and has the same access modes,
    access and modification dates, and owner as those
    of the packed file

102
uucpcopy files to another system, UNIX-to-UNIX
system copy
103
uuencodeuuencode, uudecodeencode a binary file
into ASCII text in order to send it through
e-mail, or convert it back into its original form
104
wccounts lines, words, and characters
105
whatextracts SCCS version information from a
file by printing information found after the _at_()
pattern
  • What searches each filename for the occurrence of
    the pattern, _at_(), that the SCCS get command
    substitutes for the Z keyword, and prints what
    follows up to a gt, new line, \, or null character

106
which(UCB)locates a command and displays its
pathname or alias
  • which takes a list of names and looks for the
    files that would be executed had the names been
    given as commands. Each argument is expanded if
    it is aliased, and searched for along the users
    path. Both alias and path are taken from the
    users .cshrc file. Only .cshrc is used

107
whereis(UCB)locates the binary, source, and
manual page file for a command
108
whodisplays who is logged on the system
109
writewrites a message to another user
  • Writes copies to lines from your terminal to
    anothers terminal

110
xargsconstructs an argument list(s) and executes
a command
111
zcatuncompress a compressed file to standard
output. Same as uncopmress -c
112
References
  • UNIX SHELLS BY EXAMPLE BY ELLIE QUIGLEY
  • UNIX FOR PROGRAMMERS AND USERS BY G. GLASS AND K
    ABLES
  • UNIX SHELL PROGRAMMING BY S. KOCHAN AND P. WOOD
Write a Comment
User Comments (0)
About PowerShow.com