Getting Started With Linux

One way or another you are sitting in front of a screen that is connected to a computer that is running Linux.You may be working with a graphical user interface(GUI) or a textual interface.If you are working with a GUI, you will need to use a terminal emulator such as xterm, Konsole, or GNOME Terminal, to follow along with the examples in this website.

LOGGING IN

  • #(hash) symbol represent the root user.
  • $(dollar) symbol represent the simple user.
  • There are Six terminals in Linux.: alt+ Ctrl +f1 – GUI and alt+ctrl+f2,3,4,5,6  Command Based or Textual Interface.
  • Press alt+ Ctrl +f2 and log in in a terminal with the user name and password.
  • If you are admin then username will be root.
  • Here we will log in through admin i.e. #(pound) symbol.

Super User Access : While you are logged in the user named root, you are referred to as Superuser or administrator and have extraordinary privileges.

[root@www ~]# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

[root@www ~]# passwd mc712
Changing password for user mc712.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

su : SWITCH USER

[root@www ~]# su mc712
[mc712@www ~]$

 Working With The SHELL

When you log in and working in a textual (nongraphical) environment, and when you are using a terminal emulator in a graphical environment, you are using the shell as a command interpreter. That is , the shell displays a prompt, you are type a command, and the shell executes the command and displays another prompt.

 WHICH SHELL ARE YOU RUNNING ?

You are probably running bash, but you may be running tcsh or another shell such as the Z Shell (zsh).You can identify the shell you are running by using the ps utility.

[root@www ~]# ps
PID TTY TIME CMD
3169 pts/2 00:00:00 bash
3178 pts/2 00:00:00 ps

This command shows tha you are running two utilities or commands: bash and ps.If you are running tcsh, ps will display tcsh instead of bash.If you are running a different shell, ps will display its name.

 CORRECTING MISTAKES

You can correct typing mistakes in several ways: You can erase one character at a time, back up a word at a time, or back up to the beginning of the command line in one step.After you press Enter, it is too late to correct a mistake.

 ERASING A CHARACTER

  • The default erase key is BACKSPACE. If this key does not work, try DELETE or Ctrl +H.
  • DELETING A WORD – Ctrl +w
  • DELETING A LINE – CTRL+U

ABORTING Execution

  • To terminate a program from a character-based display, press the interrupt key Ctrl +c.
  • Ctrl +z for suspends a program.

REPEATING/EDITING COMMAND LINES

  • To repeat a previous command on the command line, press the UP ARROW key, Each time you press UP ARROW, you see an earlier command line.
  • To re execute the displayed command line, press ENTER.
  • Press DOWN ARROW to browse through the command lines in the other direction.
  • The RIGHT and LEFT ARROW keys move the cursor back and forth along the displayed command line.

HELPING COMMAND’s : Where TO FIND DOCUMENTATION

  • Distribution of Linux typically do not come with hardcopy reference manuals.
  • However,its online documentation has always been one of Linux’s strengths.
  • The manual(or man) and info pages have been available via the man and info utilities since early releases of the operating system.

THE –help Option

Most utilities have help option that displays the information about the utility.

[root@www ~]# cat –help
Usage: cat [OPTION]… [FILE]…
Concatenate FILE(s), or standard input, to standard output.

-A, –show-all equivalent to -vET
-b, –number-non-blank number nonempty output lines
-E, –show-ends display $ at end of each line
-n, –number number all output lines
……………………
……………………

[root@www ~]# who –help
Usage: who [OPTION]… [ FILE | ARG1 ARG2 ]
Print information about users who are currently logged in.

-a, –all same as -b -d –login -p -r -t -T -u
-b, –boot time of last system boot
-u, –users list users logged in
–message same as -T
–writable same as -T
–help display this help and exit
–version output version information and exit

man: Displays The SYSTEM MANUAL

The man utility displays manual pages from the system documentation.This documentation is helpful when yoy know which utility you want to use but have forgotten exactly how to use it.

[root@www ~]# man write

WRITE(1) Linux Programmer’s Manual WRITE(1)

NAME
write – send a message to another user

SYNOPSIS
write user [ttyname]

DESCRIPTION

Write allows you to communicate with other users, by copying lines from your terminal to theirs.

When you run the write command, the user you are writing to gets a message of the
form:

Message from yourname@yourhost on yourtty at hh:mm
………………………….
………………………….
info: Displays Information About UTILITIES

The info utility includes a tutorial on itself and documentation on many Linus shells, utilities and programs developed by the GNU Project.

When you see the initial info screen,you can press :

Getting started with Linux

  • h to go through an interactive tutorial an info.
  • ? to list info utilities.
  • SPACE to scroll through the menu of items for which information is available.
  • m followed by the name of the menu item you want to display
  • q to quit.

Different between man and info commands :

  • The info utility displays more complete and up-to-date information on GNU utilities than does man.
  • When a man page displays abbreviated on a utility that is covered by info, the man page refers you to info.
  • The man utility frequently displays the only information available on non-GNU utilities.
  • When info displays information on non-GNU utilities, it is frequently a copy of the man page.

MORE ABOUT LOGGING IN

This section covers what to do if you have a problem logging in, how to use virtual consoles, how to log in remotely, and how to change your password.

WHAT TO DO IF YOU CANNOT LOG IN

When you enter your username and passwor incorrectly, the system displays an error message after you enter both your username and your password.This message indicates that you have enter either the login name or the password incorrectly or that they are not valid.

Some common reasons that login fail are listed here:

  • Log In on THe Right machine
  • Login Name and Password Are Case sensitive
  • Make Sure Your Login Name is valid.

LOGGING OUT

To logout from a character based interface, press ctrl+D or give the command exit in response to the shell prompt.

VIRTUAL CONSOLES or VIRTUAL TERMINALS

When running Linux in a personal computer, you frequently work with the display and keyboard attached to the computer. Using this physical console, you can access as many as 63 virtual consoles (also called virtual Terminals). Some are set up to allow logins, whereas others act as graphical displays.To switch between virtual consoles, hold down the ctrl and Alt keys and press the function key that corresponds to the console you want to view. For example, ctrl-Alt-f5 displays the fifth terminal.

Typically, six virtual consoles are active and have text login sessions running. When you want to use both a character-based interface and a GUI, you can set up a character-based session on the virtual console and a graphical session on another.

CHANGING YOUR PASSWORD

If someone else assigned you a password, it is a good idea to give yourself a new one. A good password is seven or eight characters long and contains a combination of numbers , uppercase and lowercase letters, and punctuation characters.Avoid using control characters such as Ctrl +H because they have a special meaning to the system, making it impossible for you to log in. Do not use names, words from English or other languages, or other familiar words that someone can easily guess.

PROTECT YOUR PASSWORD

  • Do not allow someone to find out your password: Do not put your password in a file that is not encrypted.
  • CHOOSE A PASSWORD that is Difficult to guess.

To change your password , give the command passwd from a command line:

[root@www ~]# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@www ~]# passwd mc712
Changing password for user mc712.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

A password should meet the following criteria to be relatively secure. Only the first item is mandatory.

  • It must be at least six characters long
  • It should not be a word in a dictionary of any language.
  • It should not be the name of a person, place, pet, or other thing that might be discovered easily.
  • It should contain at least two letters and one digit.
  • It should not be your login name, the reverse of your login name.
  • If you are changing you password , the new password should differ from the old one by at least three characters.
  • Changing the case of a character does not make it count as a different character.

ERROR MESSAGE :

  • If you enter wrong password, the system displays an error message :               Sorry, password do not match.
  • If your password is not long enough,the system displays an error message :               BAD PASSWORD: it is too short.
  • When it is too simple,the system displays an error message :                                    BAD PASSWORD: it is too simplistic/systematic.
  • When it is formed from words,the system displays an error message:                          BAD PASSWORD: it is based on a dictionary word.

If you are a simple user and forget your password, superuser can change it and tell you your new password.