Basic Commands And Concepts


Terminal Interface explanation

[Root@Server~]#

Root      ->  Username
Server   ->  M/C name OR Hostname
 ~          ->  Present working Directory
 #          ->  Root Prompt
 $          ->  User Prompt

Basic Commands
  1.  ls               ->   Listing
  2.  ls -l            ->   Long Listing
  3.  ls -a           ->   Hidden files 
  4.  ls -i            ->   Index no:
  5.  ls -z           ->   Security files
  6.  cd              ->   Change directory
  7.  cd ..           ->   Reverse changing directory
  8.  cd -            ->   Moves to the recent directory 
  9.  date           ->   Shows date
  10.  date -s 20:12:00  ->  change time
  11.  date -s 12/5/2013  ->  change date
  12.  cal              ->  Calender
  13.  cal 2012     ->  Shows 2012 calender
  14.  cal 8 2012  ->  Shows Aug 2012 Calender
  15.  ps               ->  Process status
  16.  Jobs            ->  Shows jobs
  17.  logout         ->  Logout session (ctl + d)
  18.  top              ->  Background running process (TaskManager)
  19.  kill              ->  To kill a process
  20.  kill -9 <pid>  -> Forcefully killing a process with process id
  21.  who             ->   Login terminal
  22.  init 6            ->   Reboot
  23.  init 0             ->  Shutdown
  24.  su                  ->  Switch user
  25.  history           ->  To show history 
  26.  histroty -c      ->  To clear history
  27.  pwd              ->  Present working directory
  28.  du -sh           ->  calculating file size

HELP commands
  1. what is
  2. man
  3. --help
  4. info
Working with commands
  • Type     -   Display information about command type
  • Which   -   Locate a command
  • Help     -   Display reference page for shell builtin
  • Man      -  Display an on-line command reference

File/Directory creation,deletion,copy,move

creating an empty file
# touch filename

creating a file with content
# vi filename / vim filemane / nano filename
   cat > filename

Appending a file (without overwriting)
# cat >> filename    

Creating an directory/Folder
# mkdir diranme

creating more than one directory inside the directory 
# mkdir -p abc/123/def/456

Copying a file 
# cp <source>  <destination>
# cp -i <sourve> <destination>  // user is prompted before it is overwritten

Copying a directory
# cp -r <source>  <destination>

Moving a file/Dir
# mv <source> <destination>
# mv -i <source> <destination>  // user is prompted before it is overwritten
  
Removing/Deleting a file or a directory
# rm filename         // file
# rm -i filename      // // user is prompted before deleting
# rm -f flename      // forcefully remove
# rm -r dirname     // directory
# rm -rf dirname    //  forcefully 

To view size of a file/dir
# du -sh <dir/file name>

To view file type
# file filename

Compare files
# diff <file1> <file2>

Find out Kernal Details

# uname                  // OS
# uname -r              // Kernal Version
# uname -ar            // Full Details
# cat /etc/redhat-release  // Linux Version

Search commands

# find      // Dir content search
# grep     //  File content search
# locate   // file/Dir path search





Basic Commands And Concepts Basic Commands And Concepts Reviewed by vivek sathisan on 11:32 Rating: 5

No comments:

© Copyright to vivek sathisan. Powered by Blogger.