Important Commands


Here's a short list of handy Unix commands that you'll use all the time. The apropos and man commands may be the most important to remember, because those are your gateways into the man pages, Unix's standard online help files. Please note that the italicized letters below are just placeholders. You will, of course, use your own file name instead. I used x to represent one file, a and b to represent two different files, and d to indicate a directory.

  • apropos x

    Search for commands whose keywords match the specified keyword, x.

  • cat x

    Print the contents of the specified file(s) to the terminal.

  • cd d

    Change to the specified directory, d.

  • cp a b

    Copy file a to b. If b is a directory, the new file will be named b/a.

  • echo x

    Print x to the terminal. If x is surrounded by double quotes (echo "x"), the text is printed with any environment variables or other shortcuts expanded. If x is surrounded by single quotes (echo 'x'), the text is printed without any special processing, exactly as it appears in the echo command.

  • emacs x

    Start the EMACS text editor and load the specified file.

  • head x

    Display the first ten lines of the specified file.

  • less x

    Display the specified file(s) one screen at a time. Press the spacebar to advance to the next screen. Press Q to quit. This is like the more command but better. On some systems, less and more actually point to the same file ("less is more").

  • ls

    List the files in the current directory.

  • man x

    Look up the specified command in the online manual.

  • more x

    Like the less command, but not as nice. Use this if less isn't available.

  • ps

    Display information about your running programs.

  • pwd

    Print the current working directory.

  • sort

    Sort its input lines and print them.

  • stty sane

    The stty command configures your terminal settings; its sane option resets everything to reasonable defaults.

  • tail x

    Display the last ten lines of the specified file.

  • tee x

    Copy its input to the specified file, and then print it onscreen.

  • vi x

    Start the vi text editor and load the specified file(s).



    Unix Advanced. Visual QuickPro Guide
    Unix Advanced: Visual QuickPro Guide
    ISBN: 0321205499
    EAN: 2147483647
    Year: 2003
    Pages: 116

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net