Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Before attending the workshop, please ensure you have gone through these instruc
You'll need to make sure we can use bash on your computer.

* **Windows:** You can install BASH emulator, `Git BASH` via [git for Windows](https://gitforwindows.org). When you are installing Git, choose "Use the Nano editor by default". If you already have another BASH emulator installed (e.g. WSL), we can use your installed program instead.

**Note:** Git Bash on Windows sets its home directory to `/c/Users/YourUsername` rather than the Windows `C:\` drive root. If you download the workshop materials to your Downloads folder, you can navigate there with `cd ~/Downloads/Command-Line-Fundamentals-main`. Alternatively, you can move the workshop folder to your Git Bash home directory (type `cd ~` then `pwd` to see where that is).
* **Mac:** We can use Terminal on Mac. Applications > Terminal
* **Linux:** We can use Terminal on most Linux machines. Applications > Terminal

Expand Down
13 changes: 7 additions & 6 deletions lessons/1_Command_line.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ To copy or move files and directories, we use `cp` and `mv`. <br>
🥊**4-4**: Move the `test2.txt` file to a different directory (for example: `images`).<br>

To remove files and directories, we use `rm`. <br>
* `rm`: Removing a file. Use the `-rf` flag for folders: this is the `-r` flag (recursive) and `-f` flag (force the removal) combined.<br>
* `rm`: Removing a file. Use the `-r` flag for folders to remove directories recursively.<br>

🥊**4-5**: Navigate to `solutions`, and remove `test.txt`.<br>
🥊**4-6**: Navigate to `imgages`, and remove `test2.txt`.<br>
🥊**4-6**: Navigate to `images`, and remove `test2.txt`.<br>

⚠️ **Warning:** DO NOT EVER DO `rm -rf`. This will remove everything from your computer.<br>

Expand All @@ -155,7 +155,8 @@ How can we view files? This depends on the type of file we're working with, whic

Let's move to `data` folder and use `cat` and `less` to read `workshops.txt` file. <br>
🔔 **Question:** When should we use `less` instead of `cat`? <br>
💡 **Tip**: `Ctrl-C` will abort process. This shortcut comes in very handy!
💡 **Tip**: `Ctrl-C` will abort process. This shortcut comes in very handy!<br>

These commands are useful for quickly viewing files, but how about editing
files? There are several programs in bash you can use to do this: `vim`, `nano`,
and `emacs` are some examples.
Expand All @@ -181,9 +182,9 @@ This is what the command line interface with Nano looks like:
---

## 6. Dealing with outputs: Pipes and redirection
One of advantages of using the command line interface is the flexibility in interacting with the coputer when doing complex tasts. Redirection and pipes are two important operaters that allow simplifying workflows and automating tasks.
* **Redirection** (`>`, `>>`): Sends the output of a command to a file. `>` redirects output and verwrites the content of the specified file. `>>` appends the output to the end of the specified file without overwriting its existing contents. It also creates the file if it does not exist.
* **Pipes** (`|`): Connects the output of cone command to the input of another. <br>
One of advantages of using the command line interface is the flexibility in interacting with the computer when doing complex tasks. Redirection and pipes are two important operators that allow simplifying workflows and automating tasks.
* **Redirection** (`>`, `>>`): Sends the output of a command to a file. `>` redirects output and overwrites the content of the specified file. `>>` appends the output to the end of the specified file without overwriting its existing contents. It also creates the file if it does not exist.
* **Pipes** (`|`): Connects the output of one command to the input of another. <br>

🥊**6-1**: save a list of files in the working directory as “filenames.txt”

Expand Down