×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    UnixCommands: Difference between revisions

    Content added Content deleted
    imported>mutante
    mNo edit summary
    imported>RobiH
    (Table)
    Line 31: Line 31:
    Command/Syntax What it will do
    Command/Syntax What it will do


    <table border="1" cellspacing="1" cellpadding="5" bgcolor="#dddddd" width="820">
    *[[awk]] / [[nawk]] [options] file scan for patterns in a file and process the results
    <TH>Command/Syntax<TH>What it will do<TR>
    *[[cat]] [options] file concatenate (list) a file
    <TD><B>awk/nawk</B> [options] <I>file</I><TD>scan for patterns in a file and process the results<TR>
    *[[cd]] [directory] change directory
    *[[chgrp]] [options] group file change the group of the file
    <TD><B>cat</B> [options] <I>file</I><TD>concatenate (list) a file<TR>
    *[[chmod]] [options] file change file or directory access permissions
    <TD><B>cd</B> [directory]<TD>change directory<TR>
    *[[chown]] [options] owner file change the ownership of a file; can only be done by the superuser
    <TD><B>chgrp</B> [options] <I>group file</I><TD>change the group of the file<TR>
    <TD><B>chmod</B> [options] <I>file</I><TD>change file or directory access permissions<TR>
    *[[chsh]] (passwd -e/-s) username login_shell change the user's login shell (often only by the superuser)
    <TD><B>chown</B> [options] <I>owner file</I><TD>change the ownership of a file; can only be done by the superuser<TR>
    *[[cmp]] [options] file1 file2 compare two files and list where differences occur (text or binary files)
    <TD><B>chsh</B> (<B>passwd -e/-s</B>) <I>username login_shell</I><TD>change the user's login shell (often only by the superuser)<TR>
    *[[compress]] [options] file compress file and save it as file.Z
    *[[cp]] [options] file1 file2 copy file1 into file2; file2 shouldn't already exist. This command creates or overwrites file2.
    <TD><B>cmp</B> [options] <I>file1 file2</I><TD>compare two files and list where differences occur (text or binary files)<TR>
    <TD><B>compress</B> [options] <I>file</I><TD>compress file and save it as <I>file.Z</I><TR>
    *[[cut]] (options) [file(s)] cut specified field(s)/character(s) from lines in file(s)
    <TD><B>cp</B> [options] <I>file1 file2</I><TD>copy <I>file1</I> into <I>file2</I>; <I>file2</I> shouldn't already exist. This command creates or overwrites <I>file2</I>.<TR>
    *[[date]] [options] report the current date and time
    <TD><B>cut</B> (options) [<I>file</I>(s)]<TD>cut specified field(s)/character(s) from lines in file(s)<TR>
    *[[dd]] [if=infile] [of=outfile] [operand=value] copy a file, converting between ASCII and EBCDIC or swapping byte order, as specified
    <TD><B>date</B> [options]<TD>report the current date and time<TR>
    *[[diff]] [options] file1 file2 compare the two files and display the differences (text files only)
    <TD><B>dd</B> [if=infile] [of=outfile] [operand=value]<TD>copy a file, converting between ASCII and EBCDIC or swapping byte order, as specified<TR>
    *[[df]] [options] [resource] report the summary of disk blocks and inodes free and in use
    <TD><B>diff</B> [options] <I>file1 file2</I><TD>compare the two files and display the differences (text files only)<TR>
    *[[du]] [options] [directory or file] report amount of disk space in use
    <TD><B>df</B> [options] [resource]<TD>report the summary of disk blocks and inodes free and in use<TR>
    *[[echo]] [text string] echo the text string to stdout
    <TD><B>du</B> [options] [<I>directory</I> or <I>file</I>]<TD>report amount of disk space in use<TR>
    *[[ed]] or ex [options] file Unix line editors
    <TD><B>echo</B> [text string]<TD>echo the text string to stdout<TR>
    *[[emacs]] [options] file full-screen editor
    <TD><B>ed</B> or <B>ex</B> [options] <I>file</I><TD>Unix line editors<TR>
    *[[expr]] arguments evaluate the arguments. Used to do arithmetic, etc. in the shell.
    *[[file]] [options] file classify the file type
    <TD><B>emacs</B> [options] <I>file</I><TD>full-screen editor<TR>
    <TD><B>expr</B> <I>arguments</I><TD>evaluate the arguments. Used to do arithmetic, etc. in the shell.<TR>
    *[[find]] directory [options] [actions] find files matching a type or pattern
    <TD><B>file</B> [options] <I>file</I><TD>classify the file type<TR>
    *[[finger]] [options] user[@hostname] report information about users on local and remote machines
    <TD><B>find directory</B> [options] [actions]<TD>find files matching a type or pattern<TR>
    *[[ftp]] [options] host transfer file(s) using file transfer protocol
    <TD><B>finger</B> [options] <I>user[@hostname]</I><TD>report information about users on local and remote machines<TR>
    *[[grep]] [options] 'search string' argument
    <TD><B>ftp</B> [options] <I>host</I><TD>transfer file(s) using file transfer protocol<TR>
    *[[egrep]] [options] 'search string' argument
    *[[fgrep]] [options] 'search string' argument, search the argument (in this case probably a file) for all occurrences of the search string, and list them.
    <TD><B>grep</B> [options] 'search string' <I>argument</I><P><B>egrep </B>[options] 'search string' <I>argument</I><P><B>fgrep </B>[options] 'search string' <I>argument</I><TD>search the argument (in this case probably a file) for all occurrences of the search string, and list them. <TR>
    <TD><B>gzip</B> [options] <I>file</I><P><B>gunzip </B>[options] <I>file</I><P><B>zcat </B>[options] <I>file</I><TD>compress or uncompress a file. Compressed files are stored with a .<B>gz</B> ending<TR>
    *[[gzip]] [options] file
    <TD><B>head</B> [-number] <I>file</I><TD>display the first 10 (or number of) lines of a file<TR>
    *[[gunzip]] [options] file
    <TD><B>hostname</B><TD>display or set (super-user only) the name of the current machine<TR>
    *[[zcat]] [options] file, compress or uncompress a file. Compressed files are stored with a .gz ending
    <TD><B>kill</B> [options] [-SIGNAL] [pid#] [%job]<TD>send a signal to the process with the process id number (pid#) or job control number (%n). The default signal is to kill the process.<TR>
    *[[head]] [-number] file display the first 10 (or number of) lines of a file
    <TD><B>ln</B> [options] <I>source_file target</I><TD>link the <I>source_file</I> to the <I>target</I><TR>
    *[[hostname]] display or set (super-user only) the name of the current machine
    <TD><B>lpq</B> [options]<P><B>lpstat<I> </I></B>[options]<TD>show the status of print jobs<TR>
    *[[kill]] [options] [-SIGNAL] [pid#] [%job] send a signal to the process with the process id number (pid#) or job control number (%n). The default signal is to kill the process.
    <TD><B>lpr</B> [options] <I>file</I><P><B>lp<I> </I></B>[options] <I>file</I><TD>print to defined printer<TR>
    *[[ln]] [options] source_file target link the source_file to the target
    <TD><B>lprm</B> [options]<P><B>cancel </B>[options]<TD>remove a print job from the print queue<TR>
    *[[lpq]] [options]
    <TD><B>ls</B> [options] [<I>directory</I> or <I>file</I>]<TD>list <I>directory</I> contents or <I>file</I> permissions<TR>
    *[[lpstat]] [options], show the status of print jobs
    <TD><B>mail</B> [options] [user]<P><B>mailx </B>[options] [user]<P><B>Mail </B>[options] [user]<TD>simple email utility available on Unix systems. Type a period as the first character on a new line to send message out, question mark for help.<TR>
    *[[lpr]] [options] file
    <TD><B>man</B> [options] <I>command</I><TD>show the manual (<B>man</B>) page for a command<TR>
    *[[lp]] [options] file, print to defined printer
    <TD><B>mkdir</B> [options] <I>directory</I><TD>make a <I>directory</I><TR>
    *[[lprm]] [options]
    <TD><B>more</B> [options] <I>file</I><P><B>less </B>[options] <I>file</I><P><B>pg </B>[options] <I>file</I><TD>page through a text file<TR>
    *[[cancel]] [options], remove a print job from the print queue
    <TD><B>mv</B> [options] <I>file1 file2</I><TD>move <I>file1</I> into <I>file2</I><TR>
    *[[ls]] [options] [directory or file] list directory contents or file permissions
    <TD><B>od</B> [options] <I>file</I><TD>octal dump a binary file, in octal, ASCII, hex, decimal, or character mode.<TR>
    *[[mail]] [options] [user]
    <TD><B>passwd</B> [options]<TD>set or change your password<TR>
    *[[mailx]] [options] [user]
    <TD><B>paste</B> [options] <I>file</I><TD>paste field(s) onto the lines in <I>file</I><TR>
    *[[Mail]] [options] [user], simple email utility available on [[Unix]] systems. Type a period as the first character on a new line to send message out, question mark for help.
    *[[man]] [options] command show the manual (man) page for a command
    <TD><B>pr</B> [options] <I>file</I><TD>filter the file and print it on the terminal<TR>
    <TD><B>ps</B> [options]<TD>show status of active processes<TR>
    *[[mkdir]] [options] directory make a directory
    <TD><B>pwd</B><TD>print working (current) directory<TR>
    *[[more]] [options] file
    <TD><B>rcp</B> [options] <I>hostname</I><TD>remotely copy files from this machine to another machine<TR>
    *[[less]] [options] file
    <TD><B>rlogin</B> [options] <I>hostname</I><TD>login remotely to another machine<TR>
    *[[pg]] [options] file page through a text file
    <TD><B>rm</B> [options] <I>file</I><TD>remove (delete) a file or directory (<B>-r </B>recursively deletes the directory and its contents) (<B>-i</B> prompts before removing
    *[[mv]] [options] file1 file2 move file1 into file2
    file<TR>
    *[[od]] [options] file octal dump a binary file, in octal, ASCII, hex, decimal, or character mode.
    <TD><B>rmdir</B> [options] <I>directory</I><TD>remove a <I>directory</I><TR>
    *[[passwd]] [options] set or change your password
    <TD><B>rsh</B> [options] <I>hostname</I><TD>remote shell to run on another machine<TR>
    *[[paste]] [options] file paste field(s) onto the lines in file
    <TD><B>script</B> <I>file</I><TD>saves everything that appears on the screen to file until <B>exit</B> is executed<TR>
    *[[pr]] [options] file filter the file and print it on the terminal
    <TD><B>sed</B> [options] <I>file</I><TD>stream editor for editing files from a script or from the command line<TR>
    *[[ps]] [options] show status of active processes
    <TD><B>sort</B> [options] <I>file</I><TD>sort the lines of the <I>file</I> according to the options chosen<TR>
    *[[pwd]] print working (current) directory
    <TD><B>source</B> <I>file</I><P><B>.</B> <I>file</I><TD>read commands from the <I>file</I> and execute them in the current shell. <B>source</B>: C shell, <B>.</B>: Bourne shell.<TR>
    *[[rcp]] [options] hostname remotely copy files from this machine to another machine
    <TD><B>strings</B> [options] <I>file</I><TD>report any sequence of 4 or more printable characters ending in &lt;NL&gt; or &lt;NULL&gt;. Usually used to search binary files for ASCII strings.<TR>
    *[[rlogin]] [options] hostname login remotely to another machine
    <TD><B>stty</B> [options] <TD>set or display terminal control options<TR>
    *[[rm]] [options] file remove (delete) a file or directory (-r recursively deletes the directory and its contents) (-i prompts before removing files)
    <TD><B>tail</B> [options] <I>file</I><TD>display the last few lines (or parts) of a file<TR>
    *[[rmdir]] [options] directory remove a directory
    <TD><B>tar</B> key[options] [<I>file</I>(s)]<TD>tape archiver--refer to man pages for details on creating, listing, and retrieving from archive files. Tar files can be stored on tape or disk.<TR>
    *[[rsh]] [options] hostname remote shell to run on another machine
    <TD><B>tee</B> [options] <I>file</I><TD>copy stdout to one or more files<TR>
    *[[script]] file saves everything that appears on the screen to file until exit is executed
    <TD><B>telnet</B> [host [port]]<TD>communicate with another host using telnet protocol<TR>
    *[[sed]] [options] file stream editor for editing files from a script or from the command line
    <TD><B>touch</B> [options] [date] <I>file</I><TD>create an empty file, or update the access time of an existing file<TR>
    *[[sort]] [options] file sort the lines of the file according to the options chosen
    <TD><B>tr</B> [options] <I>string1 string2</I><TD>translate the characters in string1 from stdin into those in string2 in stdout<TR>
    *[[source]] file
    <TD><B>uncompress</B> <I>file.Z</I><TD>uncompress <I>file.Z</I> and save it as a file<TR>
    *[[.]] file read commands from the file and execute them in the current shell. source: C shell, .: Bourne shell.
    <TD><B>uniq</B> [options] <I>file</I><TD>remove repeated lines in a file<TR>
    *[[strings]] [options] file report any sequence of 4 or more printable characters ending in <NL> or <NULL>. Usually used to search binary files for ASCII strings.
    <TD><B>uudecode</B> [<I>file</I>]<TD>decode a uuencoded file, recreating the original file <TR>
    *[[stty]] [options] set or display terminal control options
    <TD><B>uuencode</B> [<I>file</I>] <I>new_name</I><TD>encode binary file to 7-bit ASCII, useful when sending via email, to be decoded as new_name at destination<TR>
    *[[tail]] [options] file display the last few lines (or parts) of a file
    <TD><B>vi</B> [options] <I>file</I><TD>visual, full-screen editor<TR>
    *[[tar]] key[options] [file(s)] tape archiver--refer to man pages for details on creating, listing, and retrieving from archive files. Tar files can be stored on tape or disk.
    *[[tee]] [options] file copy stdout to one or more files
    <TD><B>wc</B> [options] [<I>file</I>(s)]<TD>display word (or character or line) count for <I>file</I>(s)<TR>
    <TD><B>whereis</B> [options] <I>command</I><TD>report the binary, source, and man page locations for the command named<TR>
    *[[telnet]] [host [port]] communicate with another host using telnet protocol
    <TD><B>which</B> <I>command</I><TD>reports the path to the command or the shell alias in use <TR>
    *[[touch]] [options] [date] file create an empty file, or update the access time of an existing file
    <TD><B>who</B> or <B>w</B><TD>report who is logged in and what processes are running<TR>
    *[[tr]] [options] string1 string2 translate the characters in string1 from stdin into those in string2 in stdout
    <TD><B>zcat</B> <I>file.Z</I><TD>concatenate (list) uncompressed file to screen, leaving file compressed on disk</TABLE>
    *[[uncompress]] file.Z uncompress file.Z and save it as a file
    *[[uniq]] [options] file remove repeated lines in a file
    *[[uudecode]] [file] decode a uuencoded file, recreating the original file
    *[[uuencode]] [file] new_name encode binary file to 7-bit ASCII, useful when sending via email, to be decoded as new_name at destination
    *[[vi]] [options] file visual, full-screen editor
    *[[wc]] [options] [file(s)] display word (or character or line) count for file(s)
    *[[whereis]] [options] command report the binary, source, and man page locations for the command named
    *[[which]] command reports the path to the command or the shell alias in use
    *[[who]] or w report who is logged in and what processes are running
    *[[zcat]] file.Z concatenate (list) uncompressed file to screen, leaving file compressed on disk


    <tasks>
    [ ] needs wiki formatting,table
    </tasks>

    [[Category:Computer]]
    [[Category:Computer]]
    [[Category:Unix]]
    [[Category:Unix]]

    Revision as of 20:17, 13 August 2006

    Unix

    UnixCommands/Kill

    UnixCommands/Cat

    UnixCommands/Screen

    Compression

    Filters

    Redirection

    Chmod

    ViewFiles

    VIvisualEdit

    SedStreamEditor

    AwkPatternMatching

    SinkFiles


    • ManPages


    Command/Syntax What it will do

    Command/SyntaxWhat it will do
    awk/nawk [options] filescan for patterns in a file and process the results
    cat [options] fileconcatenate (list) a file
    cd [directory]change directory
    chgrp [options] group filechange the group of the file
    chmod [options] filechange file or directory access permissions
    chown [options] owner filechange the ownership of a file; can only be done by the superuser
    chsh (passwd -e/-s) username login_shellchange the user's login shell (often only by the superuser)
    cmp [options] file1 file2compare two files and list where differences occur (text or binary files)
    compress [options] filecompress file and save it as file.Z
    cp [options] file1 file2copy file1 into file2; file2 shouldn't already exist. This command creates or overwrites file2.
    cut (options) [file(s)]cut specified field(s)/character(s) from lines in file(s)
    date [options]report the current date and time
    dd [if=infile] [of=outfile] [operand=value]copy a file, converting between ASCII and EBCDIC or swapping byte order, as specified
    diff [options] file1 file2compare the two files and display the differences (text files only)
    df [options] [resource]report the summary of disk blocks and inodes free and in use
    du [options] [directory or file]report amount of disk space in use
    echo [text string]echo the text string to stdout
    ed or ex [options] fileUnix line editors
    emacs [options] filefull-screen editor
    expr argumentsevaluate the arguments. Used to do arithmetic, etc. in the shell.
    file [options] fileclassify the file type
    find directory [options] [actions]find files matching a type or pattern
    finger [options] user[@hostname]report information about users on local and remote machines
    ftp [options] hosttransfer file(s) using file transfer protocol
    grep [options] 'search string' argument

    egrep [options] 'search string' argument

    fgrep [options] 'search string' argument

    search the argument (in this case probably a file) for all occurrences of the search string, and list them.
    gzip [options] file

    gunzip [options] file

    zcat [options] file

    compress or uncompress a file. Compressed files are stored with a .gz ending
    head [-number] filedisplay the first 10 (or number of) lines of a file
    hostnamedisplay or set (super-user only) the name of the current machine
    kill [options] [-SIGNAL] [pid#] [%job]send a signal to the process with the process id number (pid#) or job control number (%n). The default signal is to kill the process.
    ln [options] source_file targetlink the source_file to the target
    lpq [options]

    lpstat [options]

    show the status of print jobs
    lpr [options] file

    lp [options] file

    print to defined printer
    lprm [options]

    cancel [options]

    remove a print job from the print queue
    ls [options] [directory or file]list directory contents or file permissions
    mail [options] [user]

    mailx [options] [user]

    Mail [options] [user]

    simple email utility available on Unix systems. Type a period as the first character on a new line to send message out, question mark for help.
    man [options] commandshow the manual (man) page for a command
    mkdir [options] directorymake a directory
    more [options] file

    less [options] file

    pg [options] file

    page through a text file
    mv [options] file1 file2move file1 into file2
    od [options] fileoctal dump a binary file, in octal, ASCII, hex, decimal, or character mode.
    passwd [options]set or change your password
    paste [options] filepaste field(s) onto the lines in file
    pr [options] filefilter the file and print it on the terminal
    ps [options]show status of active processes
    pwdprint working (current) directory
    rcp [options] hostnameremotely copy files from this machine to another machine
    rlogin [options] hostnamelogin remotely to another machine
    rm [options] fileremove (delete) a file or directory (-r recursively deletes the directory and its contents) (-i prompts before removing file
    rmdir [options] directoryremove a directory
    rsh [options] hostnameremote shell to run on another machine
    script filesaves everything that appears on the screen to file until exit is executed
    sed [options] filestream editor for editing files from a script or from the command line
    sort [options] filesort the lines of the file according to the options chosen
    source file

    . file

    read commands from the file and execute them in the current shell. source: C shell, .: Bourne shell.
    strings [options] filereport any sequence of 4 or more printable characters ending in <NL> or <NULL>. Usually used to search binary files for ASCII strings.
    stty [options] set or display terminal control options
    tail [options] filedisplay the last few lines (or parts) of a file
    tar key[options] [file(s)]tape archiver--refer to man pages for details on creating, listing, and retrieving from archive files. Tar files can be stored on tape or disk.
    tee [options] filecopy stdout to one or more files
    telnet [host [port]]communicate with another host using telnet protocol
    touch [options] [date] filecreate an empty file, or update the access time of an existing file
    tr [options] string1 string2translate the characters in string1 from stdin into those in string2 in stdout
    uncompress file.Zuncompress file.Z and save it as a file
    uniq [options] fileremove repeated lines in a file
    uudecode [file]decode a uuencoded file, recreating the original file
    uuencode [file] new_nameencode binary file to 7-bit ASCII, useful when sending via email, to be decoded as new_name at destination
    vi [options] filevisual, full-screen editor
    wc [options] [file(s)]display word (or character or line) count for file(s)
    whereis [options] commandreport the binary, source, and man page locations for the command named
    which commandreports the path to the command or the shell alias in use
    who or wreport who is logged in and what processes are running
    zcat file.Zconcatenate (list) uncompressed file to screen, leaving file compressed on disk
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.