Unix Lab Summary

download Unix Lab Summary

of 26

Transcript of Unix Lab Summary

  • 7/27/2019 Unix Lab Summary

    1/26

    man(1) man(1)

    NAME

    man - format and display the on-line manual pages

    SYNOPSISman [-acdfFhkKtwW] [--path] [-m system] [-p string] [-C config_file] [-M

    pathlist] [-P pager] [-B browser] [-H htmlpager] [-S sec-tion_list] [section] name ...

    DESCRIPTIONman formats and displays the on-line manual pages. If you specify section,

    man only looks in that section of the manual. name isnormally the name of the manual page, which is typically the name of a

    command, function, or file. However, if name contains a slash(/) then man interprets it as a file specification, so that you can do man

    ./foo.5 or even man /cd/foo/bar.1.gz.

    See below for a description of where man looks for the manual page files.

    OPTIONS-C config_file

    Specify the configuration file to use; the default is /etc/man.config.(See man.config(5).)

    -M pathSpecify the list of directories to search for man pages. Separate the

    directories with colons. An empty list is the same asnot specifying -M at all. See SEARCH PATH FOR MANUAL PAGES.

    -P pagerSpecify which pager to use. This option overrides the MANPAGER

    environment variable, which in turn overrides the PAGER vari-able. By default, man uses /usr/bin/less -is.

    -B Specify which browser to use on HTML files. This option overrides theBROWSER environment variable. By default, man uses

    /usr/bin/less-is,

    -H Specify a command that renders HTML files as text. This optionoverrides the HTMLPAGER environment variable. By default, man

    uses /bin/cat,

    -S section_listList is a colon separated list of manual sections to search. This

    option overrides the MANSECT environment variable.

    -a By default, man will exit after displaying the first manual page itfinds. Using this option forces man to display all the

    manual pages that match name, not just the first.

    -c Reformat the source man page, even when an up-to-date cat pageexists. This can be meaningful if the cat page was formatted

  • 7/27/2019 Unix Lab Summary

    2/26

    for a screen with a different number of columns, or if the preformattedpage is corrupted.

    -d Dont actually display the man pages, but do print gobs of debugginginformation.

    -D Both display and print debugging info.

    -f Equivalent to whatis.

    -F or --preformatFormat only - do not display.

    -h Print a help message and exit.

  • 7/27/2019 Unix Lab Summary

    3/26

  • 7/27/2019 Unix Lab Summary

    4/26

    Cal displays a simple calendar. If arguments are not specified, the currentmonth is displayed. The options are as follows:

    -1 Display single month output. (This is the default.)

    -3 Display prev/current/next month output.

    -s Display Sunday as the first day of the week. (This is the default.)

    -m Display Monday as the first day of the week.

    -j Display Julian dates (days one-based, numbered from January 1).

    -y Display a calendar for the current year.

    A single parameter specifies the year (1 - 9999) to be displayed; note the yearmust be fully specified: cal 89 will not display a

    calendar for 1989. Two parameters denote the month (1 - 12) and year. If noparameters are specified, the current months calendar is

    displayed.

    A year starts on Jan 1.

    The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd ofSeptember. By this time, most countries had recognized the

    reformation (although a few did not recognize it until the early 1900s.) Tendays following that date were eliminated by the reforma-

    tion, so the calendar for that month is a bit unusual.

    HISTORYA cal command appeared in Version 6 AT&T UNIX.

    OTHER VERSIONSSeveral much more elaborate versions of this program exist, with support for

    colors, holidays, birthdays, reminders and appointments,

    etc. For example, try the cal fromhttp://home.sprynet.com/~cbagwell/projects.html or GNU gcal.

    BSD June 6, 1993 BSD(END)

  • 7/27/2019 Unix Lab Summary

    5/26

  • 7/27/2019 Unix Lab Summary

    6/26

    WHO(1) User Commands WHO(1)

    NAMEwho - show who is logged on

    SYNOPSISwho [OPTION]... [ FILE | ARG1 ARG2 ]

    DESCRIPTION

    -a, --allsame as -b -d --login -p -r -t -T -u

    -b, --boottime of last system boot

    -d, --deadprint dead processes

    -H, --headingprint line of column headings

    -l, --login

    print system login processes

    --lookupattempt to canonicalize hostnames via DNS

    -m only hostname and user associated with stdin

    -p, --processprint active processes spawned by init

    -q, --countall login names and number of users logged on

    -r, --runlevelprint current runlevel

    -s, --shortprint only name, line, and time (default)

    -t, --timeprint last system clock change

    -T, -w, --mesgadd users message status as +, - or ?

    -u, --users

    list users logged in

    --messagesame as -T

    :

  • 7/27/2019 Unix Lab Summary

    7/26

  • 7/27/2019 Unix Lab Summary

    8/26

  • 7/27/2019 Unix Lab Summary

    9/26

    NAMEcp - copy files and directories

    SYNOPSIScp [OPTION]... [-T] SOURCE DESTcp [OPTION]... SOURCE... DIRECTORYcp [OPTION]... -t DIRECTORY SOURCE...

    DESCRIPTIONCopy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

  • 7/27/2019 Unix Lab Summary

    10/26

    Mandatory arguments to long options are mandatory for short options too.

    -a, --archivesame as -dR --preserve=all

    --attributes-onlydon't copy the file data, just the attributes

    --backup[=CONTROL]make a backup of each existing destination file

    -b like --backup but does not accept an argument

    --copy-contentscopy contents of special files when recursive

    -d same as --no-dereference --preserve=links

    -f, --forceif an existing destination file cannot be opened, remove it and try

    again (redundant if the -n option is used)

    -i, --interactiveprompt before overwrite (overrides a previous -n option)

    -H follow command-line symbolic links in SOURCE

    -l, --link

  • 7/27/2019 Unix Lab Summary

    11/26

    DIR(1) User CommandsDIR(1)

    NAME

  • 7/27/2019 Unix Lab Summary

    12/26

    dir - list directory contents

    SYNOPSISdir [OPTION]... [FILE]...

    DESCRIPTIONList information about the FILEs (the current directory by default).

    Sort entries alphabetically if none of -cftuvSUX nor --sort isspecified.

    Mandatory arguments to long options are mandatory for short options too.

    -a, --alldo not ignore entries starting with .

    -A, --almost-alldo not list implied . and ..

    --authorwith -l, print the author of each file

    -b, --escapeprint C-style escapes for nongraphic characters

    --block-size=SIZEscale sizes by SIZE before printing them. E.g., `--block-size=M'

    prints sizes in units of 1,048,576 bytes. See SIZE formatbelow.

    -B, --ignore-backupsdo not list implied entries ending with ~

    -c with -lt: sort by, and show, ctime (time of last modification of

    file status information) with -l: show ctime and sort by nameotherwise: sort by ctime, newest first

    -C list entries by columns

    --color[=WHEN]colorize the output. WHEN defaults to `always' or can be `never'

    or `auto'. More info below

  • 7/27/2019 Unix Lab Summary

    13/26

    MV(1) User CommandsMV(1)

    NAME

  • 7/27/2019 Unix Lab Summary

    14/26

    mv - move (rename) files

    SYNOPSISmv [OPTION]... [-T] SOURCE DESTmv [OPTION]... SOURCE... DIRECTORYmv [OPTION]... -t DIRECTORY SOURCE...

    DESCRIPTIONRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

    Mandatory arguments to long options are mandatory for short options too.

    --backup[=CONTROL]make a backup of each existing destination file

    -b like --backup but does not accept an argument

    -f, --forcedo not prompt before overwriting

    -i, --interactive

    prompt before overwrite

    -n, --no-clobberdo not overwrite an existing file

    If you specify more than one of -i, -f, -n, only the final one takeseffect.

    --strip-trailing-slashesremove any trailing slashes from each SOURCE argument

    -S, --suffix=SUFFIX

    override the usual backup suffix-t, --target-directory=DIRECTORY

    move all SOURCE arguments into DIRECTORY

  • 7/27/2019 Unix Lab Summary

    15/26

    LS(1) User Commands LS(1)

    NAMEls - list directory contents

  • 7/27/2019 Unix Lab Summary

    16/26

    SYNOPSISls [OPTION]... [FILE]...

    DESCRIPTIONList information about the FILEs (the current directory by default).Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

    Mandatory arguments to long options are mandatory for short options

    too.

    -a, --alldo not ignore entries starting with .

    -A, --almost-alldo not list implied . and ..

    --author

  • 7/27/2019 Unix Lab Summary

    17/26

    HEAD(1) User CommandsHEAD(1)

    NAMEhead - output the first part of files

  • 7/27/2019 Unix Lab Summary

    18/26

    SYNOPSIShead [OPTION]... [FILE]...

    DESCRIPTIONPrint the first 10 lines of each FILE to standard output. With more than

    one FILE, precede each with a header giving the file name.With no FILE, or when FILE is -, read standard input.

    Mandatory arguments to long options are mandatory for short options too.

    -c, --bytes=[-]Kprint the first K bytes of each file; with the leading `-', print

    all but the last K bytes of each file

    -n, --lines=[-]Kprint the first K lines instead of the first 10; with the leading

    `-', print all but the last K lines of each file

    -q, --quiet, --silentnever print headers giving file names

    -v, --verbosealways print headers giving file names

    --help display this help and exit

    --versionoutput version information and exit

    K may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for

    T, P, E, Z, Y.

    AUTHOR Written by David MacKenzie and Jim Meyering.

    REPORTING BUGSReport head bugs to [email protected] coreutils home page:

  • 7/27/2019 Unix Lab Summary

    19/26

    \

    TAIL(1) User CommandsTAIL(1)

    NAMEtail - output the last part of files

    SYNOPSIStail [OPTION]... [FILE]...

    DESCRIPTIONPrint the last 10 lines of each FILE to standard output. With more than

    one FILE, precede each with a header giving the file name.

  • 7/27/2019 Unix Lab Summary

    20/26

    With no FILE, or when FILE is -, read standard input.

    Mandatory arguments to long options are mandatory for short options too.

    -c, --bytes=Koutput the last K bytes; alternatively, use -c +K to output bytes

    starting with the Kth of each file

    -f, --follow[={name|descriptor}]

    output appended data as the file grows; -f, --follow, and --follow=descriptor are equivalent

    -F same as --follow=name --retry

    -n, --lines=Koutput the last K lines, instead of the last 10; or use -n +K to

    output lines starting with the Kth

    --max-unchanged-stats=Nwith --follow=name, reopen a FILE which has not changed size after

    N (default 5) iterations to see if it has been unlinked or

    renamed (this is the usual case of rotated log files). Withinotify, this option is rarely useful.

    --pid=PIDwith -f, terminate after process ID, PID dies

    -q, --quiet, --silentnever output headers giving file names

    --retrykeep trying to open a file even when it is or becomes inaccessible;

    useful when following by name, i.e., with --follow=name

    -s, --sleep-interval=Nwith -f, sleep for approximately N seconds (default 1.0)

    between iterations. With inotify and --pid=P, check process P at

  • 7/27/2019 Unix Lab Summary

    21/26

    CAT(1) User Commands CAT(1)

    NAMEcat - concatenate files and print on the standard output

    SYNOPSIScat [OPTION]... [FILE]...

  • 7/27/2019 Unix Lab Summary

    22/26

    DESCRIPTIONConcatenate FILE(s), or standard input, to standard output.

    -A, --show-allequivalent to -vET

    -b, --number-nonblanknumber nonempty output lines, overrides -n

    -e equivalent to -vE

    -E, --show-endsdisplay $ at end of each line

    -n, --number

    PWD(1) User Commands PWD(1)

    NAMEpwd - print name of current/working directory

    SYNOPSIS

  • 7/27/2019 Unix Lab Summary

    23/26

    pwd [OPTION]

    DESCRIPTIONPrint the full filename of the current working directory.

    --help display this help and exit

    --versionoutput version information and exit

    NOTE: your shell may have its own version of pwd, which usuallysupersedes the

    version described here. Please refer to your shells documentation for

    detailsabout the options it supports.

    AUTHORWritten by Jim Meyering.

    REPORTING BUGSReport bugs to .

    COPYRIGHTCopyright 2006 Free Software Foundation, Inc.

    :

  • 7/27/2019 Unix Lab Summary

    24/26

    CHMOD(1) User Commands CHMOD(1)

    NAMEchmod - change file access permissions

    SYNOPSISchmod [OPTION]... MODE[,MODE]... FILE...chmod [OPTION]... OCTAL-MODE FILE...

    chmod [OPTION]... --reference=RFILE FILE...DESCRIPTION

    This manual page documents the GNU version of chmod. chmod changes thepermis-

    sions of each given file according to mode, which can be either a symbolicrep-

    resentation of changes to make, or an octal number representing the bitpattern

    for the new permissions.

    The format of a symbolic mode is [ugoa...][[+-=][rwxXstugo...]...][,...].

    Multiple symbolic operations can be given, separated by commas.

    A combination of the letters ugoa controls which users access

    to the filewill be changed: the user who owns it (u), other users in the files

    group (g),other users not in the files group (o), or all users (a). If none of

    these aregiven, the effect is as if a were given, but bits that are set in

    the umaskare not affected.

  • 7/27/2019 Unix Lab Summary

    25/26

    The operator + causes the permissions selected to be added to

    the existingpermissions of each file; - causes them to be removed; and =

    causes them to

    GREP(1) GREP(1)

    NAMEgrep, egrep, fgrep - print lines matching a pattern

    SYNOPSISgrep [options] PATTERN [FILE...]grep [options] [-e PATTERN | -f FILE] [FILE...]

    DESCRIPTIONGrep searches the named input FILEs (or standard input if no files are

    named, or

    the file name - is given) for lines containing a match to the givenPATTERN. By

    default, grep prints the matching lines.

    In addition, two variant programs egrep and fgrep are available. Egrepis the

    same as grep -E. Fgrep is the same as grep -F.

    OPTIONS-A NUM, --after-context=NUM

    Print NUM lines of trailing context after matching lines. Places aline

    containing -- between contiguous groups of matches.

    -a, --textProcess a binary file as if it were text; this is equivalent

    to the--binary-files=text option.

    -B NUM, --before-context=NUMPrint NUM lines of leading context before matching lines. Places a

    line:

  • 7/27/2019 Unix Lab Summary

    26/26