SlideShare a Scribd company logo
1 of 5
Download to read offline
 TOP MENU
Apr 23, 2023  Facebook
 Twitter
 LinkedIn
  fa-you
JOIN TO OUR FACEBOOK GROUP

 MAIN MENU
Cheat Sheets Linux
Text Processing Command Cheat Sheet
Last updated on April 4th, 2023 - by John Gomez - Leave a Comment
Text Processing Commands are a set of built-in commands that are used to
manipulate text. These commands allow users to quickly and ef몭ciently search,
modify, and extract data from text 몭les.
Command Description Examples
cat Concatenate and display 몭les cat file1.txt file2.txt
sort Sort lines of text 몭les sort file.txt
uniq
Remove duplicate lines from a sorted
몭le
sort file.txt | uniq
grep Search for patterns in 몭les grep "pattern" file.txt
cut Extract columns of text from 몭les cut ‐f1,3 file.txt
sed
Stream editor for 몭ltering and
transforming text
sed 's/old/new/' file.txt
awk
Pattern scanning and processing
language
awk '{print $1, $3}'
file.txt
tr Translate or delete characters tr 'a‐z' 'A‐Z' < file.txt
wc
Count lines, words, and characters in
a 몭le
wc file.txt

Page 1 of 5
Command Description Examples
diff
Compare two 몭les and show
differences
diff file1.txt file2.txt
patch Apply a diff 몭le to a 몭le or directory patch file.txt patch.diff
nl Number lines in a 몭le nl file.txt
head Display the 몭rst few lines of a 몭le head file.txt
tail Display the last few lines of a 몭le tail file.txt
tee
Redirect output to a 몭le and to the
terminal
ls | tee output.txt
fmt Format text 몭les for printing fmt file.txt
pr Convert text 몭les for printing pr file.txt
iconv Convert character encoding of a 몭le
iconv ‐f utf‐8 ‐t iso‐8859‐1
file.txt
dos2unix
Convert DOS line endings to UNIX
line endings
dos2unix file.txt
rev Reverse lines of a 몭le rev file.txt
fold Wrap lines of text to a speci몭ed width fold ‐w 80 file.txt
join
Join lines from two 몭les based on a
common 몭eld
join file1.txt file2.txt
RELATED POST
Docker Management Command Cheat Sheet
April 16,2023
Linux Database Management Command Cheat Sheet
April 14,2023
Linux System Initialization Command Cheat Sheet
April 14,2023
Page 2 of 5
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Leave a Reply
Your email address will not be published. Required 몭elds are marked *
About John Gomez
John Britto Founder & Cheif-Editor @LinuxTeck. A Computer Geek and Linux
Intellectual having more than 10+ years of experience in Linux and Open Source
technologies.
View all posts by John Gomez →
PREVIOUS ARTICLE
File Management Command Cheat Sheet
NEXT ARTICLE
Linux System Information Command Cheat
Sheet
Page 3 of 5
POST COMMENT
Linux Package Management Command Cheat Sheet
Apr 07, 2023
How to set up FTP server in Rocky Linux 8.4
Nov 23, 2021
TRENDING
Linux Package Management Command Cheat Sheet
How to set up FTP server in Rocky Linux 8.4
How to secure FTP Server with SSL/TLS in Rocky Linux
How to set up an SFTP server on Rocky Linux 8
How to set up MariaDB on Rocky Linux 8
How to Install and use phpMyAdmin on Rocky Linux
How to Install Rocky Linux 9 {Step by Step} with Screenshots
How to Install Ubuntu 22.04 LTS {Step by Step} with Screenshots
Install LAMP Stack on Rocky Linux 9 {Step by Step}
How to install Apache on Rocky Linux 9
Popular Comments Tags
Page 4 of 5
First name or full name
Email
I want to receive a newsletters
SUBSCRIBE
Copyright © 2023 LinuxTeck. All Rights Reserved.
Material from our website cannot be republished ONLINE or OFFLINE without our permission.
Contact US | Privacy Policy | Terms of use
Page 5 of 5

More Related Content

Similar to www-linuxteck-com-text-processing-commands-.pdf

101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filtersAcácio Oliveira
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filtersAcácio Oliveira
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdfroschahacker
 
Chapter09 -- networking with unix and linux
Chapter09  -- networking with unix and linuxChapter09  -- networking with unix and linux
Chapter09 -- networking with unix and linuxRaja Waseem Akhtar
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atdAcácio Oliveira
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
 
3.2 process text streams using filters
3.2 process text streams using filters3.2 process text streams using filters
3.2 process text streams using filtersAcácio Oliveira
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filtersAcácio Oliveira
 
POS 433 Effective Communication - tutorialrank.com
POS 433 Effective Communication - tutorialrank.comPOS 433 Effective Communication - tutorialrank.com
POS 433 Effective Communication - tutorialrank.comBartholomew59
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atdAcácio Oliveira
 
Linux_Commands_MT.pdf
Linux_Commands_MT.pdfLinux_Commands_MT.pdf
Linux_Commands_MT.pdfRameshN849679
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variablesGautam Raja
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)Rodrigo Maia
 
Shell tutorial
Shell tutorialShell tutorial
Shell tutorialVu Duy Tu
 
Linux commands
Linux commandsLinux commands
Linux commands3lik
 

Similar to www-linuxteck-com-text-processing-commands-.pdf (20)

101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
Linux Cheat Sheet.pdf
Linux Cheat Sheet.pdfLinux Cheat Sheet.pdf
Linux Cheat Sheet.pdf
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Lnx
LnxLnx
Lnx
 
Chapter09 -- networking with unix and linux
Chapter09  -- networking with unix and linuxChapter09  -- networking with unix and linux
Chapter09 -- networking with unix and linux
 
101 apend. scripting, crond, atd
101 apend. scripting, crond, atd101 apend. scripting, crond, atd
101 apend. scripting, crond, atd
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
3.2 process text streams using filters
3.2 process text streams using filters3.2 process text streams using filters
3.2 process text streams using filters
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
Linux commands
Linux commandsLinux commands
Linux commands
 
POS 433 Effective Communication - tutorialrank.com
POS 433 Effective Communication - tutorialrank.comPOS 433 Effective Communication - tutorialrank.com
POS 433 Effective Communication - tutorialrank.com
 
3.1.c apend scripting, crond, atd
3.1.c apend   scripting, crond, atd3.1.c apend   scripting, crond, atd
3.1.c apend scripting, crond, atd
 
Linux_Commands_MT.pdf
Linux_Commands_MT.pdfLinux_Commands_MT.pdf
Linux_Commands_MT.pdf
 
5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables5_File_Handling_Commands__vi_editor_and_environment_variables
5_File_Handling_Commands__vi_editor_and_environment_variables
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Shell tutorial
Shell tutorialShell tutorial
Shell tutorial
 
COinS (eng version)
COinS (eng version)COinS (eng version)
COinS (eng version)
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux Day1
Linux Day1Linux Day1
Linux Day1
 

Recently uploaded

UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscapingDr. M. Kumaresan Hort.
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 

Recently uploaded (20)

UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 

www-linuxteck-com-text-processing-commands-.pdf

  • 1.  TOP MENU Apr 23, 2023  Facebook  Twitter  LinkedIn   fa-you JOIN TO OUR FACEBOOK GROUP   MAIN MENU Cheat Sheets Linux Text Processing Command Cheat Sheet Last updated on April 4th, 2023 - by John Gomez - Leave a Comment Text Processing Commands are a set of built-in commands that are used to manipulate text. These commands allow users to quickly and ef몭ciently search, modify, and extract data from text 몭les. Command Description Examples cat Concatenate and display 몭les cat file1.txt file2.txt sort Sort lines of text 몭les sort file.txt uniq Remove duplicate lines from a sorted 몭le sort file.txt | uniq grep Search for patterns in 몭les grep "pattern" file.txt cut Extract columns of text from 몭les cut ‐f1,3 file.txt sed Stream editor for 몭ltering and transforming text sed 's/old/new/' file.txt awk Pattern scanning and processing language awk '{print $1, $3}' file.txt tr Translate or delete characters tr 'a‐z' 'A‐Z' < file.txt wc Count lines, words, and characters in a 몭le wc file.txt  Page 1 of 5
  • 2. Command Description Examples diff Compare two 몭les and show differences diff file1.txt file2.txt patch Apply a diff 몭le to a 몭le or directory patch file.txt patch.diff nl Number lines in a 몭le nl file.txt head Display the 몭rst few lines of a 몭le head file.txt tail Display the last few lines of a 몭le tail file.txt tee Redirect output to a 몭le and to the terminal ls | tee output.txt fmt Format text 몭les for printing fmt file.txt pr Convert text 몭les for printing pr file.txt iconv Convert character encoding of a 몭le iconv ‐f utf‐8 ‐t iso‐8859‐1 file.txt dos2unix Convert DOS line endings to UNIX line endings dos2unix file.txt rev Reverse lines of a 몭le rev file.txt fold Wrap lines of text to a speci몭ed width fold ‐w 80 file.txt join Join lines from two 몭les based on a common 몭eld join file1.txt file2.txt RELATED POST Docker Management Command Cheat Sheet April 16,2023 Linux Database Management Command Cheat Sheet April 14,2023 Linux System Initialization Command Cheat Sheet April 14,2023 Page 2 of 5
  • 3. Comment * Name * Email * Website Save my name, email, and website in this browser for the next time I comment. Leave a Reply Your email address will not be published. Required 몭elds are marked * About John Gomez John Britto Founder & Cheif-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 10+ years of experience in Linux and Open Source technologies. View all posts by John Gomez → PREVIOUS ARTICLE File Management Command Cheat Sheet NEXT ARTICLE Linux System Information Command Cheat Sheet Page 3 of 5
  • 4. POST COMMENT Linux Package Management Command Cheat Sheet Apr 07, 2023 How to set up FTP server in Rocky Linux 8.4 Nov 23, 2021 TRENDING Linux Package Management Command Cheat Sheet How to set up FTP server in Rocky Linux 8.4 How to secure FTP Server with SSL/TLS in Rocky Linux How to set up an SFTP server on Rocky Linux 8 How to set up MariaDB on Rocky Linux 8 How to Install and use phpMyAdmin on Rocky Linux How to Install Rocky Linux 9 {Step by Step} with Screenshots How to Install Ubuntu 22.04 LTS {Step by Step} with Screenshots Install LAMP Stack on Rocky Linux 9 {Step by Step} How to install Apache on Rocky Linux 9 Popular Comments Tags Page 4 of 5
  • 5. First name or full name Email I want to receive a newsletters SUBSCRIBE Copyright © 2023 LinuxTeck. All Rights Reserved. Material from our website cannot be republished ONLINE or OFFLINE without our permission. Contact US | Privacy Policy | Terms of use Page 5 of 5