Ted's Linux Command Reference Ubuntu/Debian Version October 21, 2009 (b) Copyright (C) 2009-2011, Ted Felix See license info at the bottom. Latest version can always be found here: http://www.tedfelix.com/linux/debian-command-reference.txt Help man Online manual. Try "man mount" to get the manual page for the mount command. Also try "man 1 intro" to see the introduction for section 1 of the manual. See info. info Like man, an online manual. Just type info to find out what's available. Sometimes the "info" manual (if it exists) is better than the "man" manual so always try both. A good example is "info wget" which is far more detailed than "man wget". Note, however, that the GFDL conflicts with the DFSG, so in Debian, many info pages are missing. whatis Displays a one-line description of a command. Gives the title from the man page. See apropos. apropos Searches the whatis database on both command name and man page title. Use this if you aren't sure of the command name. Try "apropos sound". See whatis. help (bash) Similar to man and info, but gives help on a bash built-in command. Try "help", "help cd", and "help for". man2html [man2html package] If you get sick of man, grab the man page from /usr/man, "gzip -d" it, then run man2html on it and view it in html. Good for really huge man files like gcc's. xman (X) A GUI version of man. A bit clunky, but it works. Good for browsing entire sections of the manual. * additional documentation Most distros have additional documentation on the first CD or DVD. Also check /usr/share/doc. Getting Started passwd Change your password. exit Logs you out. Ctrl-D works too. sudo Run a command as root. For sudo to work, the user issuing sudo must be in "/etc/sudoers" (e.g. "userid ALL = ALL"). man sudoers for more. If you want to use pipes, use this syntax: sudo sh -c "dmesg | less" See sudoedit. sudoedit Edit a file as root. Uses the editor in your EDITOR environment variable. Allows editing of files owned by root when you aren't root. See sudo. whereis Searches a list of typical system directories (e.g. /bin, /sbin, /etc, ...) for a filename. "whereis libm" will find the math library. "whereis ls" will find the location of the ls command. See "which" and "locate". Alt-Ctrl-F1, Alt-Ctrl-F2, Alt-Ctrl-F3... Switches between pseudo-terminals. Note that you can also switch with just Alt-F1, Alt-F2, etc... However, when in X, Alt and Ctrl are required. X is usually running on tty7, so Alt-F7 will bring you back to X. chsh Change your login shell. (If you prefer csh, ksh, zsh, or something else.) Package Utilities synaptic GUI package installer. Most package installation tasks can be accomplished with synaptic. See "apt*". debram [debram package] Package classification system. Makes it easier to find packages by category. debtags [debtags package] Package classification system. Makes it easier to find packages by category. apt* Package utilities. (See synaptic.) Examples: apt-get update - updates the package database apt-cache show - shows information about a package apt-get install - installs a package by name apt-get source - gets source to current directory apt-get build-dep - installs build dependencies for source dpkg Low-level package utility. Some examples: dpkg --print-avail - shows info about an installed package dpkg --search /bin/ls - finds the installed package with "ls" dpkg --listfiles coreutils - lists files in an installed package dpkg -i package.deb - installs a .deb package dpkg -c package.deb - lists the contents of a .deb package aptitude [aptitude package] Package installer with an ncurses UI. Command line is similar to the apt* commands. apt-file [apt-file package] An interesting utility for finding out which package has a specific file even when the package isn't installed. I've not had good luck getting this to work. File Utilities (simple) ls list files in a directory. Some useful options: -l give details such as sizes and dates -a show all files including hidden ones -t sort by date/time -r sort in reverse order Try "ls -lrt". Also try "vdir". tree [tree package] Like "ls", but shows the directory structure in a colored tree diagram. cd change to another directory pwd displays the current directory mkdir Make a directory. mv Move or rename files. rename Rename a batch of files based on a pattern. cp Copy files. rm Delete a file. rmdir Delete a directory that is empty. cat Copies a file to the display. less A file pager for displaying large files a page at a time. Better than "more" as you can page up and down. Try "less /etc/passwd" or "ps aux | less". most [most package] Like less, but can split the view into multiple windows. Try "Ctrl-X 2". more A file pager. See "less". pg Another pager like less and more. which Finds a command's location in the path. See whereis and locate. type (bash) tells you where a command will be run from. Similar to which, but indicates whether the command is hashed or built-in. mc [mc package] Midnight Commander. Console file manager. pilot [pilot package] Pilot. Console file manager. Text Editors gedit (GNOME) Default GNOME editor. Includes code highlighting. nano [nano package] Very easy to use console editor. Uses Ctrl keys for functions. Function reminders always on bottom of screen. pico Use this if nano isn't available. This is like nano but with fewer features. In Debian/Ubuntu, pico is actually a link to nano. emacs The "Edit MACroS" editor. vi The "VIsual editor". In Debian/Ubuntu this is vim. vim A version of "vi". VI iMproved. vimtutor [vim-runtime package] Tutorial on vim and vi. ed A line editor like DOS's EDLIN. X Applications xcalc Calculator. Also try "gnome-calculator". xterm Console window. Also try "gnome-terminal". xmag Screen magnifier. Miscellaneous factor Prime factors. shuf Generate random permutations. Shuffle. mkpasswd [makepasswd package] makes random passwords cal [bsdmainutils package] Perpetual calendar. Also try "calendar", a reminder program. cycle [cycle package] A calendar for women. gnuplot [gnuplot package] Mathematical plotting program. At the "gnuplot>" prompt, try "plot sin(x)". If it doesn't work, make sure the entire "gnuplot" package is installed, not just gnuplot-nox. wnb [wordnet package] Offline English dictionary (no Internet connection required). gnucash [gnucash package] Accounting software. calc [apcalc package] Arbitrary precision command line calculator. Very easy to use. yacas [yacas package] Computer Algebra System. Does symbolic math. kstars [kstars] Astronomy software. Shows the night sky. This is a KDE application, but it works ok in GNOME. sc [sc package] Console spreadsheet application. Press ? for help. Audio Utilities sox [sox, libsox-fmt-all packages] Audio manipulation utility. Unfortunately, the Debian version is limited due to licensing issues. It's best to build this yourself, but there are many dependencies. flac [flac package] FLAC codec. Lossless audio compression. Patent-free. lame MP3 codec. Due to patent issues, this usually needs to be downloaded separately, built, and installed. oggenc [vorbis-tools package] Ogg Vorbis encoder. Ogg is similar to MP3 but without patent issues. normalize [normalize-audio package?] Normalizes audio files so that the loudest point is as loud as possible. sound-juicer [sound-juicer package] CD ripper. easytag [easytag package] MP3 file tagger. User Management adduser Interactive add user script. Uses "useradd" to do its work. Found in /usr/sbin. See sudo. passwd Change your password. whoami Displays your user id. logname Displays your user id. su Become root. To be safe, use "sudo" or "sudoedit" instead. groups Display groups you currently belong to. id Display user id, group id, and groups. useradd Add a user. See the more friendly adduser script. gpasswd Manage groups. newgrp Log in to a new group. See "sg". sg Run a command as member of another group. groupadd Add a group. Also check out groupdel and groupmod. last Show a list of login events. Note that the list is in reverse chrono order, so the newest are at the top. "lastb" shows only the bad login attempts. users Show users currently logged in. Also try "rusers" in the rusers package. who Show users currently logged in along with some statistics. Also try "rwho" in the rwho package. w Show users currently logged in along with lots of statistics. lastlog Displays the last login date/time for all users. File Utilities (advanced) chown Change owner and group of a file. chmod Change permimssions on a file. tail Displays the end of a file. Use the -f option to follow a file as it is being written to. Great for watching log files. See tailf. tailf Like "tail -f" but more efficient. head Displays the beginning of a file. wc Displays a line count, word count, and byte count for a file. grep Searches files for a string. grep hello *.txt Or recursively: grep -r --include='*.c' --include='*.h' '#define' . See cscope. rpl [rpl package] Global search and replace. look [bsdmainutils package] Performs a binary search on a sorted file for a value at the beginning of each line. gpg OpenPGP encryption. cmp Binary file compare. diff Text file compare. diff3 Three-way file compare. sdiff Shows a side-by-side diff of two files. patch Applies a patch (from diff) to a file or files. patch -p1