Commit d2a5751a authored by bobloblaw's avatar bobloblaw
Browse files

Updates basics_of_linux.md

Auto commit by GitBook Editor
parent d9460362
Loading
Loading
Loading
Loading
+23 −40
Original line number Diff line number Diff line
@@ -8,69 +8,52 @@ The shell, or the terminal is a really useful tool. Bash is the standard shell o

### Navigating

`pwd`
`pwd` - Print working directory

Print working directory
`cd` - Change directory

**`cd`**
`cd ~` - Change directory to your home directory

Change directory
`cd -` - Go back to previous directory

`cd ~`
### Looking at files

**`ls`**  
List files in directory
`ls` - List files in directory

Sort list by time. -time -reverse
`ls -ltr` - Sort list by last modified. -time -reverse

```bash
ls -ltr
```

**`touch`**

Create a new file.

**`file`**

Show info about file.

**`cat`**
`file` - Show info about file.

Output content of file.
`cat` - Output content of file.

**less**
`less` - Output file but thest little bit at a time

Output file but thest little bit at a time

**cp**
### Working with files

Copy
`touch` - Create a new file.

**mkdir**
`cp` - Copy

Make directory.
`mkdir` - Make directory.

To make an entire directory structure add the **-p** flag

```
```bash
# Make entire directory structure
mkdir -p new/thisonetoo/and/this/one
```

**rm**  
Remove file

Remmove recursivly and its content. Very dangerous command!
`rm` - Remove file

```
```bash
# Remove recursively and its content. Very dangerous command!
rm -rf ./directory
```

Watch the command destroy an enire machine: [https://www.youtube.com/watch?v=D4fzInlyYQo](https://www.youtube.com/watch?v=D4fzInlyYQo)
Watch the command destroy an entire machine: [https://www.youtube.com/watch?v=D4fzInlyYQo](https://www.youtube.com/watch?v=D4fzInlyYQo)

`rmdir` - Remove empty directory

**rmdir**

Remove empty directory

**history**