Handy Terminal Commands For Newcomers (a story)
Your terminal will give you more from now on.
Tue 16 August 2022
So you want to write some notes about your cat’s health. The first question might be: “Where am I on my computer?”
Okay, you are in the
mario is the name of your account.
You start thinking about the right place put these notes. You want to see what is inside the current folder.
You can see a list of folders.
You know you want to write a note, so you want to switch to the notes folder.
Now you are inside the notes folder.
To get proof of that, type
pwd again and you should get:
What does this folder contain? You already know the command:
In this case the output will be:
None of those are appropriate locations for the task at hand, right? The goal is to take some notes about your cat. So, let’s create a folder for this purpose.
If we try
ls again, the output should be:
Switch to the cat folder.
Now that you are in the right place, it’s time to create a file to store your notes.
This file will be in plain-text format, so use the extension
touch command allows you to create an empty file.
If you run
ls, you will see a new
note1.txt file in the list.
You have created a file! 🎉
It’s time to write down how Prezzemolo (your cat) is doing.
This will open your file with the default application associated with
.txt files. If you are using MacOS, that will probably be TextEdit, or if on Windows, perhaps Notepad.
Once the file is open, write the following in the document:
2022-08-12 Today Prezzemolo is fine, but I think he ate too much lasagna this morning.
Save the file and close your editor software.
Done! Now your note will live with you forever. Or at least until your computer goes up in flames. But that problem can be avoided just by keeping a backup somewhere. On Fortressa there is an app called Syncthing that does backups without slowing down your computer.
Two days later…
You decide you want to check the content of your note. You want to know how your cat was two days ago, because now he doesn’t seem to be feeling well.
You can open the file using
open again, or you can try something faster.
The output should be:
2022-07-12 Today Prezzemolo is fine, but I think he ate too much lasagna this morning.
Now you know why he isn’t feeling well. The other day Prezzemolo ate too much lasagna.
Okay, got it. Less lasagna for Prezzemolo next time.
And also, now you know how to perform these actions in a terminal console:
- switch folders
- create new files
- edit files
- see file contents
It can be complicated right?
Fortunately, you don't need to know the terminal to use Fortressa. Just log into the platform and install the services you need 😉