Some useful commands

Getting help

man

Display the manual page for the given command. (Another option is the man: kioslave in Konqueror.)

man ls

apropos

Search for manual pages containing the given term.

apropos apache

Basic filesystem usage

ls

List the contents of a directory.

ls -l

cd

Change current working directory (with no arguments, change to home directory).

cd /mnt

less

Display the given file (or stdin if no filename given).

ls -la | less

cat

Concatenate several files to stdout (also useful for printing out a single file).

cat /etc/fstab

mv

Move or rename a file or files.

rm

Delete a file or files.

rm test.o

ln

Create symbolic or hard links to a file.

ln -s ../files/test.html index.html

mc

Midnight Commander is a text-based file manager with built-in text editor (mcedit) and viewer, particularly useful when connecting via SSH.

Permissions

chmod

Change the permission bits ('mode') of a file or files.

chmod go+rx my_script

chown

Change the owner of a file or files.

chgrp

Change the group of a file. chown can also do this, in a slightly different way.

Filesystem

df

List disk usage on some or all filesystems.

df -h

du

Find size of all files under the given directory.

du -sh /bin

mount

Mount a filesystem. If the filesystem is listed in /etc/fstab then either the device or the mount point alone is sufficient, otherwise both must be given (along with any other options).

mount /media/cdrom

Package management

apt-get

One interface to Debian's powerful package manager.

apt-get update && apt-get upgrade

apt-cache

Query the database of installed and available packages.

apt-cache show apache2

dpkg-reconfigure

When some packages are installed, they will ask you for some options through a system called debconf. dpkg-reconfigure can be used to change these debconf settings for an installed package.

dpkg-reconfigure exim4

Miscellaneous

env

List all environment variables.

2005-08-13T11:30:06