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 download and convert youtube videos and other media the easy wayHow to play Quicktime videos and other Media with Totem

Comments

Anonymous Thursday, January 8, 2009 11:32:09 PM

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 Wednesday, January 14, 2009 9:18:41 PM

Anonymous writes: same here thanks for the visuals and the codes

Anonymous Tuesday, February 17, 2009 10:23:12 PM

Anonymous writes: very nice thank you.

Anonymous Thursday, February 19, 2009 12:22:25 PM

Anonymous writes: THANKS!!! Really usefull guide!

Anonymous Saturday, March 28, 2009 3:13:52 PM

Microcock windows writes: Thanks we appreciated this our young community :monkey:

Anonymous Sunday, March 29, 2009 1:45:00 PM

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 ☠ubuntunerd1 Sunday, March 29, 2009 5:54:34 PM

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 Saturday, May 9, 2009 7:39:57 PM

dincmetal1952 writes: very nice thank you.

Chris Pennersloppyc Saturday, May 9, 2009 8:25:41 PM

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 ☠ubuntunerd1 Saturday, May 9, 2009 8:50:48 PM

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 Saturday, May 9, 2009 10:23:36 PM

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

Anonymous Monday, June 22, 2009 4:23:04 AM

Giggolo writes: Good stuff thanks

Anonymous Tuesday, July 28, 2009 7:09:14 AM

Anonymous writes: Good guide for newbs like myself.

Anonymous Tuesday, July 28, 2009 7:09:31 AM

Anonymous writes: Good guide for newbs like myself.

Anonymous Tuesday, July 28, 2009 7:11:13 AM

Anonymous writes: Great for newbs like myself

Isaac_C_Brysonmynightshade Saturday, September 5, 2009 2:35:12 PM

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 Thursday, December 10, 2009 3:35:48 PM

sajad writes: I like that. Good guide for newbs

Anonymous Monday, February 8, 2010 8:56:36 AM

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

Anonymous Thursday, May 5, 2011 11:35:11 AM

Anonymous writes: Thanks. Here there are more, that can be run from Alt+F2: http://ubuntuforums.org/showthread.php?t=1656060 The ones not present above: eog : Eye of GNOME (image viewer) file-roller : File Roller (archive manager) gcalctool : gcalctool (calculator) gconf-editor : Configuration Editor (user preferences and system configuration data editor for the GNOME Desktop and many applications) gnome-control-center : GNOME Control Center (control panel) gnome-search-tool : Search for Files (file searcher) gnome-session-save –logout-dialog : “Log Out of the Session” dialog (to finish or close the session; or to switch or change the user) gnome-session-save –shutdown-dialog : “Shut Down the Computer” dialog (to turn the computer off, reboot it, suspend it or hibernate it) gnome-terminal : GNOME Terminal (terminal emulator) gucharmap or gnome-character-map : GNOME Character Map setxkbmap xx : change the keyboard layout (xx can be it or gb or es or fr …) totem : Totem (movie player; also plays audios) xcalc : xcalc (calculator) xset dpms force off : turns the screen off (useful for laptops) xterm : xterm (terminal emulator)

Anonymous Thursday, May 5, 2011 2:07:56 PM

Anonymous writes: NB: from the run dialog (Alt+F2) we can also type the address of a folder so Nautilus opens in that place. For example if we enter /etc Nautilus opens in this directory. There is no need to type nautilus.

Anonymous Wednesday, August 3, 2011 12:46:00 PM

Anonymous writes: hi friends...i am a new user of ubuntu11.04 version...i installed it with in the windows7...when i am writing c program in "vi editor"" some keys are not working( e.g. direction arrows and backspace)..how to overcome this problem...please help me

Anonymous Sunday, September 4, 2011 3:12:47 PM

akash writes: hi friends, i want to interface a java application with any hardware device such as webcam in ubuntu plaform how can i do that.. plz help me out.....

Anonymous Saturday, November 12, 2011 7:05:20 AM

ishak writes: hi,, i am a fresher in linux n i wanna to learn its. completely .. sure its very...very gud command line .. but if u can send me more usefull terminal guide plz. send me my id ishak@girnarsoft.com thanx,

Anonymous Tuesday, December 27, 2011 6:30:00 PM

Anonymous writes: 2 more: onboard : onscreen keyboard onboard-settings : configure Onboard

Anonymous Thursday, January 19, 2012 10:52:47 AM

Anonymous writes: revija denar investicija

Anonymous Monday, February 6, 2012 5:50:18 AM

Anonymous writes: naložbeno zavarovanje finport

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