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 xSearch for commands whose keywords match the specified keyword, x.
- cat xPrint the contents of the specified file(s) to the terminal.
- cd dChange to the specified directory, d.
- cp a bCopy file a to b. If b is a directory, the new file will be named b/a.
- echo xPrint 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 xStart the EMACS text editor and load the specified file.
- head xDisplay the first ten lines of the specified file.
- less xDisplay 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").
- lsList the files in the current directory.
- man xLook up the specified command in the online manual.
- more xLike the less command, but not as nice. Use this if less isn't available.
- psDisplay information about your running programs.
- pwdPrint the current working directory.
- sortSort its input lines and print them.
- stty saneThe stty command configures your terminal settings; its sane option resets everything to reasonable defaults.
- tail xDisplay the last ten lines of the specified file.
- tee xCopy its input to the specified file, and then print it onscreen.
- vi xStart the vi text editor and load the specified file(s).
|