A list of commonly used commands

There are a lot of commands and programs in the shell, but chances are you'll never use many of them. Beyond that, each command has a number of switches and options that can be used to change its functionality. To find out what they are and how to use the command, follow the command with a -help or -? or precede the command with man. So if you wanted to find out what all of the options are for the command cdrecord you would type one of the following:

man cdrecord

cdrecord -help

cdrecord -?

Some programs and commands precede the help and ? switches with two dashes instead of one, so try both. If you're using the KDE desktop environment, you can also use the manual in the KDE Help section, which can be found in the K menu. Below is only a listing of the most commonly used CLI commands and what they do. Refer to this partial list only when you're looking for the right command for the right job - do not indiscriminately execute commands in this list, as you can easily harm the operating system by doing so. If you only know the first few letters of a command or directory, press the Tab key to complete their names for you.

cd (changes directory)

chgrp (changes the group permissions of file/folder)

chroot (changes the root directory)

chmod (changes file permissions)

chown (changes the ownership of the file from one user to another)

configure (makes configuration file for compiling from source)

cp (command for copying files from one place to another)

dmesg (displays kernel messages from startup)

emacs (GNU text editor, installed by default on many distros)

exit (exits Super User mode, can also close the terminal)

free (current state of memory resources)

fsck (file system checker; repair tool)

grep (searches files for a given string)

kill (changes running processes; default action closes processes)

ls (lists all files in dir)

less (types a text file on the screen)

mount (mounts a disk or CD and associates it with a directory)

netstat (displays network status)

depmod (rebuilds kernel module tables)

kerneld (manage kernel modules)

rm (deletes files)

df (list disk free space)

fromdos (convert DOS files to Linux files)

fdisk (partition utility)

fsck (file system check)

halt (alternative shutdown now command)

hdparm (hard drive adjustment utility)

insmod (install module)

lsmod (list modules)

lprm (removes print job from the print spool)

ldconfig (reloads the system path)

make (compiles a program using the configure settings)

make install (installs necessary components into proper dirs)

make mrproper (clears all kernel settings and configurations)

make menuconfig (graphical menu for kernel configuration)

mke2fs (EXT2 filesystem format)

mke2fs -j (EXT3 filesystem format)

mkreiserfs (ReiserFS filesystem format)

mkisofs (creates an ISO image)

mkxfs (XFS filesystem format)

| more (when typed after a command, pauses terminal output after each screen)

mkdosfs (make a FAT16 file system)

modprobe (query module)

mount (connects filesystems to current filesystem structure)

mv (move)

mkdir (make directory)

nano (a simple text editor that some distros install by default)

pico (text editor much like nano, installed by default on some distros)

ps -aux (shows all processes)

reboot (reboots the computer)

rm (removes a file)

rmdir (removes an empty directory)

rmmod (removes module)

swapon (sets swap partition)

ssh (secure shell protocol; encrypted communication suite)

shutdown (shuts down the computer)

strace (trace system calls)

su (superuser/root/admin mode)

startx (launches X window system)

telnet (unencrypted communication protocol)

top (command line system monitor)

xload (display system load info)

xkill (ends a process)

vi (a complex text editor that most distros have)

whereis (finds files)

who and rwho and fwhois (lists information for current users)

A list of common configuration files and their uses

Here's a list of the most common configuration files that you'll be working with in GNU/Linux. Their locations may vary slightly between distributions:

/etc/fstab (defines file systems and mount points for drives)

/etc/X11/xorg.conf (the X server configuration file)

/etc/lilo.conf (if you use the LILO boot loader, this is your configuration file)

/boot/grub/grub.conf (if you use the GRUB boot loader, this is your config file)

/etc/make.conf (specifies switches and flags for compiling programs)

/etc/inetd (configures things like finger, telnet, ftp, etc.)

/etc/resolv.conf (configures the local domain name and your DNS server IPs for your ISP)

/etc/hosts (sets the domain name and local host address for your system)

/etc/syslog.conf (configures the system event logger)

/etc/wvdial.conf (dialup ISP settings if you use dialup Internet access and if you are using wvdial to connect)

~/.bashrc (hidden file in home directory that lists conditions for each user's shell)

Shell scripting

A shell script is a text file with a list of CLI commands to be performed in order. If you're familiar with DOS, this is much like a batch file. Creating a shell script is easy; simply open a text editor and type in the commands that you want the script to execute, then save and exit the editor. Next, give it executable permissions by typing this in:

chmod +x yourscriptname

where yourscriptname is the name of your script. Alternately you can use this command (both do the same thing):

chmod 755 yourscriptname

There is, of course, much more to it than this, but shell scripting is not something that you have to learn. It is, however, something that you should be aware of because it's possible that you'll have to edit a shell script at some point in your GNU/Linux adventures.