Wednesday, February 20, 2013

Navigation


Know your current working directory

To know about the current directory you are working with, just type pwd (print working directory) and hit enter key. The output is like in the snapshot below.
ImageThis shows that my current working directory is "/home/binod".
So, this shows your current directory. What if , if you want to change your directory? Here goes the solution.

Changing the directory

To change the directory using terminal, type cd <path name>.  The pathname can be Absolute or relative to current working directory. As for example if I have to change my directory to the Desktop from my current working directory, what i have to do is:
Imageso this changed my current working directory to the Desktop.
[Note: if you simply type "cd" and hit enter key, the working directory will changed to "home" directory. (also try "cd  ~" and "cd  /")]
for full details see man page for cd ("type "man cd")


List the directory contents

The command lists the contents of the directory specified by the user. By default, It lists the contents of the current working directory.
To list the directory contents type "ls" in the terminal.Image
for full details see man page for ls ("type "man ls")

Step in to command line


Let's get started.

Note:
All the commands I use here is for the Ubuntu, these commands may or may not work on the other linux distribution.

At first open your terminal emulator, you can start it either by Applications->Accessories->Terminal or by using the shortcut Ctrl+Alt+t. 
When it starts, the text there might be like this:
Image
This is in the format username@machinename:currentdirectory$. 

Now let's start typing some command:
If you type date, it displays the current date. And the output looks like:
Image

Similarly you can use,
cal - to display the calendar
Image

Now, check these commands yourself.
free- to display the free space in the memory(RAM)
df- amount of free space on your disk drives
and many more.

and finally to the end the terminal session you have to type exit and hit enter key.

If you have any problem regarding any command, just type man <command> . It displays the manual page for the command specified.

As for example, to view the manual page of ls(lists the directory contents), just type man ls in the terminal.

Sunday, January 20, 2013

LINUX TERMINAL TUTS


Why Use The Command Line?

Most computer users today are only familiar with the graphical user interface (GUI) and
have been taught by vendors and pundits that the command line interface (CLI) is a
terrifying thing of the past. This is unfortunate, because a good command line interface is
a marvelously expressive way of communicating with a computer in much the same way
the written word is for human beings. It's been said that “graphical user interfaces make
easy tasks easy, while command line interfaces make difficult tasks possible” and this is
still very true today.



Unlike windows , command line in linux has much more power.


screenshot for the terminal in Ubuntu 12.10



Shell, Terminal, Konsole ???????????????????


SHELL

In Linux when we say command line it is actually referring to the shell. The shell is a program (more specifically "command line interpreter") that takes the input from the keyboard and passes to the operating system to perform the specified task. BASH (Bourne Again SHell) ,a GNU project ,is a shell program that all Linux distributions provide. The emulator might vary from one distribution from others. bash is an enhanced replacement for sh, the original Unix shell program written by Steve Bourne.

for further study on shell


TERMINAL
As I've said that shell is a Command Line Interpreter, then how to interact with the shell????? any idea??
The solution for this is the terminal. Actually this is a GUI program which can be controlled by use of pointers. The different terminal emulators available for the Linux are:

GNOME-Terminal for GNOME
Konsole for KDE
and so on...

whatever the names are, they all do the same things.