Creating a File
So there’s a command called
ls, which I think is short for list, and here we can see that it lists out the name of this file that we just created. Okay, so that’s, the contents of the directory are listed now, and the
hello_terminal is in the
Yes, I guess let’s start actually by increasing a little bit with the
ls command. So we talked about so far that we sometimes want to have arguments to your commands, so like here we had
touch command does, or was actually designed, to do is to change the access time on the file. So we can see here, if I just say
touch hello_terminal.py one more time, that still works, and if I do
ls -l, you can see that this timestamp there has been updated. Okay.
Like, would it be empty again, or does it only modify the time?
touch only modifies the time, so it doesn’t change the contents of it. What we’re kind of seeing, and it’s kind of become a typical thing to do, is to kind of abuse this command to create empty files because if the file doesn’t exist, then it creates the empty file. Okay, gotcha.
Become a Member to join the conversation.