Basic Linux

General Concept of Linux:- 

                            
                             1. Red Hat Enterprise Linux 6 officially supports 22 languages: English, Bengali, Hindi, Chinese(Simplified), Chinese(Traditional), German, French, Italian, Japanese, Korean, Tamil, Gujarati, Assamese, Kannada, Malayalam, Marathi, Oriya, Portuguese(Brazilian), Punjabi, Russian, Spanish and Telugu.
                             2. In Unix or Linux everything is file.
                             3. Linux file name supports 255 characters. Alphabet(a-z), numbers(0-9), Punctuation marks support but don't support  >, ?, *, ", Tab, Space. 
                             4. Linux Terminal   =   [  User_name @ Host_name  Current Working Directory ] User_Symbol   =   [ root@localhost Desktop ]# . Where # = Root User  or  Super User   and   $  =  Regular User  or  Standard User. 

 

Dual Boot Sequence Change in Linux:-

 STEPS:        -> Enter the file manually-  /boot/grub/grub.conf

                -> default=0 replace with default=1 (0= Linux and 1= Other OS)

                -> Timeout=5 replace with Timeout=30 If you need (It's delay at booting time or delay to select an Operating System) 

 

Some Important Command of Linux:-



              Computer Shutdown Command in Linux:-

                       1. poweroff               ->   Enter
                       2. init 0                    ->   Enter
                       3. shutdown -h now   ->   Enter (Immediately)
                       4. shutdown 5           ->   Enter (For Maintenance- after 5 minutes)
                       5. shutdown 01:30     ->   Enter (For Maintenance- 1:30 AM or PM)

               Computer Reboot Command in Linux:-

                        1. reboot    ->   Enter
                        2. init 6      ->   Enter

                To Help Everything in Linux:- 

                        1. man           <command>              ->    Enter (To return press q)
                        2. info            <command>              ->    Enter (To return press q)
                        4. <command>    --help                   ->    Enter
                        5. Go to Documentation Directory      ->    /usr/share/doc  

                Some Single Command of Linux:- 

                        1. cal   or   cal  4  2014    ->   Enter (To see calender)
                        2. pwd                           ->   Enter (To see current working directory)
                        3. w                              ->   Enter (Who Logged on currently)
                        4. id                              ->   Enter (To see User & Group ID)
                        5. tty                             ->   Enter (Current Terminal Device)
                        6. bc                              ->   Enter (Basic Calculator:to back-> :quit  ->  Enter)
                        7. ls                               ->   Enter (To see Files & Directories of current working directory)
                        8. ls  -a                          ->   Enter (To see Files, Directories & all hidden contents of a directory) 
                        9. ls  -al                         ->   Enter (To see ,,  ,, & all hidden contents of a directory with permissions) 
                       10. ls  -il                         ->   Enter (To view the contents of a directory with their inode numbers)
                       11. which  <Command>      ->   Enter (To know the origin/Location/path of Command)
                       12. a ,  i ,  o                    ->   Enter (To go to insert mode within vim editor)
                       13. history                      ->   Enter (To see all commands of using current user)
                       14. df                             ->   Enter (To see Hard Disk information with KB)
                       15. df    -m                     ->   Enter (To see Hard Disk information with MB)
                       16. df    -h                     ->   Enter (To see Hard Disk information with GB)
                       17. fdisk  -l                    ->   Enter (To see all types of Hard Disk partition information)
                       18. date                        ->    Enter (For display date & time)

               Change Date & Time:- 

                        1.date    mmddhhmimiyyyy      ->    Enter 

               Creating and Deleting a File:-

                        1. touch   <file_name>     ->   Enter (To create a File)
                        2. rm       <file_name>     ->   Enter (To delete a File)  

               To Edit a File:-

                        1. vi         <file_name>     ->   Enter
                        2. vim      <file_name>     ->   Enter
                        3. nano    <file_name>     ->   Enter

               Move(Cut) and Re-name a File or a Directory:-  

                        1. mv     <source>         <destination>      ->    Enter (To move or cut a file or a diretory)
                        2. mv     <old_name>      <new_name>      ->    Enter (To rename a file or a directory)

               To view first & last lines of a File:-   

                        1. head                 <file_name>      ->   Enter (Only First 10 lines)
                        2. head    -n   15    <file_name>     ->   Enter (Desired first lines)
                         
                        3. tail                   <file_name>      ->   Enter (Only Last 10 lines)
                        4. tail    -n   14      <file_name>      ->   Enter (Desired last lines)
 

               Copy a File or a Directory:-  

                        1. cp     <source>     <destination>      ->    Enter  

               Creating a Directory:-

                        1. mkdir   directory_name           ->   Enter (A single Directory)
                        2. mkdir   -p   X/{a,b,c}/{x,y,z}  ->   Enter (Directory within a Directory)

                Delete a Directory:-

                         1. rmdir   directory_name    ->   Enter (For empty Directory)
                         2. rm   -r  directory_name   ->   Enter (Not empty Directory)
                         3. rm  -rf  directory_name   ->   Enter (Without facing any warning messages)

                 Directory Change:-

                          1. cd ..                 ->  Enter (To move one level up)
                          2. cd  or  cd ~       ->  Enter (To move user's home directory)
                          3. cd -                  ->  Enter (To move previous working directory)

                  Switch User:-

                          1.   su         <user_name>       ->   Enter ( Non-Login shell )
                              Return   ->   exit  or  ctrl+D
                          2.   su   -    <user_name>        ->   Enter ( Login shell )
                              Return   ->   logout  or  exit  or  ctrl+D


                  Creating a Soft & Hard Link:-

                          1. ln  -s    <source>   <target>    ->   Enter (Softlink)
                          2. ln         <source>   <target>    ->   Enter (Hardlink)
                         
                  Creating a User and a Group:-

                          1. useradd       <user_name>      ->   Enter
                          2. groupadd     <group_name>    ->   Enter


                  Modify a User and a Group:-

                          1. usermod   -L    <user_name>       ->    Enter (To Lock or Disable a user account)
                             usermod   -U    <user_name>       ->    Enter (To Unlock or Enable a user account)
                              or                                      
                             passwd     -l     <user_name>       ->    Enter (To Lock or Disable a user account)
                             passwd     -u    <user_name>       ->    Enter (To Unlock or Enable a user account)
 
                          2. groupmod       <group_name>      ->    Enter

                  Delete a User and a Group:- 

                          1. userdel    -r    <user_name>    ->    Enter (With home directory)

                  Creating a Password:- 

                          1. passwd     <user_name>    ->    Enter

                  Delete a Password:- 

                          1. passwd   -d   <user_name>   ->    Enter 

                  To view a File Contents:- 

                          1. less         <file_name>      ->    Enter (To view a page)
                          2. more        <file_name>      ->    Enter (To view in Terminal) 
                          3. cat          <file_name>      ->    Enter (To view in Terminal )

                  The Location of the Following Files:- 

                          1. Grub file                       =      /etc/grub.conf   or   /boot/grub/grub.conf
                          2. Network file                  =      /etc/sysconfig/network-scripts/ifcfg-ethx  
                          3. Global Setting               =      /etc/sysconfig/network 
                          4. Server Setting              =      /etc/resolv.conf
                          5. Permanent Mounting      =      /etc/fstab       

                  
                   Vim Execute(ex) Mode Commands:-

                          1.  :w            ->     Enter (Saves the files)
                          2.  :w!           ->     Enter (Saves the files forcely)
                          3.  :q             ->     Enter (quits)
                          4.  :q!            ->     Enter (quits forcely)
                          5.  :wq           ->     Enter (Saves & quits) 
                          6.  :wq!          ->     Enter (Saves & quits forcely)  


 Vim Execute(ex) Mode Commands:- 

                          1.  :w            ->     Enter (Saves the files) 



Linux Help Sites:

1. OStechnix

2. CentOS-7 Download

2 comments: