Although you learn the basics of using Ubuntu in this book, you need time and practice to master and troubleshoot more complex aspects of the Linux operating system and your distribution. As with any operating system, you can expect to encounter some problems or perplexing questions as you continue to work with Linux. The first place to turn for help with these issues is the documentation included with your system; if you cannot find the information you need there, check Ubuntu’s website.
Linux, like UNIX, is a self-documenting system, with man pages accessible through the man command. Linux offers many other helpful commands for accessing its documentation. You can use the apropos command (for example, with a keyword such as partition) to find commands related to partitioning, like this:
matthew@seymour:~$ apropos partition addpart (8) - Simple wrapper around the "add partition" ioctl all-swaps (7) - Event signaling that all swap partitions have been ac... cfdisk (8) - Curses/slang based disk partition table manipulator fo... delpart (8) - Simple wrapper around the "del partition" ioctl fdisk (8) - Partition table manipulator for Linux gparted (8) - Gnome partition editor for manipulating disk partitions. Mpartition (1) - Partition an MSDOS hard disk Partprobe (8) - Inform the OS of partition table changes Partx (8) - Telling the kernel about presence and numbering of on-... Pvcreate (8) - Initialize a disk or partition for use by LVM Pvresize (8) - Resize a disk or partition in use by LVM2 Sfdisk (8) - Partition table manipulator for Linux
To find a command and its documentation, you can use the whereis command. For example, if you are looking for the fdisk command, you can do this:
$ whereis fdisk fdisk: /sbin/fdisk /usr/share/man/man8/fdisk.8.gz
Using Man Pages
To learn more about a command or program, use the man command followed by the name of the command. Man pages are stored in places like /usr/share/man and /usr/local/share/man, but you don’t need to know that. To read a man page, such as the one for the rm command, use the man command like this:
matthew@seymour:~$ man rm
After you press Enter, the less command (a Linux command known as a pager) displays the man page. The less command is a text browser you can use to scroll forward and backward (even sideways) through the document to learn more about the command. Type the letter h to get help, use the forward slash (/) to enter a search string, or press q to quit.
The following programs and built-in shell commands are commonly used when working at the command line. These commands are organized by category to help you understand the command’s purpose. If you need to find full information for using the command, you can find that information under the command’s man page.
- Managing users and groups—chage, chfn, chsh, edquota, gpasswd, groupadd, groupdel, groupmod, groups, mkpasswd, newgrp, newusers, passwd, umask, useradd, userdel, usermod
- Managing files and file systems—cat, cd, chattr, chmod, chown, compress, cp, dd, fdisk, find, gzip, ln, mkdir, mksfs, mount, mv, rm, rmdir, rpm, sort, swapon, swapoff, tar, touch, umount, uncompress, uniq, unzip, zip
- Managing running programs—bg, fg, kill, killall, nice, ps, pstree, renice, top, watch
- Getting information—apropos, cal, cat, cmp, date, diff, df, dir, dmesg, du, env, file, free, grep, head, info, last, less, locate, ls, lsattr, man, more, pinfo, ps, pwd, stat, strings, tac, tail, top, uname, uptime, vdir, vmstat, w, wc, whatis, whereis, which, who, whoami
- Console text editors—ed, jed, joe, mcedit, nano, red, sed, vim
- Console Internet and network commands—bing, elm, ftp, host, hostname, ifconfig, links, lynx, mail, mutt, ncftp, netconfig, netstat, pine, ping, pump, rdate, route, scp, sftp, ssh, tcpdump, traceroute, whois, wire-test