Ubuntu 20.04 - Exercises
Ubuntu Exercises - Files and Directories
Goal: Learn simple Ubuntu processes in the desktop environment (GUI), then replicate everything using only the terminal command line (CLI).
Graphical User Interface (GUI)
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.
Text Editor
You can open a text file by clicking the applications button and searching "text"
Use Ctrl + S
to save files
Ctrl + S
to save filesTrash Bin
You can highlight documents and use the Delete
key, or right click and "Move to Trash"
Command Line Interface (CLI)
Now let's complete the same exercises using only command line interface through the terminal.
Open the Terminal and File Viewer
Open the file viewer alongside the terminal as shown below so you to see how CLI affects GUI in real time.
Exercise Overview
Create a new directory called
fishing-tips
in HomeCreate a text file
fish.txt
in thefishing-tips
directoryDelete
fish.txt
Delete the
fishing-tips
directory
Open a new Terminal with Ctrl + Alt + T
Ctrl + Alt + T
If at any point you'd like a clean terminal window, you can use the clear
command
Create new directory called fishing-tips
fishing-tips
1) Start by running the ls
command to see the contents of the Home folder
Result
Create fishing-tips
directory (make directory):
fishing-tips
directory (make directory):Use ls
to list Home directory contents
ls
to list Home directory contentsResult
Notice how both the CLI and GUI now show fishing-tips
as a folder within Home.
Create fish.txt
within fishing-tips
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.
Use nano
to create fish.txt
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.
Nano File Editor
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
Results
Notice how fish.txt
now appears in both CLI and GUI
Open fish.txt
in the 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.
Delete fish.txt
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
Result
Notice how fish.txt
no longer appears in the CLI or GUI windows.
Navigate back to the Home
directory
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
Result
Delete fishing-tips
folder
fishing-tips
folder1) Run rm -r
to remove an entire directory and all contents
2) Run ls
to show contents of Home directory
Result
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!
Ethereum Staking - Prater Testnet
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.
Learn how to run a testnet validator: Prater || Lighthouse Eth2 Staking Guide
Last updated