I don't think you will ever really see a system without cat. But, some people try to be extra efficient with their code and cat would be an extra process you don't need. Even if you always plan on using cat, it's good to know about this, in case you are looking at someone else's code.
echo and printf were initally external commands in /usr/bin/echo and /usr/bin/printf however people were using loops and complicated stuff that need to outout really quickly so each time printf or echo is invoked the hardddrive (or even with a modern ssd) needs to read which's inpractical for such basic task so they intregrated it to the shell, however /bin/echo is vastly diffrent than echo shell builtin in some shells and /usr/bin/printf is vastly diffrent than the bash printf builtin /bin/echo and /usr/bin/printf are still in modern systems for backwards compatablity as showen in the following output: ``` $ type -a echo echo is a shell builtin echo is /usr/bin/echo echo is /bin/echo $ type -a printf printf is a shell builtin printf is /usr/bin/printf printf is /bin/printf $ ```
Why Not? That's my question. But one reason is, less processes. Cat is external and every time you call it, you are starting a new process. 99% of the time that doesn't matter, but on a big project with a lots of loops, it could effect speed. Beyond that, it's not uncommon for people to do this. So, even if you never do it, know that you can will help you read other people's code.
So many times you don't have cat in a docker container because people thought it should not exist in a container... It's actually very very very usefuul
@@DigitalMetal the type of people i usually see saying this do: - using arch linux and brag about it - being chronically and using the computer for 36 hours each day for no reason - being a reddit user
I love pure bash work or projects 👾
I always find them interesting myself.
I love this kind of videos. ❤
Great!
Thanks Kris, Love CAT too :°) - have a smile -
And BAT
Thank you. That's helpful. In what environment would I lack tools such as cat? Or is portability an element to consider?
no environment has no cat, unless you manually remove both /bin/ and /usr/bin/
I don't think you will ever really see a system without cat. But, some people try to be extra efficient with their code and cat would be an extra process you don't need. Even if you always plan on using cat, it's good to know about this, in case you are looking at someone else's code.
Only embedded systems that don't need it like a router linux os (mind you most allow you to run a basic shell and having cat is handy).
awesome, SIRE!!!🤔
Glad you like it!
echo and printf were initally external commands in /usr/bin/echo and /usr/bin/printf
however people were using loops and complicated stuff that need to outout really quickly so each time printf or echo is invoked the hardddrive (or even with a modern ssd) needs to read which's inpractical for such basic task
so they intregrated it to the shell, however /bin/echo is vastly diffrent than echo shell builtin in some shells and /usr/bin/printf is vastly diffrent than the bash printf builtin
/bin/echo and /usr/bin/printf are still in modern systems for backwards compatablity as showen in the following output:
```
$ type -a echo
echo is a shell builtin
echo is /usr/bin/echo
echo is /bin/echo
$ type -a printf
printf is a shell builtin
printf is /usr/bin/printf
printf is /bin/printf
$
```
Yup
Could you write a script which change grub2 background image on the random image ? Very interesting
Lovely
Thank you
But, why??
My initial thought too. I mean, it's cool. That's enough for me.
Why Not? That's my question.
But one reason is, less processes. Cat is external and every time you call it, you are starting a new process. 99% of the time that doesn't matter, but on a big project with a lots of loops, it could effect speed.
Beyond that, it's not uncommon for people to do this. So, even if you never do it, know that you can will help you read other people's code.
So many times you don't have cat in a docker container because people thought it should not exist in a container...
It's actually very very very usefuul
why does this video make me feel like those linux users who say "/usr/bin/cat shall not exist in linux and its impure!"
I never heard anyone say that. But I can also see people saying that.
@@DigitalMetal the type of people i usually see saying this do:
- using arch linux and brag about it
- being chronically and using the computer for 36 hours each day for no reason
- being a reddit user
@@kaslmineer7999brain damage? Cat has been in unix/linux for decades.
@@skilletpan5674those people who say cat shall not exist probably have braindamage or something in their brain
Cat is soydev bloatware!!
TIL.