Common Commands

Mount a USB disk:

mount -t vfat /dev/sdb1 /mnt/myusbkey

UnTAR and unGZIP a file:

tar xzvf somefile.tar.gz

Tar

tar -cf archive.tar myDirectories/

Listing the contents of an archive

tar -tf archive.tar

Update system packages with apt-get:

apt-get update
apt-get upgrade
apt-get dist-upgrade

More on apt-get

Add Startup Script:

cp *script* /etc/init.d/
chmod +x /etc/init.d/*script*
update-rc.d *script* defaults

Simplify runlevels with “sysv-rc-conf”

PHP Cron Job

crontab -e
10 * * * * /usr/bin/wget -O - -q http://domain.com/myfile.php
10 * * * * /usr/local/bin/php -q /htdocs/www/myfile.php

Cron every 1 minute

*/1 * * * * /path/to/command

Display last 10 lines containing ‘client denied’ in error_log

grep "client denied" error_log | tail -n 10 

Ubuntu Install Options

sudo tasksel

Configure X:

sudo dpkg-reconfigure xserver-xorg

connect an SMB / CIFS Share

mount -t cifs -o username=user,password=pass,workgroup=domain "//hostname/share$" /home/sharemount/

Configure apache2 mods

sudo a2enmod ssl

Search apt for perl module, containing ‘dang’

apt-cache search perl | grep dang

http://www.linuxguide.it/linux_commands_line_en.htm

Leave a Reply