-->

Complete Guide on Linux part - 1

9 minute read
Understanding Linux

■ Detecting and preparing hardware—When the Linux system boots up (when you
turn on your computer), it looks at the components on your computer (CPU, hard
drive, network cards, and so on) and loads the software (drivers and modules)
needed to access those particular hardware devices.
■ Managing processes—The operating system must keep track of multiple processes
running at the same time and decide which have access to the CPU and when. The
system also must offer ways of starting, stopping, and changing the status
of processes.
■ Managing memory—RAM and swap space (extended memory) must be allocated to
applications as they need memory. The operating system decides how requests for
memory are handled.
■ Providing user interfaces—An operating system must provide ways of accessing
the system. The fi rst Linux systems were accessed from a command-line interpreter
called a shell. Today, graphical desktop interfaces are commonly available as well.
■ Controlling filesystems—Filesystem structures are built into the operating system
(or loaded as modules). The operating system controls ownership of and access to
the fi les and directories (folders) that the fi lesystems contain.
■ Providing user access and authentication—Creating user accounts and allowing
boundaries to be set between users is a basic feature of Linux. Separate user and
group accounts enable users to control their own fi les and processes.
■ Offering administrative utilities—In Linux, hundreds (perhaps thousands) of
commands and graphical windows are available to do such things as add users,
manage disks, monitor the network, install software, and generally secure and
manage your computer.
■ Starting up services—To use printers, handle log messages, and provide a variety
of system and network services, processes called daemon processes run in the
background, waiting for requests to come in. Many types of services run in Linux.

How Different Is Linux from other Operating systems

In most of os including Mac, Windows they don't allow to do:
■ You cannot see the code used to create the operating system.
■ You, therefore, cannot change the operating system at its most basic levels if it
doesn’t suit your needs—and you can’t use the operating system to build your own
operating system from source code.
■ You cannot check the code to fi nd bugs, explore security vulnerabilities, or simply
learn what that code is doing.
■ You may not be able to easily plug your own software into the operating system if
the creators of that system don’t want to expose the programming interfaces you
need to the outside world.

Linux Desktop environment

Mainly Linux Desktop environment are;

GNOME—GNOME is the default desktop environment for Fedora, Red Hat Enterprise
Linux, and many others. Think of it as a professional desktop environment,
focusing on stability more than fancy effects.

K desktop environment-KDE is probably the second most popular desktop environment for Linux. It has more bells and whistles than GNOME and offers more integrated applications. KDE is also available with Fedora, RHEL, Ubuntu, and many other Linux systems.

Xfce—The Xfce desktop was one of the fi rst lightweight desktop environments.
It is good to use on older or less powerful computers. It is available with RHEL,
Fedora, Ubuntu, and other Linux distributions.

LXDE—The Lightweight X11 Desktop Environment  (LXDE) was designed to be
a fast-performing, energy-saving desktop environment. Often, LXDE is used on less-expensive devices (such as netbook computers) and on live media (such as a live CD or live USB stick). It is the default desktop for the KNOPPIX live CD distribution.Although LXDE is not included with RHEL, you can try it with Fedora or Ubuntu.

GNOME was originally designed to resemble the MAC OS desktop, while KDE was meant
to emulate the Windows desktop environment. Because it is the most popular desktop
environment, and the one most often used in business Linux systems, most desktop
procedures and exercises in this book use the GNOME desktop. Using GNOME, however,
still gives you the choice of several different Linux distributions.

Become Super User
In most Linux systems, the $ and # prompts are preceded by your username, system
name, and current directory name. For example, a login prompt for the user named pi
on a computer named kali with kali/home as the current working directory would
appear as
[pi@kali home]$ 

On terminal $ indicate that command are run by user & # indicate that command are run as root user.In many conditions you require to run command as root user.

Choosing Your Shell

In most Linux systems, your default shell is the bash shell. To find out what your default
login shell is, type the following commands:
$ who m i
$ grep <username> /etc/passwd
Basically $ who am I shows your username & grep command shows definition of your account in /etc/passwd location, your default bash shell is /bin/bash.

It will possible that you have different shell set like ksh, tcsh, csh, sh, dash etc are examples.

Getting Started with Linux

The simplest way to run a command is to type the name of the command from a shell. From
your desktop, open a Terminal window. Then type the following command:

$ date

Typing the date command, with no options or arguments, causes the current day, month,
date, time, time zone, and year to be displayed as just shown. Here are a few other com-
mands you can try:
$ pwd
$ hostname
$ ls

The pwd command shows your current working directory. Typing hostname shows your
computer’s hostname. The ls command lists the fi les and directories in your current direc-
tory. Although many commands can be run by just typing command names, it’s more com-
mon to type more after the command to modify its behavior. The characters and words you
can type after a command are called options and arguments.

Command Syntax
Most of command have one or more options. Options typically have letter, number, words preceded by hyphen (-).

$ ls -l -a -t

In both cases, the ls command is run with the -l (long listing), -a (show hidden dot files), and -t options (list by time).

Some commands include options that are represented by a whole word. To tell a command
to use a whole word as an option, you typically precede it with a double hyphen (--). For
example, to use the help option on many commands, you enter --help on the command
line. Without the double hyphen, the letters h, e, l, and p would be interpreted as separate
options. 

Many commands also accept arguments after certain options are entered or at the end
of the entire command line. An argument is an extra piece of information, such as a fi le-
name, directory, username, device, or other item that tells the command what to act on.
For example, cat /etc/passwd displays the contents of the /etc/passwd file on your
screen. In this case, /etc/passwd is the argument. Usually, you can have as many argu-
ments as you want on the command line, limited only by the total number of characters
allowed on a command line.

Sometimes, an argument is associated with an option. In that case, the argument must immedi-
ately follow the option. With single-letter options, the argument typically follows after a space.For full-word options, the argument often follows an equal sign (=). Here are some examples:

$ ls --hide=voot

In the previous example, the --hide option tells the ls command to not display the fi le or
directory named Desktop when listing the contents of the directory. Notice that the equal
sign immediately follows the option (no space) and then the argument (again, no space).
Here’s an example of a single-letter option that is followed by an argument:

$ tar -cvf backup.tar /home/voot * 
In the tar example just shown, the options say to create (c) a fi le (f) named backup.tar
that includes all the contents of the /home/voot directory and its subdirectories and show verbose messages as the backup is created (v) and * indicate all files including hidden. Because backup.tar is an argument to the f option, backup.tar must immediately follow the option.

Some other commands,
$ uname { OS name options "-a" }
$ ls -a { list all files }
$ date +'%d/%m/%y' { Print date in DD/mm/yyyy format }
$ date +'%A, %B %d, %Y' { print Day & month in Words & print month & year in number }

The ls command, by itself, shows all regular files and directories in the current directory.By adding the -a, you can also see the hidden fi les in the directory (those beginning with a dot). The uname command shows the type of system you are running (Linux). When you add -a, you also can see the hostname, kernel release, and kernel version.

The date command has some special types of options. By itself, date simply prints the
current day, date, and time as shown above. But the date command supports a special + format option, which lets you display the date in different formats. Type date --help to
see different format indicators you can use.

Try the$  id and $ who commands to get a feel for your current Linux environment, as
described in the following paragraphs.

When you log in to a Linux system, Linux views you as having a particular identity, which
includes your username, group name, user ID, and group ID. Linux also keeps track of your
login session: It knows when you logged in, how long you have been idle, and where you
logged in from.

$ id
You can see information about your current login session by using the who command. In
the following example, the -u option says to add information about idle time and the
process ID and -H asks that a header be printed:

$ who -uH

The output from this who command shows that the user chris is logged in on tty1 (which
is the fi rst virtual console on the monitor connected to the computer), and his login session began at 13:08 on August 21. The IDLE time shows how long the shell has been open without any command being typed (the dot indicates that it is currently active). PID shows the process ID of the user’s login shell. COMMENT would show the name of the remote computer the user had logged in from, if that user had logged in from another computer on the network, or the name of the local X display if that user were using a Terminal window (such as :0.0).you are on  linux server then PID comment shows your ip in which you are logged in.


Premium Blogger Templates