Useful Commands in Ubuntu
Useful commands for Ubuntu:
Privileges
sudo command - run command as root
sudo su – change to root shell session
sudo su user – change to user shell session
sudo -k – forget your sudo password for current shell session
gksudo command – run command as root, password prompt using GNOME interface
kdesudo command – run command as root, password prompt using KDE interface
sudo visudo – edit users who can run sudo commands (file: /etc/sudoers)
gksudo nautilus – run Nautilus file manager as root (GNOME)
kdesudo konqueror – root Konqueror file manager as root (KDE)
passwd – change your password
Networking
ifconfig – displays network information
iwconfig – displays network information for wireless
sudo iwlist scan – scan wireless networks
sudo /etc/init.d/networking restart – reset the network
(file) /etc/network/interfaces – manual configuration
ifup interface – bring up the interface
ifdown interface – bring down the interface
Display
sudo /etc/init.d/gdm restart – reset X (Gnome)*
sudo /etc/init.d/kdm restart – reset X (KDE)*
(file) /etc/X11/xorg.conf – show Configuration
sudo dpkg-reconfigure -reconfigure xserver-xorg-phigh - reset configuration X
Ctrl+Alt+Bksp – X display reset if frozen*
Ctrl+Alt+FN – switch to tty N
Ctrl+Alt+F7 – switch back to X display
*will force log-out the current user
Service System
start service – service to start work (Upstart)*
stop service – service to stop working (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 – reset service (SysV)**
runlevel – get current runlevel
*supported only in new Ubuntu systems
**supported in old & new Ubuntu systems
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 rules and
ufw allow port – to allow traffic on port
ufw deny port – port block
ufw deny from ip – ip block
System
lsb_release -a – get the version of Ubuntu
uname -r – get kernel version
uname -a – get all the information kernel
Package Manager
apt-get update – refresh updates available
apt-get upgrade – update all packages
apt-get dist-upgrade – version update
apt-get install pkg – installing pkg
apt-get remove pkg – uninstall pkg
apt-get autoremove – removing packages obsotletos
apt-get -f install – try to fix packages
dpkg –configure -a – try to fix a broken package
dpkg -i pkg.deb – install file pkg.deb
(file) /etc/apt/sources.list – list of repositories APT
Special Packages
ubuntu-desktop – Setting the standard Ubuntu
kubuntu-desktop – KDE Desktop
xubuntu-desktop – desktop XFCE
ubuntu-minimal – core earnings Ubuntu
ubuntu-standard – the standard utilities Ubuntu
ubuntu-restricted-extras – not free, but useful
kubuntu-restricted-extras – ditto KDE
xubuntu-restricted-extras – ditto XFCE
build-essential – packages used to compile
linux-image-generic – latest generic kernel image
linux-headers-generic – latest headlines
Posted by Posted by Ariff Abdullah , on at 10:48 • Labels: geek, L, linux, ubuntu

tqvm..sgt2 berguna..seperti cheat list..