Showing and Editing the Content of a File
So there’s a very versatile command called
cat that here I’m using it to show the content of a file. And again, this is kind of, the name may not make sense, just like with
touch, and it’s because we’re using this one slightly different from how it was originally planned.
I also want to show one more thing that
cat can do, and this kind of comes back to what we already did here with
echo and something that I use also quite a lot, because here I was kind of echoing this
print(), which could be nice if I want to go back and redo it.
But an even quicker way to just throw something into a file is to use
cat to do it. So if I just say
cat but no file, and then I redirect whatever I’m doing into, well let’s do
hello_cat then just for fun, you can see that now it just, I didn’t get my prompt back. Instead it’s just sitting here.
02:08 Especially when you want to work with multiple lines, it might be easier to have this input sitting there waiting for you instead of making sure that everything is inside of the quotes, and you have to keep track of the lines.
Become a Member to join the conversation.