Professional Documents
Culture Documents
An Introduction to Linux
-Abhishek Chinnan
What is Linux
• When installing Linux on a PC only “Kernel” is copied and rest all applications are installed on an individual machine.
• Open Source Software means the it permits the users to change and improve the Software and to redistribute the modified and
ummodified forms.
• And its Significant because of the growing popularity and its freely Available.
When programmers on the Internet can read, redistribute, and modify the
source for a piece of software.
People improve it, people adapt it, people fix bugs. And this can happen
at a speed that, compared to conventional software development.
Kernel
The kernel is a program that constitutes the central core of a computer operating
system. It has complete control over everything that occurs in the system.
A kernel can be constrasted or communicates with a shell (such as bash, csh or ksh
in Unix-like operating systems), which is the outermost part of an operating system
and a program that interacts with user commands. The kernel itself does not interact
directly with the user, but rather interacts with the shell and other programs as well as
with the hardware devices on the system, including the processor.
Why is it significant?
Growing popularity
Powerful
• Runs on multiple hardware platforms
• Users like its speed and stability
• No requirement for latest hardware
It’s “free”
• Licensed under GPL
• Vendors are distributors who package Linux
• Fedora
Device Drivers
Boot Loader
In order for the BIOS to load an OS it looks for instructions on the first
sector of a hard drive.
On the first sector of the hard drive resides the master boot record (MBR),
and is where a boot loader is initialized.
Depending on the boot loader, additional files may be stored and read from
a partition on the hard drive.
After this step the boot loader begins to start the operating system, and is
not used again until the next boot.
Shells
A shell provides an interface between the user and the operating system kernel.
- A shell is any program that takes input from the user, translates it into instructions that the
operating system can understand, and conveys the operating system's output back to the user.
Partition Structure
/(root)
/home – All user’s home Directories are stored
/boot – All the Boot Files
/usr – All executable Files
/var – Databases of all services, entire shared information in
the directory
Swap – Virtual memory Management
Command Options
Common Commands
More Commands
who
• List who is currently logged on to the system
whoami
• Report what user you are logged on as
ps
• List your processes on the system
ps aux
• List all the processes on the system
More Commands
grep - Searches files for one or more pattern arguments. It does plain
string, basic regular expression, and extended regular expression
searching
Current Directory
Your shell has a current directory — the directory in which you are
currently working
Commands like ls use the current directory if none is specified
Use the pwd (print working directory) command to see what your current
directory is:
$ pwd
/home/chinnan
Use cd without specifying a path to get back to your home directory
Users are identified by user identifications (UIDs), each of which is associated with an
integer in the range of 0 to 4 294 967 295 (X’FFFFFFFF’). Users with UID=0 are given
superuser privileges.
Users are placed in groups, identified by group identifications (GIDs). Each GID is
associated with an integer in the range from 0 to 4 294 967 295
Let the system assign UID to avoid duplicates
Use id to display your user and group information
File Permissions
-rwxrwxrwx
Other permissions
Group permissions
Owner permissions
Directory flag (d=directory; l=link)
File Permissions
The long version of a file listing (ls -l) will display the file permissions:
Permissions Group
Owner
For internal use
Unique document identifier (ID) / Version number / Life cycle status
22 © Nokia Siemens Networks 2011 Dept. / Author / Date
_Change_Document_Information“ macro.
Process Properties
A process has a user id (uid) and a group id (gid) which together specify
what permissions it has
A process has a parent process id (ppid) — the pid of the process which
created it
The kernel starts an init process with pid 1 at boot-up
Every other process is a descendant of pid 1
Each process has its own working directory, initially inherited from its
parent process
There is an environment for each process — a collection of named
environment variables
Processes
Daemons
• Background processes for system administration are referred to as
“daemons”
• These processes are usually started during the boot process
• The processes are not assigned any terminals
Processes - PID
PID
• A process ID is a unique identifier assigned to a process while it runs
• Each time you run a process, it has a different PID (it takes a long
time for a PID to be reused by the system)
• You can use the PID to track the status of a process with the ps
command or the jobs command, or to end a process with the kill
command
Processes - PPID
PPID
• A process that creates a new process is called a parent process; the new
process is called a child process
• The parent process (PPID) becomes associated with the new child
process when it is created
• The PPID is not used for job control