Professional Documents
Culture Documents
02 Eng
02 Eng
02 Eng
In this part, you will learn the basic commands of the Bash language. We will use the computers in the computer classroom.
We will use the Debian operating system on the computer. The choice is made as soon as we turn on the computer, where we select
the Debian environment and press the Enter key .
On the screen, we have a menu at the top left, through which we access the programs, and in the lower part there are some icons.
Among them, we will use the icon with a black screen (terminal). Among the programs, we will look for a web browser (Application >
Internet > Firefox or another browser of your choice).
In the terminal, we'll take a quick look at Bash commands, which are described in more detail in Introduction to Bash, which you can
find on the course's website:
pwd
which we enter in the terminal and press the Enter key . The address of the folder where we are located will be displayed in
the terminal:
/home/username
• check which files are present in the folder with the command:
ls
which means sheet... In this case, only the list of folders and files (if they are present) is printed. Various options can be added
to commands. As an example of the ls command, we can write:
ls -l
ls -lr
ls -lrt
ls -lrth
ÿ
• move to the Pictures folder. If we are in the folder /home/username, just write it
cd Pictures/
cd /home/username/Pictures/
• we will save the image from the web. In the web browser, find the website Astronomical pictures of the day (https://apod.fmf.uni-
lj.si) and click on the picture. Highlight the address and press CTRL + C to save the link to the clipboard ,
• We open the terminal again, where we write the command wget and copy the web address of the image
wget https://apod.fmf.uni-lj.si/image/2110/MonumentValleyRoad_Abramyan_2048.jpg
• We open the image and examine it with the Gimp program, which we start from the command line:
1
Machine Translated by Google
gimp MonumentValleyRoad_Abramyan_2048.jpg
In such a case, we ran the program in the command line and until the program is stopped (closed), the terminal is locked. Whatever
ÿ
we write in it will not be executed. But if we want to run the program from the command line and move it to the background (thus freeing
up the command line), write:
mkdir APOD
and verify that it is indeed located in /home/username/Pictures/ with the ls command. What happens if we want to create another folder
called Astronomical Image? Check what happens if you write:
We created two folders, Astronomy and Image, instead of a single folder. This is because the mkdir command does not understand a
space as part of a full name. In case we would like to have the full name, we will enter:
In this case, the command will build the Astronomical Image folder.
• Let's remove the folder. Folders can be removed using the command
• Create a copy of the document in another folder. We will copy the image we downloaded from the web into the folder
Astronomical image.
cd Astronomical\ picture/
ls -l
cd ..
command will take us to the folder containing the Astronomical Image folder. But where do we find ourselves if we just write the
command
cd
In this case, the command brings us to the initial folder, usually by default it is set to the home folder /home/username.
cd /home/username/Pictures
rm -r Astronomical\ image
ÿ
Addendum 1: If you want, you can create shortcuts for frequently used commands to reduce typing in the terminal. For example, if you
want .bashrc
2
Machine Translated by Google
Appendix 2: You can look at the user help for each command. It is enough to write the command man and the command you are
interested in in the terminal, for example:
man ssh
You move in the display by pressing the long key, and to return to the command line, press the q key .
mv MonumentValleyRoad_Abramyan_2048.jpg APOD/
ls -l APOD/
exit