Showing File Contents
00:00
And one thing—sorry, I just keep talking, huh? One thing I want to say too is that you want to use the Tab character very often if you can. That’s an autocomplete in your terminal, and that’s what you see me do if I say hello
and then press the Tab character—I need a command before that… hello
and press the Tab character, then if it can, then it autocompletes. If it can’t, then it gives me the options that that I can use, basically. Cool. That’s handy.
00:27
A little bit like code completion in your editor. Yeah. It’s a bit intelligent there. And yeah, you were basically foreshadowing something with the cat
. I mean, you said, like, you put like this echo
output into the file, but this time I really want you to prove that it’s actually in the file without opening it in an editor, because of course this file exists now, and you could open it in any editor.
00:50
But let’s stick to the terminal. So, how can you show me what’s in the file now? Yeah, I can use a cat
for that.
00:58
I can say meow [laughter] hello_terminal.py
, and then it shows me the contents of the file. So now, in this case, this is actually what’s written inside of the file hello_terminal.py
because I put it in there using this command where I redirected the output of the echo
command into the file hello_terminal.py
.
01:17
That’s why it’s in here now. And you can list the contents of a file using cat
.
Become a Member to join the conversation.