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