8000 test · Pcodias/intro-to-python@a29b7b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit a29b7b7

Browse files
committed
test
1 parent 2077d35 commit a29b7b7

File tree

2 files changed

+66
-6
lines changed

2 files changed

+66
-6
lines changed

session_00/exercises_0.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Session 0 Exercises
2+
3+
## Refresher
4+
5+
---
6+
7+
### Bash commands:
8+
19
```bash
210
pwd # Prints to the console the path of your current working directory
311

@@ -12,7 +20,7 @@ cd .. # Gets out of the directory you are in
1220

1321
mkdir <directory_name> # Creates new directory
1422

15-
rmdir my_folder # Deletes an empty Directory (Folder)
23+
rmdir <directory_name> # Deletes an empty Directory (Folder)
1624

1725
rm -r <directory_name> # Deletes the directory and its contents recursively
1826

@@ -23,10 +31,30 @@ rm <file_name.txt/file_name.py> # Deletes file
2331

2432

2533

34+
echo "Hello!" # Print the text "Hello!" in the terminal window​
35+
36+
echo "Bonjour!" > file.txt # Writes the text "Bonjour!" in the file.txt file​
37+
38+
cat file.txt # Reads the file.txt file -> prints the text "Bonjour!" to the console​
39+
40+
41+
history # Displays your recently run Bash Commands​
42+
43+
clear # Clears the terminal screen
44+
2645
```
2746

47+
---
48+
49+
### Bash shortcuts:
50+
51+
- TAB - autocompletes commands, file names, or directory names for you​.
52+
53+
- UP/DOWN Arrows - Scroll backward and forwards through previous commands you’ve typed in the current session. ​
54+
55+
---
2856

29-
When you are done for the day, don't forget to commit and push your work using the git commands:
57+
### Git commands:
3058

3159
```shell
3260

@@ -37,3 +65,31 @@ git commit -m "<Short description of what you have worked on.>" # Saves changes
3765
git push origin main # Uploads local changes to your remote repository, on the main branch.
3866
```
3967

68+
---
69+
70+
## Section A
71+
72+
1. Use `pwd` to check in what directory you are.
73+
74+
2. Use `ls` to check what files and folders are in the current directory.
75+
76+
3. Using `cd <directory_name>` go into the `session_00` directory.
77+
78+
4. Create a new folder named `my_first_folder` using `mkdir <directory_name>`.
79+
80+
5. Delete the empty folder `my_first_folder` using `rmdir <directory_name>`.
81+
82+
6. Create a new folder named `animals` using `mkdir <directory_name>`.
83+
84+
7. Get into the `animals` folder by using `cd <directory_name>`.
85+
86+
8. Create 3 text files named `penguin.txt`, `dog.txt`, `bee.txt` by using `touch <file_name.txt>`.
87+
- Extra challenge: Can you do this while using `touch` only once?
88+
89+
9. Create your first python file called `snake.py` by using `touch <file_name.py>`.
90+
91+
10. Delete the `bee.txt` file with the `rm <file_name.txt>` command.
92+
93+
11.
94+
95+

session_00/slides_0.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
- Command Language for most Linux distributions​
6767

68-
- sh = Shell​
68+
- sh = Bourne Shell​
6969

7070
- The Shell is the layer between the Operating System and the User (or other services)
7171

@@ -92,7 +92,7 @@ cd .. # Gets out of the directory you are in
9292
```bash
9393
mkdir <directory_name> # Creates new directory
9494

95-
rmdir my_folder # Deletes an empty Directory (Folder)
95+
rmdir <directory_name> # Deletes an empty Directory (Folder)
9696

9797
rm -r <directory_name> # Deletes the directory and its contents recursively
9898

@@ -119,13 +119,17 @@ echo "Bonjour!" > file.txt # Writes the text "Bonjour!" in the file.txt file​
119119

120120
cat file.txt # Reads the file.txt file -> prints the text "Bonjour!" to the console​
121121

122+
122123
history # Displays your recently run Bash Commands​
123124

124125
wget <https://somewhere.com/afile.zip> # Downloads file/files from the link
125126

127+
man <command> # Displays the manual and description for the chosen command -> ex: man ls/pwd/cd/mkdir
128+
129+
126130
clear # Clears the terminal screen
127131

128-
man <command> # Displays the manual and description for the chosen command -> ex: man ls/pwd/cd/mkdir
132+
129133

130134
```
131135

@@ -139,7 +143,7 @@ man <command> # Displays the manual and description for the chosen command -> ex
139143

140144
- F3 - Repeat the previous command​.
141145

142-
- CTRL+C - Abort the current line you’re typing or a command that is currently executing​.
146+
- CTRL + C - Abort the current line you’re typing or a command that is currently executing​.
143147

144148

145149
---

0 commit comments

Comments
 (0)
0