Skip to content

Commit

Permalink
docs(knowledge-base/hack-the-tunnels-2024): add bash commands review
Browse files Browse the repository at this point in the history
  • Loading branch information
MFarabi619 committed Oct 18, 2024
1 parent e1a233d commit deb9219
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ At this point, your file tree (Explorer) in VS Code should look like this:
<div className="steps">
<div className="step">
### Open VS Code terminal
You can open/close the VS Code terminal with <kbd>&#8984;/Ctrl + `</kbd>.
You can open/close the VS Code terminal with <kbd>&#8984;/Ctrl + ~</kbd>.
</div>
<div className="step">
Expand Down Expand Up @@ -400,3 +400,18 @@ Save, and run the file again :)
</div>
</div>
## Bash commands review
| **Action** | **Command** |
|-------------------------------------------|----------------------------------------|
| Print 'Hello' to the terminal | `echo 'Hello'` |
| See your username | `whoami` |
| Print working directory | `pwd` |
| Create a directory | `mkdir your-directory-name` |
| Change into directory | `cd your-directory-name` |
| Go one directory back | `cd ..` |
| Remove directory | `rm -rf your-directory-name` |
| List contents of directory | `ls` |
| List contents of directory including hidden files | `ls -a` |
| Create file | `touch your-file-name` |
| Remove file | `rm your-file-name` |
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ git commit

You should see.
```sh
On branch master
On branch main

Initial commit

Expand Down Expand Up @@ -202,8 +202,8 @@ Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 270 bytes | 270.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To https://github.com/MFarabi619/hack-the-tunnels-git-workshop.git
* [new branch] HEAD -> master
branch 'master' set up to track 'origin/master'.
* [new branch] HEAD -> main
branch 'main' set up to track 'origin/main'.
✓ Pushed commits to https://github.com/MFarabi619/hack-the-tunnels-git-workshop.git
```

Expand Down Expand Up @@ -246,7 +246,7 @@ If you see `(END)`, press <kbd>q</kbd> to quit.

Make a new branch called `my-branch`.
```sh title="Terminal"
git checkout -b main
git checkout -b my-branch
```
```
Switched to a new branch 'my-branch'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,38 +136,44 @@ Follow the on-screen instructions to add Homebrew to your `PATH`.
- Run these commands in your terminal to add Homebrew to your PATH:
echo >> /home/name/.bashrc // [!code highlight]
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/name/.bashrc // [!code highlight]
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" // [!code highlight]
- Install Homebrew's dependencies if you have sudo access:
sudo apt-get install build-essential
sudo apt-get install build-essential // [!code highlight]
For more information, see:
https://docs.brew.sh/Homebrew-on-Linux
- We recommend that you install GCC:
brew install gcc
brew install gcc // [!code highlight]
- Run brew help to get started
- Further documentation:
https://docs.brew.sh
```
<Callout type="error" title="Don't copy-paste what's here on the site, look at your terminal! Replace `name` with your username.">
<Callout type="error" title="This is just an example. Don't copy-paste what's here on the site, look at your terminal! Replace `name` with your username.">
</Callout>
```sh title="Terminal"
echo >> /home/name/.bashrc
```
<Callout type="error" title="This will be slightly different for MacOS.">
<Callout type="error" title="This is just an example. This will be slightly different for MacOS.">
</Callout>
```sh title="Terminal"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/name/.bashrc
```
<Callout title="After you're done the two steps above, do this.">
<Callout title="After you're done the two steps above, do these.">
</Callout>
```sh title="Terminal"
sudo apt-get install build-essential
```
```sh title="Terminal"
brew install gcc
```
<Accordions>
<Accordion title="Why are we using Homebrew for Ubuntu instead of apt?">
- Homebrew and `apt` [(Advanced Package Tool)](https://en.wikipedia.org/wiki/APT_(software)) are both package managers.
Expand Down

0 comments on commit deb9219

Please sign in to comment.