first step with shell

by

hey
after my mate DidoooFidooo made the installation post i think we’re ready to start dealing with the system

we’ll deal with the system using “shell” most of the time

so what is “Shell”?

it is a program that takes your commands and gives it to the Operating System to deal with them

in the past … the shell was the only user interface .. but nowadays .. we have Graphical User Interfaces (GUI) in addition to Command Line Interfaces (CLI)

i know i know … you may say “why shell … it’s boring”

ok lets see Why Bother With Shell?!

i’ve copied few lines from http://linuxcommands.org

Why do you need to learn the command line anyway? Well, let me tell you a story. Not long ago we had a problem where I used to work. There was a shared drive on one of our file servers that kept getting full. I won’t mention that this legacy operating system did not support user quotas; that’s another story. But the server kept getting full and stopping people from working. One of the software engineers in our company spent the better part of a day writing a C++ program that would look through the directories of all the users and add up the space they were using and make a listing of the results. Since I was forced to use the legacy OS while I was on the job, I installed a version of the bash shell that works on it. When I heard about the problem, I realized I could do all the work this engineer had done with this single line:

du -s * | sort -nr > $HOME/space_report.txt

Graphical user interfaces (GUIs) are helpful for many tasks, but they are not good for all tasks. I have long felt that most computers today do not use electricity. They instead seem to be powered by the “pumping” motion of the mouse! Computers were supposed to free us from manual labor, but how many times have you performed some task you felt sure the computer should be able to do? You ended up doing the work by tediously working the mouse. Pointing and clicking, pointing and clicking.

I once heard an author remark that when you are a child you use a computer by looking at the pictures. When you grow up, you learn to read and write. Welcome to Computer Literacy 101.

Advantages of Shell:

  • More powerful than the GUI
  • requires a modest memory
  • the shell deals directly with the kernel
  • gives you more options to use with the system

that’s only little things to mention about shell

Shell Types:

There is a lot of types of shell:

  • bash Bourne-again shell (GNU)
  • csh C shell (BSD)
  • jsh Job control shell (SVR4)
  • ksh Korn shell (Bell Labs)
  • rc Plan 9 shell (Bell Labs)
  • rsh Remote shell (TCP/IP)
  • sh Bourne shell (UNIX 7th Edition)
  • tcsh Popular extension of the C shell
  • zsh Popular extension of the Korn shell

in linux we will use bash it’s very powerful smart one
read more about bash
now where we can find bash?!
first i would like to say that each shell have two types so bash have two types

  • login shell” means that you should be logged in using a username and password from the shell
  • nonlogin shell” the one we found at the GUI and it means that you just login with the user from the GUI then when you open the shell it automatically uses this user

we will use the login one

how to start it?
after the system is loaded and you get the login screen
press Ctrl+Alt+F1 through F6 those all are login shells … and F7 gets you back to the GUI

each one of these shells called “Terminal TYpe” or TTY … so when i say switch to TTY5 … this means press Alt+Ctrl+F5

now we will use any one from F1–>F6 they are the same
you will have some thing like that
localhost login:
so we will type the user name we will use the root
then you will get
password:
we type the password of the root
NOTE: the password won’t be displayed even in * so don’t worry just write it
now you’ll see some thing like that
root@localhost ~: #
that one calles the prompt. let’s see what does this prompt consist of
root: the user name you logged in with
localhost: the name of your machine
~: that means that you are at your home directory and it’s the working directory “will be explained later”
#: that means that you are logged in with root user ” the system admin”
if you are not logged in with the root you will have “$” instead of “#

Commands Architecture:

commands have an architecture
<command> <option> <parameters>

well, lets explain these things:

command: the command we will use
option: that makes the command makes more specified things
parameters: the file or the directory even the remote machine we are doing the command on it

Some Commands:

now let’s do our first commands

you’ll only have to type the Green-Colored words to type the command:

#date that shows the date of the day

#cal that one shows the calender of the month

#pwd prints the working directory which means where am i in the system

#ls this command lists the files at the directory where you are
this was just some thing to get familiar with the shell
we will continue in the next posts to be more active with the shell using more commands
the next post we will talk about the commands that deals with the files and directories
if there is any thing not clear you’re welcomed to write your notes

Thanks

Peace

Leave a comment