ten essential unix commands

Upload: patrick-teodoro

Post on 03-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Ten Essential Unix Commands

    1/5

    Ten ESSENTIAL UNIX Commands

    These are ten commands that you really need to know in order to get started with UNIX. They are

    probably similar to commands you already know for another operating system.

    Command Example Description

    1. ls lsls -alF

    ists files in current directoryist in long format

    !. cd cd tempdir

    cd ..

    cd "dhyatt#web-docs

    $hange directory to tempdir

    %o&e back one directory

    %o&e into dhyatt's web-docs directory

    (. mkdir mkdir graphics %ake a directory called graphics

    ). rmdir rmdir emptydir *emo&e directory +must be empty,

    . cp cp file1 web-docs

    cp file1 file1.bak

    $opy file into directory

    %ake backup of file1

    . rm rm file1.bak

    rm /.tmp

    *emo&e or delete file

    *emo&e all file

    0. mv m& old.html new.html %o&e or rename files

    . more more inde2.html ook at file3 one page at a time

    4. lpr lpr inde2.html 5end file to printer

    16. man man ls 7nline manual +help, about command

    Ten VALUABLE UNIX Commands

    7nce you ha&e mastered the basic UNIX commands3 these will be 8uite &aluable in managing

    your own account.

  • 8/12/2019 Ten Essential Unix Commands

    2/5

    Command Example Description

    1. grep str!"iles! grep 9bad word9 / Find which files contain a certain word

    !. c#mod opt!

    "ile!

    chmod )) /.html

    chmod 0 file.e2e

    $hange file permissions read only

    $hange file permissions to e2ecutable

    (. pass$d passwd $hange passwd

    ). ps opt! ps au2

    ps au2 % grep dhyatt

    ist all running processes by :I;

    ist process :I;'s running by dhyatt

    . kill opt! ID! kill -4 )(

  • 8/12/2019 Ten Essential Unix Commands

    3/5

    Command Example Description

    1. $#o who ists who is logged on your machine

    !. "inger finger ists who is on computers in the lab

    (. ,talk

    )ser.place!

    ytalk

    dhyatt?threat

    Talk online with dhyatt who is on threat

    ). #istor, history ists commands you'&e done recently

    . "ort)ne fortune Arint random humerous message

    . date date Arint out current date

    0. cal mo! ,r! cal 4 !666 Arint calendar for 5eptember !666

    . xe,es 2eyes B

  • 8/12/2019 Ten Essential Unix Commands

    4/5

    ). gimp gimp B *un photoshop type program

    . ispell "name! ispell file1 5pell check file1

    . latex "name! late2 file.te2 *un aTeX3 a scientific document tool

    0. xemacs + pico 2emacs +or pico, ;ifferent editors

    . so""ice soffice B *un 5tar7ffice3 a full word processor

    4. m1tools &mdir2 mcop,2

    mdel2 m"ormat2 etc3 (

    mdir aD

    mcopy file1 aD

    ;75 commands from UNIX +dir ED,

    $opy file1 to ED

    16. gn)plot gnuplot Alot data graphically

    Ten USE-UL UNIX Commands4

    These ten commands are useful for monitoring system access3 or simplifying your own

    en&ironment.

    Command Example Description

    1. d" df 5ee how much free disk space

    !. d) du -b subdir stimate disk usage of directory in Gytes

    (. alias alias llsH9ls -alF9 $reate new command 9lls9 for long format of ls

    ). x#ost 2host = [email protected]

    2host -

    Aermit window to display from 2-window

    program from threat

    Ellow no 2-window access from other systems

    . "old fold -s file1 % lpr Fold or break long lines at 6 characters andsend to printer

    . tar tar -cf subdir.tar subdir

    tar -2&f subdir.tar

    $reate an archi&e called subdir.tar of a directory

    2tract files from an archi&e file

  • 8/12/2019 Ten Essential Unix Commands

    5/5

    0. g#ostvie$

    &gv(

    g& filename.ps iew a Aostscript file

    . ping

    &tracero)te(

    ping [email protected]

    traceroutewww.yahoo.com

    5ee if machine is ali&e

    Arint data path to a machine

    4. top top Arint system usage and top resource hogs

    16. logo)t &exit( logout or e2it Jow to 8uit a UNIX shell.