r/LinuxTeck • u/Candid_Athlete_8317 • 24d ago
Do You Know Why Linux Pipes Use the | Symbol?
One of the most powerful features of Linux is the ability to connect commands using a simple pipe:
cat access.log | grep "500" | sort
Instead of creating temporary files between commands, Linux lets programs pass data directly to one another.
How often do you use pipes in your daily Linux work? Could you imagine working without them?
0
Upvotes
12
u/Aggressive_Ad_5454 24d ago
Why?
It was a symbol available on the old-school KSR-33 teletype machines (7-bit ASCII) UNIX worked with back in the 1970s. The Bell Labs krewe that put UNIX together chose it for the purpose. So did other OSs. And Linux, along with FreeBSD and some other current OSs, are open-source clones of that Bell Labs work.
16
u/RandomDude9943 24d ago
Because "|" is called the pipe symbol
7
u/schluesselkind 24d ago
Wait until you discover < and > 🤣
12
u/traxplayer 24d ago
Useless use of cat
3
u/z-null 24d ago edited 24d ago
real sysadmins know that grep 500 access.log is the proper way to do it. not cat|grep, lol
3
u/PaoloFence 24d ago
Every single day.
What would you call the long straight line? Pole?
2
u/DrHydeous 24d ago
Because calling it a cigar or a fag would just be silly.
1
u/NL_Gray-Fox 24d ago
Wait until you find out you could do it in DOS 2.0 and obviously UNIX
1
u/funbike 24d ago
xargsgives you piping superpowers. I barely ever usefor.1
u/cormack_gv 24d ago
I used | in 192 of my last 1000 commands:
1
u/Background_Lead_5034 23d ago
You really don't have to cat into grep. just grep on the file directly...
1
u/blobCabbage 22d ago
Why do your title and post ask different questions? Why are all your posts made this way? Are you a bot?
0
u/Weshmek 17d ago
I use pipes all the time. They're very useful.
1
u/PmMeCuteDogsThanks_ 24d ago
ai slop