Skip navigation.

Commands you can use in Ubuntu☃

Helpful Commands and Codes

Install Opera web browser: just click the picture
Download Opera, the fastest and most secure browser
How to install flash under firefox

sudo apt-get install flashplugin-nonfree



Install Java plugin to run java applications copy and paste this in a terminal:
sudo apt-get install sun-java6-fonts sun-java6-jre sun-java6-plugin


Medibuntu Repository for Hardy Heron
Medibuntu is a repository of packages packed with goodies that cannot be included into the Ubuntu distribution for legal reasons

in a terminal type this code:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list --output-document=/etc/apt/sources.list.d/medibuntu.list


then add the Key code:
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update



Rhythmbox extra Visualization also works with Totem movie player

just run this command in a terminal:
sudo apt-get install libvisual-0.4-plugins


COMMANDS

Privileges

sudo command - run command as root
sudo su - open a root shell
sudo su user - open a shell as user
sudo -k - forget sudo passwords
gksudo command - visual sudo dialog (GNOME)
kdesudo command - visual sudo dialog (KDE)
sudo visudo - edit /etc/sudoers
gksudo nautilus - root file manager (GNOME)
kdesudo konqueror - root file manager (KDE)
passwd - change your password



Display

sudo /etc/init.d/gdm restart - restart X (GNOME)
sudo /etc/init.d/kdm restart - restart X (KDE)
(file) /etc/X11/xorg.conf - display configuration
sudo dpkg-reconfigure -phigh xserver-xorg - reset X configuration
Ctrl+Alt+Bksp - restart X display if frozen
Ctrl+Alt+FN - switch to tty N
Ctrl+Alt+F7 - switch back to X display

This command will usually tell you the vendor and model of your graphic card
list
lspci
lspci -v
lspci -v | less

System Services

start service - start job service (Upstart)
stop service - stop job service (Upstart)
status service - check if service is running (Upstart)
/etc/init.d/service start - start service (SysV)
/etc/init.d/service stop - stop service (SysV)
/etc/init.d/service status - check service (SysV)
/etc/init.d/service restart - restart service (SysV)
runlevel - get current runlevel



Package Management

apt-get update - refresh available updates
apt-get upgrade - upgrade all packages
apt-get dist-upgrade - upgrade Ubuntu version
apt-get install pkg - install pkg
apt-get remove pkg - uninstall pkg
apt-get autoremove - remove obsolete packages
apt-get -f install - try to fix broken packages
dpkg –configure -a - try to fix broken packages
dpkg -i pkg.deb - install file pkg.deb
(file) /etc/apt/sources.list - APT repository list



Network

ifconfig - show network information
iwconfig - show wireless information
sudo iwlist scan - scan for wireless networks
sudo /etc/init.d/networking restart - reset network
(file) /etc/network/interfaces - manual configuration
ifup interface - bring interface online
ifdown interface - disable interface



Special Packages

ubuntu-desktop - standard Ubuntu environment
kubuntu-desktop - KDE desktop
xubuntu-desktop - XFCE desktop
ubuntu-minimal - core Ubuntu utilities
ubuntu-standard - standard Ubuntu utilities
ubuntu-restricted-extras - non-free, but useful
kubuntu-restricted-extras - KDE of the above
xubuntu-restricted-extras - XFCE of the above
build-essential - packages used to compile programs
linux-image-generic - latest generic kernel image
linux-headers-generic - latest build headers



Firewall

ufw enable - turn on the firewall
ufw disable - turn off the firewall
ufw default allow - allow all connections by default
ufw default deny - drop all connections by default
ufw status - current status and rules
ufw allow port - allow traffic on port
ufw deny port - block port
ufw deny from ip - block ip adress



Application Names

nautilus - file manager (GNOME)
dolphin - file manager (KDE)
konqueror - web browser/filemanager (KDE)
kate - text editor (KDE)
gedit - text editor (GNOME)



System

Recovery - Type the phrase “REISUB” while
holding down Alt and SysRq (PrintScrn) with
about 1 second between each letter. Your system
will reboot.
lsb_release -a - get Ubuntu version
uname -r - get kernel version
uname -a - get all kernel information


Moving around in the file system

pwd "Print working directory" - show what dir you're in.
ls -List the contents of a dir.
ls -l -List the contents of a dir and show additional info of the files.
ls -a -List all files, including hidden files.
cd -Change directory.
cd .. -Go to the parent directory.


Manipulating files and directories

cp -Copy a file.
cp -i -Copy a file and ask before overwriting.
cp -r -Copy a directory with its contents.
mv -Move or rename a file.
mv -i -Move or rename a file and ask before overwriting.
rm -Remove a file.
rm -r -Remove a directory with its contents.
rm -i -Ask before removing a file. Good to use with the -r option.
mkdir -Make a directory.
rmdir -Remove an empty directory.


zipping/taring

tar -cvzf mytar.tar.gz sourcefilesordir - creates a new tar file, verbose options on, runs it through gnuzip,f is the filename
tar -xvf mytar.tar.gz destination - extracts a tar file (this example is compressed with gzip), verbosely, f is the filename
gzip fileordir - compresses a file with gzip.
gunzip file.gz - decompresses a file with gzip.
NB gzip only compresses files, it doesn’t collect them into a single file like a tarball does.



More Commands

Arrow Up: scrolls and edits the command history, press enter to activate.
Shift+pgup: scrolls terminal output up
Shift+pgdown: scrolls terminal output down
CTRL-ALT+DEL reboots the system
Shutdown -h now turns the system off
CTRL C kills the current process
CTRL S Stops the tranfer to the terminal
CTRL Q Resumes the transfer to the terminal
CTRL Z Puts the current process in the background.


hostname - Shows the host name of the system you are on
whoami Displays your login name
date - Displays what your machine thinks the date is
who - Shows who is logged into the machine
rwho-a -Shows all users logged into the server network
finger <user name> Shows info on chosen user
last - Show the last users logged into the machine
uptime - Shows the systems uptime
PS - Shows the current user processes
PS -A - Shows all process on the system
uname -A -Displays all info on your host.
free -Shows the free memory in KB
df -h -Shows the disk space details
cat/proc/cpuinfo -Shows the CPU information
cat/proc/filesystems -Shows the file system information in use
cat/etc/printcap -Shows if any printers are hooked up
lsmod -Shows the kernel modules loaded


Malicious Commands You Should (NOT USE) unless you know what you're doing.

This commands will erase your hard drive:
sudo mkfs (This will format your hard drive)
sudo mkfs.ext3 (This will format your hard drive)
sudo mkfs.bfs (This will format your hard drive)
sudo mkfs.cramfs (This will format your hard drive)
sudo mkfs.ext2 (This will format your hard drive)
sudo mkfs.minix (This will format your hard drive)
sudo mkfs.msdos (This will format your hard drive)
sudo mkfs.reiserfs (This will format your hard drive)
sudo mkfs.vfat (This will format your hard drive)

This commands can damage your operating system.

sudo rm -rf / (This will delete all your files on your system)
sudo rm -rf * (This will delete all the files in the current folder)
rm -rf * or rm -rf *.* (This will delete all the files in the current folder)
rm -rf ~/ & (This will destroy your home directory)

more commands:
here
how to use the terminal:
here

How to install Compiz Fusion in Ubuntu ☜How to upgrade from Ubuntu 8.04 (Hardy Heron) to Ubuntu 8.10 (Intrepid Ibex)

Comments

Anonymous 8. January 2009, 23:32

Anonymous writes:

thanks for the tip on the rhythmbox extra Visualization I was sure there were more out there I just didn't know how to find it untill I read this post.

Anonymous 14. January 2009, 21:18

Anonymous writes:

same here thanks for the visuals and the codes

Anonymous 17. February 2009, 22:23

Anonymous writes:

very nice thank you.

Anonymous 19. February 2009, 12:22

Anonymous writes:

THANKS!!! Really usefull guide!

Anonymous 28. March 2009, 15:13

Microcock windows writes:

Thanks we appreciated this our young community :monkey:

Anonymous 29. March 2009, 13:45

Anonymous writes:

I want to write my own Command Line Interface in Ubuntu using Java but before that I want to know how these commands are implemented.

Ubuntunerd ☠ 29. March 2009, 17:54

what you mean how their are implemented?
the best way to find out is to install Ubuntu or any other distros for that matter and just try it out.

Anonymous 9. May 2009, 19:39

dincmetal1952 writes:

very nice thank you.

Chris Penner 9. May 2009, 20:25

sudo aptitude install ubuntu-restricted-extras

(or sub 'apt-get' for 'aptitude')


This will get you Java, Flash, MS fonts, multimedia codecs, and a variety of other useful tools all in one command.

Ubuntunerd ☠ 9. May 2009, 20:50

you're right i should include it in this guide, I do have it on this one: http://my.opera.com/ubuntunerd1/blog/how-to-play-quicktime-videos-and-other-media-with-totem

Anonymous 9. May 2009, 22:23

Anonymous writes:

I am waiting for commands (WTF, calling it codes?) that are actually Ubuntu-specific.

Anonymous 22. June 2009, 04:23

Giggolo writes:

Good stuff thanks

Anonymous 28. July 2009, 07:09

Anonymous writes:

Good guide for newbs like myself.

Anonymous 28. July 2009, 07:09

Anonymous writes:

Good guide for newbs like myself.

Anonymous 28. July 2009, 07:11

Anonymous writes:

Great for newbs like myself

Isaac_C_Bryson 5. September 2009, 14:35

I am a newbie with Linux, I love it so far, and I have been looking for info like this all over. Linux.com has given me most info so far but this is great. Thank You so much. Any additional info would be great. Stay real man. Thanks again.

Anonymous 10. December 2009, 15:35

sajad writes:

I like that.
Good guide for newbs

Anonymous 8. February 2010, 08:56

prasanth writes:

Hi, iam not get inter faces like (eth 0)in pandira fms 3.0
what should i do

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

Download Opera, the fastest and most secure browser