You are on page 1of 2

Configuration Important Shell Commands APT

/etc/ All system configuration files cat files Print files to screen. apt-get update Update packages listings from
are under directory /etc/. cd directory Change to directory. package repositories as listed
nano files Default text editor. If not cp files dest Copy files and directories. in /etc/apt/sources.list.
present, try emacs, vi, joe. echo string Echo string to screen. Run, if the contents of one of
webmin at https:// Browser interface to system gzip, bzip2 [- Compress, uncompress files. repositories, the file changed,
hostname:10000 configuration, access is defined d]files or if unsure.
in /etc/webmin/miniserv. less files Show contents of files. apt-cache search Search packages and
conf. ls [files] List files. search-string descriptions for
CUPS at http:// Browser interface to printing mkdir Create directories. search-string.
hostname:631 system. directory-names apt-cache policy Show versions and priorities of
dpkg-reconfigure Reconfigure a package, e.g. mv file1 file2 Move, rename files. package-names available packages.
package-name console-common (keyboard), rm files Remove files. apt-cache show Show package information incl.
locales (localisation). rmdir dirs Remove empty directories. package-names description.
update-alternatives Manage command alternatives. tar [c][x][t][z][j] -f Create, eXtract, list Table of apt-cache showpkg Show package dependencies
options file .tar [files] archive file, z, j for .gz, .bz2. package-names (needed packages).
update-grub After installing a new kernel. find directories Find files like -name name or - apt-get install Install packages from
make-kpkg --initrd Build a kernel packages from expressions size +1000, etc. package-names repositories with all
--revision=2:my.1.0 sources, if a customised kernel grep search-string Find search-string in files. dependencies.
--rootcmd fakeroot is really needed, needs kernel- files apt-get upgrade Install newest versions of all
--uc --us kernel_ package. kill [-9]number Send signal to process (e.g. packages currently installed.
image terminate it). apt-get dist-upgrade Like apt-get upgrade, but
m-a a-i module Create and install third-party ln -s file link Create a symbolic link to a file. with advanced conflict
kernel_image modules (nvidia, ...), needs ps [options] Show current processes. resolution.
module-assistant. su - [username] Become another user, e.g. apt-get remove Remove packages with all
Daemons and System root. package-names needed packages.
/etc/init.d/file Restart a service, system sudo command Execute a command as root as apt-cache depends List all packages needed by the
restart daemon. normal user, see /etc/sudoers package-names given.
/etc/init.d/file Stop a service, system daemon. command >file Overwrite file with output of apt-cache rdepends List all packages that need the
stop command. package-names given.
/etc/init.d/file Start a service, system command >>file Append output of command to apt-file update Update content listings from
start daemon. file. package repositories, see
halt, reboot, Halts, reboots, shuts down cmd1 |cmd2 Use output of command 1 as apt-get update
poweroff system. input of command 2. apt-file search Search packages for file.
/var/log/ All log files are under this command <file Use file as input for command. file-name
directory. apt-file list List contents of a package.
/etc/default/ Default values for many package-name
daemons and services. auto-apt Installs packages automatically
if needed, can replace apt-file,
needs auto-apt.
aptitude Console interface to APT,
needs aptitude.
synaptic GUI interface to APT, needs
synaptic.
Dpkg Database (PostgreSQL)
dpkg -l [names] List packages. createdb Create a new database.
dpkg -I pkg.deb Show package information. dropdb Remove a database.
dpkg -c pkg.deb List contents of package file. createuser Create a new database user. Debian GNU/Linux Reference Card
Version 3.1-0.2, 2005-09-03
dpkg -S filename Show which package a file dropuser Remove a database user.
http://www.debian.org/
belongs to. /etc/postgresql/ Client access configuration.
dpkg -i pkg.deb Install package files. pg_hba.conf Getting Help
deborphan Show packages, on that no ALTER USER name Change the password in the man page or man Read online help for every
other packages depend WITH PASSWORD SQL console psql. bash command and many
(orphans), needs deborphan. ’password’; configuration files.
debsums Audit check sums of installed command [--help, -h] Brief help for most commands.
File and Print Server (Samba)
packages, needs debsums. /usr/share/doc/ Find all documentation here,
/etc/samba/smb. Main configuration file.
dpkg-divert Override a package’s version of [package-name/] optional file README.Debian
conf
[options]file a file. contains specifics.
smbclient Browse SMB network
dpkg --compare- Compare version numbers, Web documentation Reference, manuals, FAQs,
resources, e.g. download,
versionsv1 gt v2 check with echo $?. HOWTOs, etc. at http://
upload files.
dpkg-query -W -- Query installed packages, www.debian.org/doc/
showformat=format format e.g. ’${Package} Mailing lists at The community is always
${Version} http://lists. helpful, search for users.
${Installed-Size}\n’. debian.org/
dpkg --get- Write package selections to file. Installation
selections > file Installer All information about it at
dpkg --set- Set package selections from file. http://www.debian.org/
selections < file devel/debian-installer/
The Network CD images Download from http://www.
/sbin/ifconfig Configure network interfaces. debian.org/distrib/
/etc/network/ Network configuration files, boot: expert E.g. to set up the network w/o
most relevant are interfaces DHCP or using LILO instead
and options. of GRUB.
ifup, ifdown Start, stop network interfaces boot: linux26 or Use Linux kernel 2.6 for
[device] according to files above. boot: expert26 installation.
ssh -X user@host Login at other machine. Bugs
scp files Copy files to other machine Bug Tracking at All about existing and fixed
user@host:path (and vice versa). http://bugs. bugs.
debian.org/
Web Server (Apache2)
Package specific See http://bugs.debian.
/etc/apache2/ Configuration files. Legal Notice org/package-name/, use wnpp
/etc/apache2/ Defines default virtual host. This document may be used under the terms the GNU Gen- to ask for new packages.
sites-enabled/ eral Public License version 2 or higher. Conditions for copying
reportbug Report a bug by e-mail.
default and translations can be found at http://people.debian.org/
Reporting Instructions at http://www.
/etc/apache2/ Contains available modules ~debacle/refcard/, where you can always get the latest ver-
sion of the reference card. debian.org/Bugs/Reporting
mods-available/ files. To enable a module,
create a symbolic link into / c 2004 W. Borgert
Copyright
etc/apache2/mods-enabled/. Made by: http://people.debian.org/~debacle/refcard/