Using Terminal – Ubuntu

Using Terminal - Ubuntu 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.

user@distogeeks:~$
 
 
 
 
 
 

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

 

Troubleshooting

» fsck — File System Check

 

System

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

 

Applications

» 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

 

Please, feel free to rate this post or comment below.

 

External Links

  • Ubuntu Wiki: http://ubuntuguide.org/wiki/Ubuntu:Quantal#Introduction
  • Documentation: https://help.ubuntu.com/community/UsingTheTerminal

  • pulkit

    there is something wrong with my terminal. whenever i make a file and write a program, the backspace does not work and neither do the scroll keys. on pressing the up key, A is displayed and B,C,D are similarly displayed on pressing the left, right and down keys respectively. please help. thank you.

    • $37421872

      well from what it sounds like you are
      saying it is an issue but it could be one of many so a few things I
      would check first is…
      1. there may be an issue with your
      keyboard (hardware) <- try a different keyboard, perhaps you have
      a sticky key or simply warn out keyboard.
      2. there may be an issue
      with the keyboard settings (software) <- check your keyboard
      setting and make sure your keyboard has been detected properly and in
      your language.
      3. and i know its a little extreme but perhaps a
      fresh install of the system, ya I know thats the fix all answer but
      if you just want to get the problem fixed and don't want to read half
      the Internet to figure out the problem, sometimes its just faster to
      reinstall, I would reinstall things a little at time to be sure as
      not to recreate the issue again and if so you may have an idea of
      possible software issues that may be causing an issue.

      Hope
      this helps…..

  • lezdefez

    i have programs that are windows based, have installed wine, but dont know how to use terminal to install from usb. could you help?

    • $37421872

      I think it may be easier then that, you need to add the plugged in usb as a drive to the list of drive for wine to use. then you can access the usb threw wine when installing your programs.

      this may help. https://help.ubuntu.com/community/Wine

  • Pingback: Basic Ubuntu Command (Terminal) in Ubuntu » Muhammad Yusro

  • xxxx

    alert(“Hello”);