Skip to contentমূল লেখায় যান

Stage 03 · Linuxধাপ 03 · Linux · 20 topics · 25 commands20টি টপিক · 25টি কমান্ড

Text Processing

Use streams, pipes, and small tools to search and shape text.

UPPERCASE = your own value · red ! = can destroy data · tick a card when you know itUPPERCASE = আপনার নিজের মান · লাল ! = data নষ্ট করতে পারে · জানা হলে কার্ডে টিক দিন

0 / 20 done0 / 20 সম্পন্ন

Text Processing

sed 's/OLD/NEW/g' FILE
replace text in a streamstream-এর text বদলায়
sed -n '2,4p' FILE
print lines 2 to 4২ থেকে ৪ নম্বর লাইন দেখায়
diff OLD NEW
show how two files differদুটি file-এর পার্থক্য দেখায়
xargs CMD
run a command with the input as argumentsinput-কে argument করে command চালায়
column -t
align text into columnstext-কে column-এ সাজায়

Source 1সোর্স 1Source 2সোর্স 2Source 3সোর্স 3Source 4সোর্স 4

Stdout, Stdin, and Stderr

0 1 2
stdin · stdout · stderr (file descriptors)stdin · stdout · stderr (file descriptor-এর নম্বর)
CMD 2> FILE
Warningসতর্কতা: send only errors to a fileশুধু error file-এ পাঠায়
CMD > FILE 2>&1
Warningসতর্কতা: send output and errors to one fileoutput ও error একই file-এ পাঠায়
CMD 2>/dev/null
hide error messageserror message লুকায়
read VAR
read a line of stdin into a variablestdin-এর এক লাইন variable-এ পড়ে
echo TEXT >&2
print to stderrstderr-এ print করে

Source 5সোর্স 5

Redirects

CMD > FILE
Warningসতর্কতা: stdout to a file, replacing itstdout file-এ পাঠায়, আগের লেখা মুছে যায়
CMD >> FILE
append stdout to a filestdout file-এর শেষে যোগ করে
CMD < FILE
read stdin from a filefile থেকে stdin পড়ে
CMD 2>&1
send stderr where stdout goesstderr-কে stdout-এর জায়গায় পাঠায়
CMD &> FILE
Warningসতর্কতা: stdout and stderr to a file (bash)stdout ও stderr দুটোই file-এ পাঠায় (bash)
CMD <<EOF
here-document: inline input until EOFhere-document: EOF পর্যন্ত inline input
set -o noclobber
stop > from overwriting files> দিয়ে file overwrite বন্ধ করে

Source 5সোর্স 5

Pipes

CMD | CMD
stdout of one is stdin of the nextএকটির stdout পরেরটির stdin হয়
ls | wc -l
count the entriesentry গোনে
history | grep WORD
search your historyhistory-তে খোঁজে
CMD | less
scroll long outputলম্বা output scroll করে দেখায়
CMD |& CMD
pipe stdout and stderr (bash)stdout ও stderr দুটোই pipe করে (bash)
CMD | xargs CMD
turn lines into argumentsline-কে argument বানায়
set -o pipefail
fail if any stage failsকোনো ধাপ ব্যর্থ হলে pipeline ব্যর্থ হয়

Source 5সোর্স 5Source 3সোর্স 3Source 6সোর্স 6Source 7সোর্স 7

Tee

CMD | tee FILE
Warningসতর্কতা: show the output and save itoutput দেখায় ও save করে
CMD | tee -a FILE
append instead of replacingreplace না করে শেষে যোগ করে
CMD | tee FILE | CMD
Warningসতর্কতা: save a copy in the middle of a pipelinepipeline-এর মাঝখানে একটি কপি save করে
echo TEXT | sudo tee FILE
Warningসতর্কতা: write a root-owned fileroot-এর file-এ লেখে

Source 8সোর্স 8Source 9সোর্স 9Source 5সোর্স 5

grep

grep PATTERN FILE
print the lines that matchমিলে যাওয়া লাইন দেখায়
grep -i PATTERN FILE
ignore caseবড়-ছোট হাতের অক্ষর উপেক্ষা করে
grep -v PATTERN FILE
lines that do not matchযে লাইন মেলে না সেগুলো দেখায়
grep -n PATTERN FILE
show line numbersলাইন নম্বর দেখায়
grep -r PATTERN DIR
search a whole directory treeপুরো directory tree-তে খোঁজে
grep -c PATTERN FILE
count the matching linesমিলে যাওয়া লাইন গোনে
grep -l PATTERN DIR/*
list the files that matchযেসব file মেলে তাদের নাম দেখায়
grep -E "ERROR|WARN" FILE
extended regex: A or Bextended regex: A বা B

Source 10সোর্স 10

awk

awk '{print $1}' FILE
print the first columnপ্রথম column দেখায়
awk -F: '{print $1}' FILE
set the separator to a colonseparator হিসেবে colon ধরে
awk 'NR==5' FILE
print line 5৫ নম্বর লাইন দেখায়
awk '/PATTERN/' FILE
print the lines that matchমিলে যাওয়া লাইন দেখায়
awk '$3 > 100' FILE
filter by a column valuecolumn-এর মান দিয়ে filter করে
awk '{print NF}' FILE
count the fields on each lineপ্রতি লাইনে field গোনে
awk '{s+=$1} END{print s}' FILE
sum a columncolumn-এর যোগফল বের করে

Source 11সোর্স 11

cut

cut -d, -f1 FILE
the first comma-separated fieldপ্রথম comma-separated field
cut -d: -f1,3 FILE
fields 1 and 3১ ও ৩ নম্বর field
cut -d' ' -f2- FILE
field 2 to the end২ নম্বর থেকে শেষ পর্যন্ত field
cut -c1-5 FILE
characters 1 to 5১ থেকে ৫ নম্বর অক্ষর

Source 12সোর্স 12

sort

sort FILE
sort lines alphabeticallyলাইন বর্ণানুক্রমে সাজায়
sort -n FILE
sort by numberসংখ্যা অনুযায়ী সাজায়
sort -rn FILE
largest number firstবড় সংখ্যা আগে রাখে
sort -u FILE
sort and drop duplicatesসাজিয়ে duplicate বাদ দেয়
sort -k2,2 FILE
sort by the 2nd field২ নম্বর field ধরে সাজায়
sort -t, -k2n FILE
comma-separated, 2nd field as a numbercomma-separated, ২য় field সংখ্যা ধরে
sort -h FILE
sort sizes like 1K, 2M, 3G1K, 2M, 3G-এর মতো size অনুযায়ী সাজায়
sort -R FILE
shuffle the linesলাইনগুলো এলোমেলো করে

Source 13সোর্স 13

uniq

uniq FILE
drop repeated lines next to each otherপাশাপাশি পুনরাবৃত্ত লাইন বাদ দেয়
sort FILE | uniq
drop all duplicatesসব duplicate বাদ দেয়
uniq -c FILE
count how often each line repeatsপ্রতিটি লাইন কতবার এসেছে গোনে
uniq -d FILE
only the duplicated linesশুধু duplicate লাইন দেখায়
uniq -u FILE
only the lines that occur onceশুধু যে লাইন একবারই এসেছে
sort FILE | uniq -c | sort -rn
most frequent lines firstযে লাইন বেশি এসেছে সেগুলো আগে

Source 14সোর্স 14Source 13সোর্স 13

wc

wc FILE
lines, words, bytesলাইন, শব্দ ও byte
wc -l FILE
count linesলাইন গোনে
wc -w FILE
count wordsশব্দ গোনে
wc -c FILE
count bytesbyte গোনে
wc -m FILE
count charactersঅক্ষর গোনে
wc -L FILE
length of the longest lineসবচেয়ে লম্বা লাইনের দৈর্ঘ্য

Source 6সোর্স 6

tail

tail FILE
the last 10 linesশেষ ১০ লাইন
tail -n 5 FILE
the last 5 linesশেষ ৫ লাইন
tail -f FILE
follow new lines live; Ctrl+C stopsনতুন লাইন লাইভ দেখায়; Ctrl+C থামায়
tail -F FILE
follow, even if the file is rotatedfile rotate হলেও অনুসরণ করে
tail -n +2 FILE
from line 2 to the end (skip a header)২ নম্বর লাইন থেকে শেষ পর্যন্ত (header বাদ)

Source 16সোর্স 16

nl

nl FILE
number the non-empty linesখালি নয় এমন লাইনে নম্বর বসায়
nl -ba FILE
number all linesসব লাইনে নম্বর বসায়
nl -s': ' FILE
set the text after the numberনম্বরের পরের অংশ ঠিক করে
nl -w3 FILE
set the number width to 3নম্বরের width ৩ করে
cat -n FILE
number all lines (the short way)সব লাইনে নম্বর বসায় (সংক্ষেপে)

Source 17সোর্স 17Source 18সোর্স 18

paste

paste FILE FILE
join files side by side, tab betweenfile পাশাপাশি জোড়ে, মাঝে tab
paste -d, FILE FILE
use a comma betweenমাঝে comma ব্যবহার করে
paste -s FILE
all lines into one lineসব লাইন এক লাইনে আনে
paste -sd, FILE
one line, comma-separatedএক লাইনে, comma দিয়ে আলাদা
CMD | paste - -
pair up the linesলাইনগুলো জোড়ায় জোড়ায় সাজায়

Source 19সোর্স 19

join

join FILE FILE
join two sorted files on the first fieldদুটি sorted file প্রথম field ধরে জোড়ে
join -t, FILE FILE
fields are separated by commasfield-গুলো comma দিয়ে আলাদা
join -1 2 -2 1 FILE FILE
file 1 column 2 matches file 2 column 1১ম file-এর ২য় column আর ২য় file-এর ১ম column ধরে
join -a1 FILE FILE
keep the unmatched lines of file 1১ম file-এর অমিল লাইনও রাখে

Source 20সোর্স 20

split

split -l 100 FILE NAME
pieces of 100 lines১০০ লাইনের টুকরো
split -b 10M FILE NAME
pieces of 10 MiB১০ MiB-এর টুকরো
split -n 4 FILE NAME
exactly 4 piecesঠিক ৪টি টুকরো
split -d -l 100 FILE NAME
numbered names: NAME00, NAME01সংখ্যার নাম: NAME00, NAME01
cat NAME* > FILE
Warningসতর্কতা: join the pieces backটুকরোগুলো আবার জোড়ে

Source 21সোর্স 21Source 18সোর্স 18

tr

tr a-z A-Z
lower case to upper caseছোট হাতের অক্ষর বড় হাতের করে
tr ' ' '\n'
one word per lineপ্রতি লাইনে একটি শব্দ
tr -d '\r'
delete carriage returns (CRLF to LF)carriage return মোছে (CRLF থেকে LF)
tr -d '0-9'
delete the digitsসংখ্যা মোছে
tr -s ' '
squeeze repeated spaces into oneপরপর space একটিতে নামায়
tr -dc 'a-z0-9' </dev/urandom | head -c 16
a random 16-character string১৬ অক্ষরের একটি random string

Source 22সোর্স 22

expand

expand FILE
tabs to spaces (8-column stops)tab-কে space-এ বদলায় (৮ column)
expand -t 4 FILE
tab stops every 4 columnsপ্রতি ৪ column-এ tab stop
expand -i FILE
convert only the leading tabsশুধু শুরুর tab বদলায়

Source 23সোর্স 23

unexpand

unexpand FILE
leading spaces to tabsশুরুর space-কে tab-এ বদলায়
unexpand -a FILE
convert every run of spacesসব space-এর সারি বদলায়
unexpand -t 4 FILE
tab stops every 4 columnsপ্রতি ৪ column-এ tab stop

Source 24সোর্স 24

5 min read5 মিনিটে পড়া যায় · 20 sections20টি সেকশন · 24 sources24টি সোর্স · updated Nov 2026আপডেট: Nov 2026

Reels on this topicএই টপিকের রিলস

Short videos from other creators, picked for this topic. They are not part of this page's fact-checked text. Nothing loads from YouTube until you press Play.অন্য ক্রিয়েটরদের বানানো ছোট ভিডিও, এই টপিকের জন্য বাছাই করা। এগুলো এই পেজের ফ্যাক্ট-চেক করা লেখার অংশ নয়। চালান বাটন চাপার আগে YouTube থেকে কিছুই লোড হয় না।

Sourcesসোর্স24 · accessed 2026-11-27দেখা হয়েছে: 2026-11-27

Suggest an editএডিটের পরামর্শ দিন
  1. [1]sed, a stream editor
  2. [2]diff(1) - compare files line by line
  3. [3]xargs(1) - build and execute command lines from standard input
  4. [4]column(1) - columnate lists
  5. [5]bash(1) - GNU Bourne-Again SHell
  6. [6]wc(1) - print newline, word, and byte counts for each file
  7. [7]less(1) - display the contents of a file in a terminal
  8. [8]tee(1) - read from standard input and write to standard output and files
  9. [9]sudo(8) - execute a command as another user
  10. [10]grep(1) - print lines that match patterns
  11. [11]The GNU Awk User's Guide
  12. [12]cut(1) - remove sections from each line of files
  13. [13]sort(1) - sort lines of text files
  14. [14]uniq(1) - report or omit repeated lines
  15. [15]head(1) - output the first part of files
  16. [16]tail(1) - output the last part of files
  17. [17]nl(1) - number lines of files
  18. [18]cat(1) - concatenate files and print on the standard output
  19. [19]paste(1) - merge lines of files
  20. [20]join(1) - join lines of two files on a common field
  21. [21]split(1) - split a file into pieces
  22. [22]tr(1) - translate or delete characters
  23. [23]expand(1) - convert tabs to spaces
  24. [24]unexpand(1) - convert spaces to tabs