Saturday, March 28, 2015

From Noob to ubuntu pro terminal commands


The Ubuntu Terminal is very complex and useful tool that all Linux distributions use.
The terminal is more then often a huge barrier for a new Linux user and may be keeping them from effectively using the Linux system.
So many users have been using point and click methods of desktop navigation since MS-DOS. Typing text into a command window can be a bit overwhelming for today’s average user but it shouldn’t be.
Some of the advantages of using the command-line Terminal to accomplish tasks are great.
The speed of using the terminal is a fraction of time that it takes to accomplish the same task graphically.
Once you’ve opened the Terminal with your first click you can type and execute commands faster.

Using Terminal – Ubuntu

Lets get started, there are two ways to get to the terminal one you can open the Dash Home and search for “Terminal” to open it. or you can simply press (CTRL+ALT+T) at the same time and a terminal will pop up for you.
Here is what the Terminal looks like.
Now that you know how to open the terminal here are a few basic commands that will help you on your way to becoming a better Linux user, NOTE: be careful what you do here.

Managing Privileges & Rights to Files and Directories

» chmod — Change Mode
» su — Switch User
» sudo — run command as root
» sudo -r — open a root shell as user
» sudo -r -u user — open a shell as user
» sudo -k — forget sudo passwords
» gksudo — visual sudo dialog (GNOME)
» kdesudo — visual sudo dialog (KDE)
» sudo visudo — edit /etc/sudoers
» gksudo nautilus — root file manager (GNOME)
» dkesudo konqueror — root file manager (KDE)

Movement In The directory

» cd — Change Directory
» pwd — Print Working Directory

Managing Files and Text

» cp — Copy
» ls — List
» mkdir – Make Directory
» mv — Move
» rm — Remove
» grep — Search for Text Strings
» head — Display Start of File
» less — Display Part of File
» more — Display Part of File
» tail — View the End of a File

Managing the Display

» sudo /etc/init.d/gdm restart — restart X and return to login (GNOME)
» sudo /etc/init.d/kdm restart — restart X and return to login (KDE)
» sudo dexconf — reset xorg.conf configuration
» CTRL+ALT+BKSP — restart X display if froxen
» CTRL+ALT+FN — switch to tty N
» CTRL+ALT+F7 — switch back to X display

Managing Packages

» apt-get update — refresh abailable updates
» apt-get upgrade — upgrade all packages
» apt-get dist-upgrade — upgrade with package replacements; upgrade Ubuntu Version
» apt-get install pkgname — install package by name
» apt-get purge pkgname — uninstall package by name
» 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

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 non-free, but useful
» xubuntu-restricted-extras — XFCE non-free, but useful
» build-essential — packages used to compile programs
» linux-image-generic — latest generic kernel image
» linux-headers-generic — latest build headers

Managing 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

Managing System and Program Information

» cal — Calendar
» date — Date


» fsck — File System Check


while holding down ALT and PRINTSCRN type this command with about 1 second between each letter.
» REISUB — Your system will reboot
» lsb-release -a — get Ubuntu version
» uname -r — get kernel version
» uname -a — get all kernel information

Managing Network Connections

» chkconfig — Check Activated Services
» ping — Test Network Connections
» ftp — file Transfer Protocol
» host — Check IP of Domain
» ifconfig — show network information
» iwconfig — show wireless incormation
» sudo iwlist scan — scan for wireless networks
» ifup eth0 — bring interface eth0 online
» ifdown eth0 — disable eth0 interface
» netstat — Display Routing Table
» route — Set Routes
» telnet — Connect to telnet
» traceroute — Display Route

Managing A Firewall

» ufw enable — turn on firewall
» ufw disable — turn off firewall
» ufw default allow — allow all connections by default
» ufw default deny — drop all connections by default
» ufw status — cyrrebt status and rules
» ufw allow port — allow traffic on port
» ufw deny port — block port
» ufw deny from ip — bkicj ip address

Manage Drives and Formats

» mount — Mount a Drive
» umount — Unmount Drive
» fdisk — Format Disk
» dd — Dupliate Disk
» df — Disk Free Space

Managing Users and Groups

» passwd — Create Password
» groupadd — Add a Group
» groupmod — Modify a Group
» chgrp — Change Group
» groupdel — Delete Group


» nautilus — file manager (GNOME)
» dolphin — file manager (KDE)
» konqueror — web browser (KDE)
» kate — text editor (KDE)
» gedit — text editor (GNOME)

Note: you can get more information about a command by using ‘man’ followed by the command you need the info about. This will give you information about the ‘grep’ command
$ man grep

Learn python for fun.The popular blog with questions and answers to the python.Solutions to facebookhackercup,codejam,codechef.The fun way to learn python with me.Building some cool apps.

No comments:

Post a Comment