SlideShare a Scribd company logo
nano
vi These editors are used in console mode.
vim
gvim
gedit These editors are used in graphical mode.
Emacs
VI editor/ VIM editor:
There are three modes in vi editors:
ex mode(default mode, by pressing escape key, this mode is used for saving and exit )
Insert mode (by pressing insert or I key, this mode is used for editing)
Replace mode (this mode is used for replacing text written, by again pressing insert
or r key)
For saving & exiting document- come on esc mode and write :wq
For setting line numbers in document come on esc mode and write : se nu
For coming on any specific line press line no. and then ‘G’ (ex- 102 then G)
For going at the end of page press ‘G’
For going at the top of page press gg
Vim editor is not installed default when you install linux, you have to install vim
editor. It is the enhanced version of vi editor.
# vim/vi filename
Press ‘v’ to come to visual mode, here we can select the matter which we want
to copy , press ‘yy’ to copy (y stands for yank). Press ‘p’ to paste that matter.
Press ‘dd’ to delete a particular line where cursor is.
More options (on esc. mode):
I - Starts editing from starting of Line where your cursor is.
a - Starts appending after the character where the cursor is.
A - Starts appending from the end of the line where cursor is.
o - Creates a new line below that line where the cursor is.
O - Creates a new line above the line where the cursor is.
r - Replace only character where cursor is placed.
R - Replace from the cursor start an ends where you want.
For replacing many words in a file (for ex- if we have made a file, in that file many
times dog word is written and we want to replace word dog with cat), open file
with vi editor and on esc. Mode type
:%s/dog/cat/g
 sed ‘s/dog/cat/g’ filename (show file with replaced word)
These commands are called CUPS (Common Unix Printing System)
 system-config-printer - To initialize Printer graphically
 lpstat - To check the status of printer
 lprm <job id> - To cancel the printing
 lpq - To check the printing queue status
 a2ps - Change normal text to Post Script
 ps2pdf - Changes post script to pdf
 lpr <filename> <Printer> - Sends printing
 mount /dev/cdrom /mnt - To mount CD ROM.
 mount /dev/device name/mnt - To mount any external device.
 mount -t vfat /dev/partition /mnt - To mount fat partition.
 mount -t nfs <server IP>:/var/dump /mnt- To mount NFS.
 blkid - To see device id (ex- hda1, sdb).
 du -h <partition> - To check how much partition is used.
 lsmod - List of drivers running.
 modinfo - Details about running driver
 df -h <partition> - To check the free space of a partition.
 sort <filename> - Short file in a-z format.
 sort -d <filename> - Short file in dictionary format.
 sort -r <filename> - Short file in z-a format.
 tr ‘a-z’ ‘A-Z’ <filename> - Translate file in all capital letters
 wc (-l/-w/-c ) <filename> - Word count
 (-l for line, -w for word, -c for character)
diff file1 file2 - To see difference between
 same looking files.
 ps - To check the processing status.
 kill -9 PID - To kill the service no. 9.
 find / -name <filename>- Searches file in /.
 find -perm 775 - Searches for files having permission 775.
 find -size ± 512k - Searches for files of 512k
 find -name *.htm - Searches files having extension .htm.
 cut –f1 –d : /etc/passwd - It will show the first column of passwd file
 cut –c 1-3 /etc/passwd > new file- Creates a new file.
 paste new file file - Pastes the matter of new file in file.
 less <filename> - To see a file pagewise.
 grep <word> <filename>- To find a particular word or string in a file.
 grep –n <word> <filename>- To see the line number in which that word is
 locate <name> - Locate all files which has that name.
 tar -cvf <name> <filesname> - It will take the backup of files as a
single file.
 tar -tvf <name> - Show how many files & their name in
the backup file.
 tar -xvf <name> - Restore the backup.
 tar -rvf <name> <filesname> - It will append the backup.
 gzip <filename> - It will compress a file.
 bzip2 <filename> - It will compress a file.
 gunzip <filename>.gz - It will decompress a file.
 bunzip2 <filename>.b2z - It will decompress a file.
 zcat <filename.gz> - To see the content of compress file
To edit or see init level
# vi /etc/inittab
0 = shutdown
1 = single user mode
2 = multiuser mode without NFS support
3 = full multiuser mode
4 = not used
5 = Graphical (x11)
6 = reboot
crontab -e -u username
*/1 * * * * echo ‘Hello’ > /dev/tty2 (min, hour, date, month, day)
save file.
 service crond restart (now when user login on 2nd
terminal it will get
message hello after every 1 min.)
 crontab -l -u username (to see how many crontab are running for user)
 crontab -r -u username (deletes the crontab)
 crontab –e
11 12 * * * mkdir rahul

More Related Content

What's hot

Linux commd
Linux commdLinux commd
Linux commdragav03
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOSAdamFallon4
 
Linux commands
Linux commandsLinux commands
Linux commandsU.P Police
 
Linux commands part -2
Linux commands part -2Linux commands part -2
Linux commands part -2bhatvijetha
 
Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Noé Fernández-Pozo
 
Linux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterKenny (netman)
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellKenny (netman)
 
Gnome terminal basics
Gnome terminal basicsGnome terminal basics
Gnome terminal basicsKamrul Hasan
 

What's hot (12)

Linux commd
Linux commdLinux commd
Linux commd
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 
Babitha.linux
Babitha.linuxBabitha.linux
Babitha.linux
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux cheat sheet
Linux cheat sheetLinux cheat sheet
Linux cheat sheet
 
Linux commands part -2
Linux commands part -2Linux commands part -2
Linux commands part -2
 
Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014
 
Linux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filterLinux fundamental - Chap 05 filter
Linux fundamental - Chap 05 filter
 
Prabu linux
Prabu linuxPrabu linux
Prabu linux
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
 
Gnome terminal basics
Gnome terminal basicsGnome terminal basics
Gnome terminal basics
 

Viewers also liked

global fertiliser market scenario
global fertiliser market scenarioglobal fertiliser market scenario
global fertiliser market scenarioNaveen Nayak
 
aetiology and pathogenesis of chronic obstructive lung disease
aetiology and pathogenesis of chronic obstructive lung diseaseaetiology and pathogenesis of chronic obstructive lung disease
aetiology and pathogenesis of chronic obstructive lung diseaseDr. Kanishk Sharma
 

Viewers also liked (6)

global fertiliser market scenario
global fertiliser market scenarioglobal fertiliser market scenario
global fertiliser market scenario
 
aetiology and pathogenesis of chronic obstructive lung disease
aetiology and pathogenesis of chronic obstructive lung diseaseaetiology and pathogenesis of chronic obstructive lung disease
aetiology and pathogenesis of chronic obstructive lung disease
 
Paralytic squint
Paralytic squintParalytic squint
Paralytic squint
 
S parameters
S parametersS parameters
S parameters
 
Sampling
SamplingSampling
Sampling
 
Thyroid cancers
Thyroid cancersThyroid cancers
Thyroid cancers
 

Similar to Rhel2

Unix / Linux Command Reference
Unix / Linux Command ReferenceUnix / Linux Command Reference
Unix / Linux Command ReferenceSumankumar Panchal
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersDevanand Gehlot
 
Linux commands
Linux commandsLinux commands
Linux commandsshekhar70
 
workshop_1.ppt
workshop_1.pptworkshop_1.ppt
workshop_1.ppthazhamina
 
Termux commands-list
Termux commands-listTermux commands-list
Termux commands-listDhanushR24
 
Terminal linux commands_ Fedora based
Terminal  linux commands_ Fedora basedTerminal  linux commands_ Fedora based
Terminal linux commands_ Fedora basedNavin Thapa
 
List command linux fidora
List command linux fidoraList command linux fidora
List command linux fidoraJinyuan Loh
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
Linux Command.pptx
Linux Command.pptxLinux Command.pptx
Linux Command.pptxSaileshB5
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manualSaikat Rakshit
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manualCraig Cannon
 

Similar to Rhel2 (20)

Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
Unix / Linux Command Reference
Unix / Linux Command ReferenceUnix / Linux Command Reference
Unix / Linux Command Reference
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
 
Linux commands
Linux commandsLinux commands
Linux commands
 
workshop_1.ppt
workshop_1.pptworkshop_1.ppt
workshop_1.ppt
 
Unix commands
Unix commandsUnix commands
Unix commands
 
Termux commands-list
Termux commands-listTermux commands-list
Termux commands-list
 
Terminal linux commands_ Fedora based
Terminal  linux commands_ Fedora basedTerminal  linux commands_ Fedora based
Terminal linux commands_ Fedora based
 
List command linux fidora
List command linux fidoraList command linux fidora
List command linux fidora
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Linux Command.pptx
Linux Command.pptxLinux Command.pptx
Linux Command.pptx
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
 

Recently uploaded

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsVlad Stirbu
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform EngineeringJemma Hussein Allen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 

Recently uploaded (20)

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Rhel2

  • 1.
  • 2. nano vi These editors are used in console mode. vim gvim gedit These editors are used in graphical mode. Emacs
  • 3. VI editor/ VIM editor: There are three modes in vi editors: ex mode(default mode, by pressing escape key, this mode is used for saving and exit ) Insert mode (by pressing insert or I key, this mode is used for editing) Replace mode (this mode is used for replacing text written, by again pressing insert or r key) For saving & exiting document- come on esc mode and write :wq For setting line numbers in document come on esc mode and write : se nu For coming on any specific line press line no. and then ‘G’ (ex- 102 then G) For going at the end of page press ‘G’ For going at the top of page press gg
  • 4. Vim editor is not installed default when you install linux, you have to install vim editor. It is the enhanced version of vi editor. # vim/vi filename Press ‘v’ to come to visual mode, here we can select the matter which we want to copy , press ‘yy’ to copy (y stands for yank). Press ‘p’ to paste that matter. Press ‘dd’ to delete a particular line where cursor is.
  • 5. More options (on esc. mode): I - Starts editing from starting of Line where your cursor is. a - Starts appending after the character where the cursor is. A - Starts appending from the end of the line where cursor is. o - Creates a new line below that line where the cursor is. O - Creates a new line above the line where the cursor is. r - Replace only character where cursor is placed. R - Replace from the cursor start an ends where you want.
  • 6. For replacing many words in a file (for ex- if we have made a file, in that file many times dog word is written and we want to replace word dog with cat), open file with vi editor and on esc. Mode type :%s/dog/cat/g  sed ‘s/dog/cat/g’ filename (show file with replaced word)
  • 7. These commands are called CUPS (Common Unix Printing System)  system-config-printer - To initialize Printer graphically  lpstat - To check the status of printer  lprm <job id> - To cancel the printing  lpq - To check the printing queue status  a2ps - Change normal text to Post Script  ps2pdf - Changes post script to pdf  lpr <filename> <Printer> - Sends printing
  • 8.  mount /dev/cdrom /mnt - To mount CD ROM.  mount /dev/device name/mnt - To mount any external device.  mount -t vfat /dev/partition /mnt - To mount fat partition.  mount -t nfs <server IP>:/var/dump /mnt- To mount NFS.
  • 9.  blkid - To see device id (ex- hda1, sdb).  du -h <partition> - To check how much partition is used.  lsmod - List of drivers running.  modinfo - Details about running driver  df -h <partition> - To check the free space of a partition.
  • 10.  sort <filename> - Short file in a-z format.  sort -d <filename> - Short file in dictionary format.  sort -r <filename> - Short file in z-a format.  tr ‘a-z’ ‘A-Z’ <filename> - Translate file in all capital letters  wc (-l/-w/-c ) <filename> - Word count  (-l for line, -w for word, -c for character) diff file1 file2 - To see difference between  same looking files.  ps - To check the processing status.  kill -9 PID - To kill the service no. 9.
  • 11.  find / -name <filename>- Searches file in /.  find -perm 775 - Searches for files having permission 775.  find -size ± 512k - Searches for files of 512k  find -name *.htm - Searches files having extension .htm.  cut –f1 –d : /etc/passwd - It will show the first column of passwd file  cut –c 1-3 /etc/passwd > new file- Creates a new file.  paste new file file - Pastes the matter of new file in file.  less <filename> - To see a file pagewise.  grep <word> <filename>- To find a particular word or string in a file.  grep –n <word> <filename>- To see the line number in which that word is  locate <name> - Locate all files which has that name.
  • 12.  tar -cvf <name> <filesname> - It will take the backup of files as a single file.  tar -tvf <name> - Show how many files & their name in the backup file.  tar -xvf <name> - Restore the backup.  tar -rvf <name> <filesname> - It will append the backup.
  • 13.  gzip <filename> - It will compress a file.  bzip2 <filename> - It will compress a file.  gunzip <filename>.gz - It will decompress a file.  bunzip2 <filename>.b2z - It will decompress a file.  zcat <filename.gz> - To see the content of compress file
  • 14. To edit or see init level # vi /etc/inittab 0 = shutdown 1 = single user mode 2 = multiuser mode without NFS support 3 = full multiuser mode 4 = not used 5 = Graphical (x11) 6 = reboot
  • 15. crontab -e -u username */1 * * * * echo ‘Hello’ > /dev/tty2 (min, hour, date, month, day) save file.  service crond restart (now when user login on 2nd terminal it will get message hello after every 1 min.)  crontab -l -u username (to see how many crontab are running for user)  crontab -r -u username (deletes the crontab)  crontab –e 11 12 * * * mkdir rahul