|
1 | 1 | # Session 0 Exercises
|
2 | 2 |
|
3 |
| -## Refresher |
| 3 | +## Section A |
| 4 | + |
| 5 | +Before you start, make sure that you are using the Shell 🐚 (not the console). |
| 6 | + |
| 7 | +1. Use `pwd` to check in what directory you are. |
| 8 | + |
| 9 | +2. Use `ls` to check what files and folders are in the current directory. |
| 10 | + |
| 11 | +3. Using `cd <directory_name>` go into the "session_00" directory. |
| 12 | + |
| 13 | +4. Create a new folder named "my_first_folder" using `mkdir <directory_name>`. |
| 14 | + |
| 15 | +5. Delete the empty folder "my_first_folder" using `rmdir <directory_name>`. |
| 16 | + |
| 17 | +6. Create a new folder named "animals" using `mkdir <directory_name>`. |
| 18 | + |
| 19 | +7. Get into the animals folder by using `cd <directory_name>`. |
| 20 | + |
| 21 | +8. Create 3 text files named "penguins.txt", "dogs.txt", "bees.txt" by using `touch <file_name.txt>`. |
| 22 | + - Extra challenge: Can you do this while using `touch` only once? |
| 23 | + |
| 24 | +9. Create your first python file called "snakes.py" by using `touch <file_name.py>`. |
| 25 | + |
| 26 | +10. Delete the bees.txt file with the `rm <file_name.txt>` command. |
| 27 | + |
| 28 | +11. Display the text "I love cake" to to the terminal by using `echo <text>`. |
| 29 | + |
| 30 | +12. Write the line "Whippet" in the dogs.txt file using `echo <text> > <file_name.txt>`. |
| 31 | + |
| 32 | +13. Display the date in the terminal using the `date` command. |
| 33 | + |
| 34 | +14. Display the recent history of your bash commands using the `history` command. |
| 35 | + |
| 36 | +15. Clear your terminal with the `clear` command. |
| 37 | + |
| 38 | + |
| 39 | +# Section B |
| 40 | + |
| 41 | +1. Get out of the `animals` folder using `cd ..` . |
| 42 | +2. Create a Markdown file called "my_markdown_recipe" using `touch <file_name.md>`. |
| 43 | +3. Inside the "my_markdown_recipe.md" file, type a recipe you like in Markdown format. If you don't have any ideas, and writing up in Markdown seems too much of a chore, just ask [ChatGPT](https://chat.openai.com/) to write one for you (Ex: "Write a burger recipe in markdown format."), and then paste it into your file. |
| 44 | + - When you are done, click on the "open preview" option to see the formatted version. |
| 45 | + |
| 46 | +Great job on getting so far, just one more section to go! |
| 47 | + |
| 48 | +# Section C |
| 49 | + |
| 50 | +1. Get out of the "session_00" folder using `cd ..` . |
| 51 | +2. Make sure you are in the "intro_to_python" directory by using the `pwd` command. |
| 52 | +3. Use `git status` to see what files and folders have been modified/c |
| 53 | +3. Use the `git add .` command to stage all the work you have done. |
| 54 | +4. Commit your work with `git commit -m` |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
4 | 60 |
|
5 | 61 | ---
|
6 | 62 |
|
| 63 | + |
| 64 | +## Cheat sheets |
| 65 | + - Command Line [cheat sheet](https://www.git-tower.com/blog/command-line-cheat-sheet/) |
| 66 | + - Git commands [cheat sheet](https://education.github.com/git-cheat-sheet-education.pdf) |
| 67 | +- Markdown [cheat sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## Refresher |
| 72 | + |
7 | 73 | ### Bash commands:
|
8 | 74 |
|
9 | 75 | ```bash
|
@@ -31,15 +97,17 @@ rm <file_name.txt/file_name.py> # Deletes file
|
31 | 97 |
|
32 | 98 |
|
33 | 99 |
|
34 |
| -echo "Hello!" # Print the text "Hello!" in the terminal window |
| 100 | +echo <text> # Displays in the terminal a line of text, Ex: echo Hello! |
35 | 101 |
|
36 |
| -echo "Bonjour!" > file.txt # Writes the text "Bonjour!" in the file.txt file |
| 102 | +echo <text> > <file_name.txt> # Writes a line of text in a file, Ex: echo Bonjour! > file.txt |
37 | 103 |
|
38 |
| -cat file.txt # Reads the file.txt file -> prints the text "Bonjour!" to the console |
| 104 | +cat <file_name.txt> # Reads the file and displays it line by line in the terminal, Ex: cat file.txt --> Bonjour! |
39 | 105 |
|
40 | 106 |
|
41 | 107 | history # Displays your recently run Bash Commands
|
42 | 108 |
|
| 109 | +date # Displays the date |
| 110 | + |
43 | 111 | clear # Clears the terminal screen
|
44 | 112 |
|
45 | 113 | ```
|
@@ -67,29 +135,6 @@ git push origin main # Uploads local changes to your remote repository, on the m
|
67 | 135 |
|
68 | 136 | ---
|
69 | 137 |
|
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 | 138 |
|
93 |
| -11. |
94 | 139 |
|
95 | 140 |
|
0 commit comments