Friday, 21 February 2014

Basic Linux Commands for Beginners


              Linux Operating system


Linux is a operating system.It is the software in which the system makes the application to access or control the devices on the computer to perform some required functions.It reveals the Instructions from an application to a processor of a computer. Then the processor receives the information and performs the related tasks to be done and send the result back to the application via operating system.It is the leading operating system on the servers

The Main objective of the Linux is free and the open source software which can be modified and distributed to some of the components of Linux system like boot loader,init and software libraries.

Boot loader : 

 

A Boot loader is a set of code that runs before any operating system is running. It is the hardware that executes after the hardware's BIOS completes its start up tests.

Init :

Init is a process control initialization .It is the parent of the all processes .The role of Init is create process from script stored in a file 

 

Important Directories in Linux OS :


/bin : 

These are executable Binary files.The directories contains the commands and utilities day by day.It is available for all the users.

/mnt :

This directory provides a location for mounting devices,such as a remote File system and the removable media.

/home : 

The user home directories are stored.

/var : 

It is used to store the files which change and must be available to be written frequently.

/etc :

The various system configuration files are stored here.

/dev :

It contains the various devices as Files . (e.g) Hard disk,CD-ROM drive,etc

/root : 

It is the root users home diretory.

/tmp : 

It is used to store the temporary files.

/usr : 

It contains the user documentation,games,graphical files and libraries,etc

 

Basic commands used in the Linux operating system :


Man Command : 

man -           format and display the on-line manual pages
manpath -    determine user's search path for man pages 

 
Grep Command :

The Grep command is used to search a particular text or a line containing a match for a particular string

syntax :

$ grep -i “hello” file_name

It prints the matched line.

$ grep -A 3 -i “hello” file_name

Search for a a given string in all files recursively

$ grep -r “kumar” *

mkdir Command :

The mkdir command creates one or more new directories specified by the dirctory parameter.

mkdir Creates the directory temp
Syntax :

mkdir [ -m Mode ] [ -p ] Directory

-m → Sets the permission bits for a newly created to the value specified by the mode variable.
-p → creates mission intermediate path name directories.

Directories :

Pwd command :

Shows the directory which you are in

cd  ->   Change directories
             Moves up one directory

cd~   Takes you back to your home directory

chown command :


It changes the file owner and group ownership if a specified file.

Syntax : 
 
           chown owner-user filename
 To change ownership of a file to a root password
           sudo chown root filename















No comments:

Post a Comment