The Terminal

Jesus Santizo
Aug 27, 2017 · 2 min read

The terminal is a very essential tool to all coders. The terminal is the name of the command-line interface between the user and the computer. It is how we talk to our computer by giving it commands. The terminal will process and execute the command.

One of the many commands that a terminal can do is create a directory/folder with a file. We can edit the file directly through the terminal as needed instead of going to the actual file itself.

To create a folder we open the terminal and go to the directory in which we would like to create a new folder with the command line:

mkdir "foldername"

Once the folder is created we can switch over to the folder by typing another simple command:

cd "foldername"

Once we are in our folder we can create a file in there with:

touch filename.txt

This will create an empty text file called “filename”.

To add something to our empty file we use the command line “echo”:

echo "Hello" >> filename.txt

This will add “Hello” to our file. To ensure that it did add the line, we use the “cat” command to read the contents inside the file.

cat filename.txt

This will output “Hello” in the terminal and just like that we created a folder, a file, added a line in that to the file, and displayed what that file contains with five simple lines. We gave the terminal commands it understands and it executed them. This is just some of the great things the terminal is capable of doing.

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade