Skip to content

Instantly share code, notes, and snippets.

@tecoholic
Created May 24, 2011 08:10
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tecoholic/988309 to your computer and use it in GitHub Desktop.
Save tecoholic/988309 to your computer and use it in GitHub Desktop.
Useful Ubuntu Commands
# Package to install, to get an open terminal in Right-Click context menu.
sudo apt-get install nautilus-open-terminal
# To move window controls in your Ubuntu from left to right…
gconftool-2 --type string --set /apps/metacity/general/button_layout "menu:minimize,maximize,close"
# To switch back
gconftool-2 --type string --set /apps/metacity/general/button_layout "close,maximize,minimize:menu"
# Repeat last command with sudo
sudo !!
# Save changes into the file even if you forgot to open it with sudo (For Command-line Editor VI)
:w !sudo tee %
# Find out Ubuntu version using Command Line
cat /etc/issue
# or
cat /etc/issue.net
# also
lsb_release -a
# or
cat /etc/lsb-release
# Install Nautilus Terminal in ubuntu (A embedded terminal for Nautilus Terminal)
sudo add-apt-repository ppa:flozz/flozz # This is general for adding any PPA ppa:any_repo
sudo apt-get update
sudo apt-get install nautilus-terminal
# Restart nautilus using the following command from your terminal
nautilus -q && nautilus & exit
# Configuring the Gnome Environmet (such as hiding mounted volumes from desktop)
gconf-editor
# Search package name and description available through apt-get using related keyword (or) package name
apt-cache search keyword
# A multi-utility command-line file downloader
wget <url>
# To login as Super User and execute a series of commands
sudo su -
# Series of commands to setup LAMP
sudo su -
apt-get install mysql-server mysql-client # Enter password at prompt
apt-get install apache2 # Visit http://localhost/ to test
apt-get install php5 libapache2-mod-php5
/etc/init.d/apache2 restart # To restart apache after PHP installation
vim /var/www/info.php # create a php test file with <?php phpinfo(); ?> and visit http://localhost/info.php
# List all the devices using USB protocol in your system [Useful to detect Bluetooth & Wireless]
lsusb
# Know the address of your bluetooth device
hcitool dev
# List all running process with their PID
ps -e
# PID of a specific process
pidof process
# Kill a struck/hanging application
kill xxxx # where xxxx id the PID identified in above two commands
# Looking for packages for our whims and fancies
# Searching:
apt-cache search svg.*png # where svg.*png is the search term for svg to png converter
# Looking up package details:
apt-cache show package-name
# Installation - should I document?
# List the commands to call the program associated with a package
dpkg -L package-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment