The Beginner's Guide to the Ubuntu Terminal - Part 1

Article by Josef Nankivell (4,324 pts )
Edited & published by YvetteDavis (2,491 pts ) on Sep 14, 2008

Using the terminal window is often frightening for new Linux users. This fear stands in the way of effectively using Linux desktop to its fullest potential. But, this guide will make you more comfortable with the command line, and allow you to get the most from you Ubuntu system.

Introduction

Many users have been using point and click methods of desktop navigation since MS Windows in the 1980s. The idea of typing text into a command line window is a bit overwhelming for the average computer user, however, once you learn the basics, it's just as easy as the familiar point and click. Today we'll be using the Ubuntu 8.04 desktop, which is available for download here.

Quick and Simple

The advantages of using the command-line terminal to accomplish tasks are endless. Using the terminal allows you to perform any task in a fraction of the time that it takes to accomplish the same task graphically.

Try installing a package using the synaptic package manager. That requires at least six clicks of the mouse, and typing the root password once.

Or you could use the terminal by clicking Applications > Accessories > Terminal. Once you've opened the terminal with your first click you can type sudo apt-get install amarok. Then, enter the root password and that's it.

Your package will be downloaded and installed from the terminal window.

Consistency

From the above, example you can see the difference in speed, but another advantage of using the terminal window is the return you get when something goes wrong.

If you're using the Graphical User Interface (GUI) desktop to accomplish a task and something happens you generally get a one line description, but if you're using the terminal window, you will receive a more in-depth description of your problem.

Yet another advantage to using the command line terminal is the universal element that giving commands holds over using a GUI. As you can see from trying to locate the terminal window, the path to accomplishing a task with the GUI may vary when you're using Ubuntu, Kubuntu, Xubuntu, etc..

While terminal commands aren't always the same in different distributions, you can issue the same commands for all versions of Ubuntu, Kubuntu, Edubuntu, Xubuntu and count on their effectiveness.

If you prefer to point and click instead of typing any commands into the terminal you may find shelter under a few other Linux distributions like Mepis, Linspire and a few others. And this also depends on what you use your computer for. If you play Solitaire and use the Internet to interact with your friends and that's it, it's possible you may never need the terminal window on Ubuntu.

Getting Started

Let's take a look at some very simple commands on the Ubuntu 8.04 Hardy Heron desktop that will allow us to effectively accomplish some small tasks. After you've opened the terminal window you can start typing in the commands. Below is a list of some useful commands and what they are used for.

sudo command – run command as root

apt-get - used to install, remove, upgrade and more.

Movement In The directory

cd - Change Directory

pwd - Print Working Directory

Managing Files and Text

cp - Copy

ls - List

mkdir - Make a new Directory/folder

mv - Move

rm - Remove

grep - Search for Text Strings

head - Display Start of File

less - Display Part of File, a more sophisticated version of more ("less is more"). It can scroll backwards and has more options than more.

more - Display Part of File in a termial, there is no need to start up an editor or word processor

tail - View the End of a File

Managing System and Program Information

cal - Calendar

date - Date

Troubleshooting

fsck - File System Check

Managing Network Connections

chkconfig - Check Activated Services

ping - Test Network Connections

ftp - file Transfer Protocol

host - Check IP of Domain

ifconfig - Configure Network Devices

netstat - Display Routing Table

route - Set Routes

telnet - Connect to telnet

traceroute - Display Route

Manage Drives and Formats

mount - Mount a Drive

umount - Unmount Drive

fdisk - Format Disk

dd - Duplicate Disk

df - Disk Free Space

Managing Rights to Files and Directories

chmod - Change Mode

su - Switch User

Managing Users and Groups

passwd - Create Password

groupadd - Add a Group

groupmod - Modify a Group

chgrp - Change Group

groupdel - Delete Group

Continued

Part 2 will be coming soon, but for now I hope the above information allows you to start to explore the Ubuntu Terminal.

Comments

Jan 4, 2010 5:42 AM
Akaangbough Solomon
running qbasic on ubuntu
i can not run qbasic on ubuntu, i need help on how to do this. the ubuntu version is 9...
Dec 24, 2009 7:46 PM
Tad
apt-get
sudo apt-get = can't find package- no matter if it is right there - - grrrrr
Nov 30, 2009 7:19 PM
Manuel
Thank you
This little guide is very useful for people that dont know how to use the terminal like me
I would really like a second part
:)
Oct 15, 2009 2:35 AM
george
Part 2
When the part 2 out?
Jul 15, 2009 9:13 AM
Patrick san
thnks a lot
Hi josef....
this piece of info was a real good help for a beginner just like me...
continue ur job