Ubuntu 20.04 - Exercises
Last updated
Last updated
Goal: Learn simple Ubuntu processes in the desktop environment (GUI), then replicate everything using only the terminal command line (CLI).
The GUI is what most people think of when they interact with a computer. It's simple to use because you can interact visually, and you don't need to know any terminal commands.
When you open File Viewer, it will automatically bring you to the Home directory.
You can open a text file by clicking the applications button and searching "text"
Ctrl + S
to save filesYou can highlight documents and use the Delete
key, or right click and "Move to Trash"
Now let's complete the same exercises using only command line interface through the terminal.
Open the file viewer alongside the terminal as shown below so you to see how CLI affects GUI in real time.
Create a new directory called fishing-tips
in Home
Create a text file fish.txt
in the fishing-tips
directory
Delete fish.txt
Delete the fishing-tips
directory
Ctrl + Alt + T
If at any point you'd like a clean terminal window, you can use the clear
command
fishing-tips
1) Start by running the ls
command to see the contents of the Home folder
fishing-tips
directory (make directory):ls
to list Home directory contentsNotice how both the CLI and GUI now show fishing-tips
as a folder within Home.
fish.txt
within fishing-tips
1) Double click on the fishing-tips
folder in the GUI to enter the directory. It should be empty.
2) Use the cd
command to enter the fishing-tips
folder in CLI:
Notice how your working directory (in blue) has been updated to ~/fishing-tips
This indicates that your terminal session is now working within the fishing-tips
directory.
nano
to create fish.txt
The nano
command is used to create and edit files through the terminal
Because the file fish.txt
doesn't already exist, a blank file with that name will be created.
If fish.txt
already exists, then nano fish.txt
will open the file to be edited.
1) Type some fishing advice into the file, then use Ctrl + X
to Exit
2) Press Y
to save changes
3) Press ENTER
to save the file as fish.txt
4) Use ls
to show contents of fishing-tips
Notice how fish.txt
now appears in both CLI and GUI
fish.txt
in the GUIIf you double click fish.txt
, you'll see the files are identical whether created using text editor or nano
Close fish.txt
by clicking the X
in the upper right corner.
fish.txt
1) Use rm
to remove the fish.txt
file
2) Use ls
to list files within fishing-tips
Running ls
will not show any results because the folder is empty
Notice how fish.txt
no longer appears in the CLI or GUI windows.
Home
directory1) Navigate back to the Home directory in the File Viewer using the GUI
2) Navigate back to Home directory in CLI by entering cd ~
in the terminal:
3) Use ls
to show contents of Home directory
fishing-tips
folder1) Run rm -r
to remove an entire directory and all contents
2) Run ls
to show contents of Home directory
The fishing-tips
directory has been removed from both the CLI and GUI.
Congratulations, you can now create files and directories using the terminal and CLI!
Now that you understand the basics of Ubuntu, you can try running a validator on the Prater testnet!
The Ethereum testnets use Goerli ETH which has no value, which means you can test everything out before risking any of your ETH.
You should try everything on testnet before making a mainnet deposit.