Useful Commands in (Linux)

A comprehensive list of commands needed when using Ubuntu:

Command privileges.
root@penreturns:~$ sudo command - run command as root
root@penreturns:~$ sudo su – root shell open
root@penreturns:~$ sudo su user – open shell as a user
root@penreturns:~$ sudo -k – forget your password sudo
root@penreturns:~$ gksudo command – sudo visual dialog (GNOME)
root@penreturns:~$ kdesudo command – sudo visual dialog (KDE)
root@penreturns:~$ sudo visudo – edit / etc / sudoers
root@penreturns:~$ gksudo nautilus – root file manager (GNOME)
root@penreturns:~$ kdesudo konqueror – root file manager (KDE)
root@penreturns:~$ passwd – change your password

Command Network.
root@penreturns:~$ ifconfig – displays information network
root@penreturns:~$ iwconfig – displays information from wireless
root@penreturns:~$ sudo iwlist scan – scan wireless networks
root@penreturns:~$ sudo /etc/init.d/networking restart – reset the network
root@penreturns:~$ (file) /etc/network/interfaces – manual configuration
root@penreturns:~$ ifup interface – bring online interface
root@penreturns:~$ ifdown interface – disable interface

Commands Display
root@penreturns:~$ sudo /etc/init.d/gdm restart – reset X (Gnome)
root@penreturns:~$ sudo /etc/init.d/kdm restart – reset X (KDE)
root@penreturns:~$ (file) /etc/X11/xorg.conf – show Configuration
root@penreturns:~$ 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

Commands Service System.
root@penreturns:~$ start service – service to start work (Upstart)
root@penreturns:~$ stop service – service to stop working (Upstart)
root@penreturns:~$ status service – check if service is running (Upstart)
root@penreturns:~$ /etc/init.d/service start – start service (SysV)
root@penreturns:~$ /etc/init.d/service stop – stop service (SysV)
root@penreturns:~$ /etc/init.d/service status – check service (SysV)
root@penreturns:~$ /etc/init.d/service restart – reset service (SysV)
root@penreturns:~$ runlevel – get current runlevel

Commands for Firewall.
root@penreturns:~$ ufw enable – turn on the firewall
root@penreturns:~$ ufw disable – turn off the firewall
root@penreturns:~$ ufw default allow – allow all connections by default
root@penreturns:~$ ufw default deny – drop all connections by default
root@penreturns:~$ ufw status – current rules and
root@penreturns:~$ ufw allow port – to allow traffic on port
root@penreturns:~$ ufw deny port – port block
root@penreturns:~$ ufw deny from ip – ip block

Command System.
root@penreturns:~$ lsb_release -a – get the version of Ubuntu
root@penreturns:~$ uname -r – get kernel version
root@penreturns:~$ uname -a – get all the information kernel

Commands for Package Manager.
root@penreturns:~$ sudo apt-get update – refresh updates available
root@penreturns:~$ sudo apt-get upgrade – update all packages
root@penreturns:~$ sudo apt-get dist-upgrade – version update
root@penreturns:~$ sudo apt-get install pkg – installing pkg
root@penreturns:~$ sudo apt-get remove pkg – uninstall pkg
root@penreturns:~$ sudo apt-get autoremove – removing packages obsotletos
root@penreturns:~$ sudo apt-get -f install – try to fix packages
root@penreturns:~$ dpkg –configure -a – try to fix a broken package
root@penreturns:~$ dpkg -i pkg.deb – install file pkg.deb
root@penreturns:~$ (file) /etc/apt/sources.list – list of repositories APT

Special Packages For commands.
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

Applications commands.
nautilus – File Manager (GNOME)
dolphin – File Manager (KDE)
konqueror – Web browser (KDE)
kate – text editor (KDE)
gedit – text editor (GNOME)

*copy code without root@penreturns:~$

Reply to this post

Post a Comment