Skip to content

Commit

Permalink
add history command, add chown command and update tail command (#12)
Browse files Browse the repository at this point in the history
* the history command

* add the chown command

* tail -f

* update readme

* typo
  • Loading branch information
dietercoopman authored Oct 2, 2021
1 parent 8b85f34 commit af38109
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Feel free to add new topics in case that you don't find one that you like from t
* TODO: [025-the-passwd-command.md](ebook/en/content/025-the-passwd-command.md)
* TODO: [026-the-w-command.md](ebook/en/content/026-the-w-command.md)
* TODO: [027-the-whoami-command.md](ebook/en/content/027-the-whoami-command.md)
* TODO: [028-the-history-command.md](ebook/en/content/028-the-history-command.md)
[028-the-history-command.md](ebook/en/content/028-the-history-command.md)
* TODO: [029-the-login-command.md](ebook/en/content/029-the-login-command.md)
* TODO: [030-the-lscpu-command.md](ebook/en/content/030-the-lscpu-command.md)
* TODO: [031-the-cp-command.md](ebook/en/content/031-the-cp-command.md)
Expand Down Expand Up @@ -124,6 +124,7 @@ Feel free to add new topics in case that you don't find one that you like from t
* TODO: [098-the-cut-command.md](ebook/en/content/098-the-cut-command.md)
* TODO: [099-the-sed-command.md](ebook/en/content/099-the-sed-command.md)
* TODO: [100-the-lynx-command.md](ebook/en/content/100-the-lynx-command.md)
* [101-the-chown-command.md](ebook/en/content/101-the-chown-command.md)

## 🔗 Links

Expand Down
10 changes: 10 additions & 0 deletions ebook/en/content/005-the-tail-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ You can also omit the `n` flag, this example will also give same result as above
tail -10 foo.txt
```

### Refresh the output on any new entry in a file

It possible to let tail output any new line added to the file your are looking into. So if a new log entry is written to the file, it will immediately be shown in your output. This can be done via `--follow` or `-f` as option.

Example:

```
tail -f foo.txt
```

Syntax:

```
Expand Down
20 changes: 19 additions & 1 deletion ebook/en/content/028-the-history-command.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
028-the-history-command.md
# The `history` command

If you type `history` you will get a list of the last 500 commands used. This gives you the possibility to copy paste commands that you executed in the past.

This is powerful in combination with grep. So you can search for a command in your command history.

### Examples:

1. If you want to search in your history for artisan commands you ran in the past.

```
history | grep artisan
```

2. If you only want to show the last 10 commands you can.

```
history 10
```
36 changes: 36 additions & 0 deletions ebook/en/content/101-the-chown-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# The `chown` command

The `chown` command makes it possible to change the ownership of a file or directory. Users and groups are fundamental in Linux, with `chown` you can
change the owner of a file or directory. It's also possible to change ownership on folders recursively

### Examples:

1. Change the owner of a file

```
chown user file.txt
```

2. Change the group of a file

```
chown :group file.txt
```

3. Change the user and group in one line

```
chown user:group file.txt
```

4. Change to ownership on a folder recursively

```
chown -R user:group folder
```

### Syntax:

```
chown [-OPTION] [DIRECTORY_PATH]
```

0 comments on commit af38109

Please sign in to comment.