Skip to content
Snippets Groups Projects
Unverified Commit 8fd13ea5 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

fix typos in 3

parent d61ba71b
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ title: First step in a terminal
Objective: learn to use basic terminal command
Congratulation you are now connected on your VM !
Congratulations you are now connected on your VM !
The first thing that you can see is a welcome message (yes GNU/Linux users are polite and friendly), and information on your distribution.
......@@ -16,24 +16,24 @@ The first thing that you can see is a welcome message (yes GNU/Linux users are p
What is the distribution installed on your VM ?
You can go to this distribution website and have a look at the liste of firm using it.
You can go to this distribution website and have a look at the list of firms using it.
## Shell
A command-line interpreter (or shell), is a software designed to read lines of text entered by a user to interact with an OS.
To simplify the shell execute the following infinite loop:
To simplify the shell executes the following infinite loop:
1. read a line
2. translate this line as a program execution with it's parameters
2. translate this line as a program execution with its parameters
3. launch the corresponding program with the parameters
3. wait for the program to finish
4. Go back to 1.
When you open a terminal on an Unix like OS, you will have a **prompt** displayed: it can end with a **$** or a **%** caracter depending on your configuration. As long as you see your prompt, it means that you are in step **1.**, if no prompt is visible, you are in step **4.** or you have set up a very minimalist configuration for your shell.
When you open a terminal on an Unix-like OS, you will have a **prompt** displayed: it can end with a **$** or a **%** character depending on your configuration. As long as you see your prompt, it means that you are in step **1.**, if no prompt is visible, you are in step **4.** or you have set up a very minimalist configuration for your shell.
<img src="./img/prompt.png" alt="prompt" style="zoom:150%;" />
The blinking square or vertical bar represent your **cursor**. Shell predate graphical interfaces, so most of the time you won't be able to move this cursor with your mouse, but with the directional arrows (left and right).
The blinking square or vertical bar represents your **cursor**. Shell predates graphical interfaces, so most of the time you wont be able to move this cursor with your mouse, but with the directional arrows (left and right).
On the IFB, your prompt is a **$**
......@@ -41,11 +41,11 @@ On the IFB, your prompt is a **$**
etudiant@VM:~$
```
You can identify the following information form your prompt: **etudiant** is your login and **VM** is the name of your VM (**~** is where you are on the computer, but we will come back to that later).
You can identify the following information from your prompt: **etudiant** is your login and **VM** is the name of your VM (**~** is where you are on the computer, but we will come back to that later).
On Ubuntu 20.04, the default shell is [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) while on recent version of macOS it's [zsh](https://en.wikipedia.org/wiki/Z_shell). There are [many different shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters), for example, Ubuntu 20.04 also have [sh](https://en.wikipedia.org/wiki/Bourne_shell) installed.
On Ubuntu 20.04, the default shell is [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) while on recent version of macOS its [zsh](https://en.wikipedia.org/wiki/Z_shell). There are [many different shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters), for example, Ubuntu 20.04 also has [sh](https://en.wikipedia.org/wiki/Bourne_shell) installed.
## Launching programs
## Launching Programs
You can launch every program present on your computer from the shell. The syntax will always be the following:
......@@ -55,7 +55,7 @@ etudiant@VM:~$ program_name option_a option_b option_c [...] option_n
And pressing **enter** to execute your command.
For example we can launch the `cal` software by typing the following command and pressing **enter**:
For example, we can launch the `cal` software by typing the following command and pressing **enter**:
```sh
cal
......@@ -63,12 +63,12 @@ cal
When you launch a command, various things can happen:
- Information can be diplayed in the shell
- Information can be displayed in the shell
- Computation can be made
- Files can we read or written
- etc.
We can pass argument to the `cal` software the following way
We can pass argument to the `cal` software the following way.
```sh
cal -N
......@@ -80,12 +80,12 @@ You can add as many parameters as you want to your command, try `-N -C` what is
The `-H` option display the month of a given date in a `yyyy-mm-dd` format. Try to display your month of birth in vertical format.
Traditionally, parameters are *named* which mean that they are in the form of:
Traditionally, parameters are *named* which means that they are in the form of:
* `-X` for an on/off option (like `cal -N`)
* `-X something` for an input option (like `cal -H yyyy-mm-dd`)
Here the name of the paremeter is `X`, but software can also accept list of unamed parameter. Try the following:
Here the name of the parameter is `X`, but software can also accept list of unnamed parameters. Try the following:
```sh
cal 2
......@@ -97,9 +97,9 @@ What is the difference for the parameter value `2` in the first and third comman
## Moving around
For the `cal` program, the position in the file system is not important (it's not going to change the calendar). However, for most tools that are able to read or write files, it's important to know where you are. This is the first real difficulty with command line interface: you need to remember where you are.
For the `cal` program, the position in the file system is not important (its not going to change the calendar). However, for most tools that are able to read or write files, its important to know where you are. This is the first real difficulty with command line interface: you need to remember where you are.
If you are lost you can **p**rint your **w**orking **d**irectory (i.e. where you are now, working) with the command
If you are lost, you can **p**rint your **w**orking **d**irectory (i.e., where you are now, working) with the command.
```sh
pwd
......@@ -107,7 +107,7 @@ pwd
Like `cal`, the `pwd` command return textual information
By default when you log on an Unix system you are in your **HOME** directory. Every user (except one) should have it's home directory in the `/home/`folder.
By default when you log on an Unix system, you are in your **HOME** directory. Every user (except one) should have its home directory in the `/home/`folder.
To **c**hange **d**irectory you can type the command `cd`, `cd` take one argument: the path of the directory where you want to go. go to the `/home` directory.
......@@ -117,27 +117,27 @@ cd /home
The `cd` command don't return any textual information, but change the environement of the shell (you can confirm it with ` pwd`) ! You can also see this change in your prompt:
The `cd` command doesn’t return any textual information, but change the environment of the shell (you can confirm it with ` pwd`) ! You can also see this change in your prompt:
```sh
`etudiant@VM:/home$`
```
What happend when you type `cd` without any argument ?
What happens when you type `cd` without any argument ?
What is the location shown in your prompt ? Is it coerent with the `pwd` information ? Can you `cd` to the `pwd` path ?
What is the location shown in your prompt ? Is it coherent with the `pwd` information ? Can you `cd` to the `pwd` path ?
When we move around a file system, we often want to see what is in a given folde. We want to **l**i**s**t the directory content. Go back to the `/home` directory and use to the `ls` command see how many have a home directory there.
We will see various option of the `ls` command, throughout this course. Try the `-a` option.
We will see various options for the `ls` command, throughout this course. Try the `-a` option.
```sh
ls -a
```
What changed commpared to the `ls` command without this option ?
What changed compared to the `ls` command without this option ?
Go to your home folder with the bare `cd` command and run the `ls -a` command again. The `-a` option make the `ls` command list hidden files and folders. On Unix systems, hidden files and folders are every files and folders whose name start with a "**.**".
Go to your home folder with the bare `cd` command and run the `ls -a` command again. The `-a` option makes the `ls` command list hidden files and folders. On Unix systems, hidden files and folders are all files and folders whose name starts with a "**.**".
Can you `cd` to "**.*" ?
......@@ -145,7 +145,7 @@ Can you `cd` to "**.*" ?
cd .
```
What happend ?
What happened ?
Can you cd to "**..**" ?
......@@ -155,33 +155,10 @@ cd ..
What appended ?
Repeat 3 times the previous command (you can use the upper directionnal arrow to repeat the last command).
Repeat 3 times the previous command (you can use the upper directional arrow to repeat the last command).
What append ?
You can use the `-l` option in combinaison with the `-a` option to know more about those folder.
## Unix file system structure
> On a UNIX system, everything is a file ; if something is not a file, it is a process.
>
> Machtelt Garrels
The followings are files:
- a text file
- an executable file
- a folder
- a keyboard
- a disk
- an usb key
- ...
This mean that your keyboard is represented as a file within the OS.
This file system is organized as a tree. As you have seen every folder has a parent folder exept the `/` folder whose parent is itself.
Every file can be accessed by an **absolute path** starting at the root. Your user home folder can be accessed with the path `/home/etudiant/`. Go to your user home folder.
We can also access file with a **relative path**, using the special folder "**..**". From your home folder, go to the *ubuntu* user home folder without passing by the root (we will see use of the "**.**" folder later).
You can use the `-l` option in combination with the `-a` option to know more about those folders.
[You can now go to the Unix file system.](http://perso.ens-lyon.fr/laurent.modolo/unix/4_unix_file_system.html)
\ No newline at end of file
all: index.html 1_understanding_a_computer.html 2_using_the_ifb_cloud.html 3_first_steps_in_a_terminal.html
all: index.html 1_understanding_a_computer.html 2_using_the_ifb_cloud.html 3_first_steps_in_a_terminal.html 4_unix_file_system.html
index.html: index.md github-pandoc.css
pandoc -s -c github-pandoc.css index.md -o index.html
......@@ -11,3 +11,7 @@ index.html: index.md github-pandoc.css
3_first_steps_in_a_terminal.html: 3_first_steps_in_a_terminal.md github-pandoc.css
pandoc -s --toc -c github-pandoc.css 3_first_steps_in_a_terminal.md -o 3_first_steps_in_a_terminal.html
4_unix_file_system.html: 4_unix_file_system.md github-pandoc.css
pandoc -s --toc -c github-pandoc.css 4_unix_file_system.md -o 4_unix_file_system.html
......@@ -5,8 +5,7 @@ title: # Unix / command line training course
# Unix / command line training course
1. [Understanding a computer](http://perso.ens-lyon.fr/laurent.modolo/unix/1_understanding_a_computer.html)
2. [Using the IFB cloud](http://perso.ens-lyon.fr/laurent.modolo/unix/2_using_the_ifb_cloud.html)
3. [First step in a terminal](http://perso.ens-lyon.fr/laurent.modolo/unix/3_first_steps_in_a_terminal.html)
4. [The Unix file system.](http://perso.ens-lyon.fr/laurent.modolo/unix/4_unix_file_system.html)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment