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

You might also like