Quick List of Debian Linux Commands
Shutdown Computer
shutdown -r now restart the computer
shutdown -h now shutdown the computer
Switch to Root User
su
exit = go back to normal user
Install Programs
apt-get update updates the package list
apt-get upgrade upgrades the packages that are installed
apt-get install [package name]
apt-get remove [package name]
apt-get –purge remove (permanently deletes package)
dpkg -l lists all installed packages
Install Programs From Source Code
cd /tmp/
wget http://some-url.com/download/some-program.tar.gz
tar xvfz some-program.tar.gz
cd some-program/
./configure
make
make install
Add Users
adduser [username]
addgroup [groupname]
Add user to Group
adduser [username] [groupname]
Change Password
passwd [username] = set system password
smbpasswd [username] = set samba password
smbpasswd -a [username] = add new samba user
File Manipulation
mv = move
rm = delete
rm -r [foldername] = delete folder
ls = dir list
ls -l = long list – shows permissions
ls -a = list all files
cd = change directory
cd .. = back 1 directory
nano = open with text editor
cp -Rp [source] [destination] = copy
PWD = present working directory
How to list out the size of each file and directory (recursively) and sort by size decending:
du -a -h –max-depth=1 | sort -hr
File Permissions
chmod
Check Free Disk Space
df
Create Simlinks / Symlinks / Symbolic Links
ln -s [path] [link name]
remove the link (deleting runs the risk of deleting the target folder as well so be careful – unlink is safe)
unlink [link name]
Help Manual
man [command you want help with]
Shutdown all Services
telinit 1
Backup Files with TAR
tar –cpf /path/filename.tar /foldername1 /foldername2
Set a root MySQL password
mysqladmin -u root password yourrootsqlpassword
Check Free Memory (Check RAM Usage)
free -m – shows free memory
ps aux – shows amount of RAM that each process is using
Check Free Disk Space
df – disk free
du – disk used
Detect Hardware
modconf – automatically detect hardware
you can also add a module entry to /etc/modules to make it load on start-up
example: add pcnet32 to /etc/modules to make it load the AMD network driver for VMware
you could load it manually by using modprobe pcnet32 but it wouldn’t load on start-up
Comments are currently closed.