Skip to content

Commit 4c74027

Browse files
committed
Add tips
1 parent 5a2e030 commit 4c74027

1 file changed

Lines changed: 57 additions & 13 deletions

File tree

assets/tips.md

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Tips
22

33
## Clear and reset the terminal
4-
To clear the terminal use the command below or press Ctrl+L on your keyboard.
4+
To clear the terminal, use the command below or press Ctrl+L on your keyboard.
55

66
```[clear](/man/clear)```
77

@@ -18,7 +18,7 @@ Search command history for query.
1818

1919
```[history](/man/history) | [grep](/man/grep) [query]```
2020

21-
or press ctrl + r to search and execute commands from the history.
21+
Or press Ctrl+R to search and execute commands from the history.
2222

2323
## Close a frozen window/application
2424
Execute the command and click on the frozen window.
@@ -32,14 +32,14 @@ Or find the process id of an application and kill it.
3232
```[kill](/man/kill) [processID]```
3333

3434
## Tab Completion
35-
This might save you a lot of time. If you e.g. want to delete a file with a very long name you can type the first few characters of the name and press TAB to auto complete the name. If there is more then one possibilities and you press TAB twice you get a list of all possibilities.
35+
This might save you a lot of time. If you e.g. want to delete a file with a very long name you can type the first few characters of the name and press TAB to auto complete the name. If there is more than one possibility and you press TAB twice, you get a list of all possibilities.
3636

3737
## Temporary aliases
3838
Save yourself time and create aliases for your most used commands. Aliases are like custom shortcuts.
3939

4040
```alias [name]="[command]"```
4141

42-
Example: Find out your external ip.
42+
Example: Find out your external IP.
4343

4444
```alias publicip="[curl](/man/curl) ifconfig.me"```
4545

@@ -143,8 +143,8 @@ Shell special characters are interpreted by the shell as soon as it is given the
143143
| **>>** | These symbols are used for redirection. |
144144
| **!!** | Repeat the last command |
145145
| | `[sudo](/man/sudo) !!` |
146-
| **!*** | Change command keep all arguments |
147-
| | `!* [tail](/man/tail)` |
146+
| **!*** | Change the command, keep all arguments |
147+
| | `[tail](/man/tail) !*` |
148148
| **^** | Quick history substitution, changing one string to another. |
149149
| | `^png^xcf^` |
150150
| **#** | Turns the line into a comment; the line is not processed in any way. |
@@ -159,11 +159,11 @@ Don't confuse shell special characters with special characters in regular expres
159159
| Position | Meaning |
160160
|----------|---------|
161161
| 1 | File type: '-' for a regular file, 'd' for a directory, 'l' for a symbolic link. |
162-
| 2 | Owner permission |
163-
| 3 | Group permission |
164-
| 4 | Other permission |
162+
| 2-4 | Owner permissions (rwx) |
163+
| 5-7 | Group permissions (rwx) |
164+
| 8-10 | Other permissions (rwx) |
165165

166-
In the shown example the user has read, write and execute permissions but the group and others have only read permissions.
166+
Example: `-rwxr--r--` means the owner has read, write and execute permissions, but the group and others have only read permissions.
167167

168168
## Modify file permissions
169169

@@ -189,17 +189,61 @@ Permission types:
189189
| **w** | Write |
190190
| **x** | Execute |
191191

192-
Operators for the modification command are **+** (plus) and **** (minus).
192+
Operators for the modification command are **+** (plus) and **-** (minus).
193193

194194
## Set file permissions via binary references
195195
Example: Give the owner read and write permission, the group read permission and no permission to other.
196196

197197
```[chmod](/man/chmod) 640 test.txt```
198198

199-
The first number represents the **owner** permissions, the second the **group** permissions and the last number for all other users. The numbers are a binary representation of the **rwx** string.
199+
The first number represents the **owner** permissions, the second the **group** permissions, and the last number the permissions for all other users. The numbers are a binary representation of the **rwx** string.
200200

201-
| Permission | Binary |
201+
| Permission | Value |
202202
|------------|--------|
203203
| r | 4 |
204204
| w | 2 |
205205
| x | 1 |
206+
207+
## Running commands in the background
208+
If a command is taking a long time, you can suspend it with **Ctrl+Z** and then resume it in the background.
209+
210+
```[bg](/man/bg)```
211+
212+
To bring a background job back to the foreground:
213+
214+
```[fg](/man/fg)```
215+
216+
To list all background jobs in the current session:
217+
218+
```[jobs](/man/jobs)```
219+
220+
If you want a command to keep running even after you log out, use nohup.
221+
222+
```[nohup](/man/nohup) [command] &```
223+
224+
For long-running tasks or managing multiple terminal sessions, use tmux. It lets you detach and reattach sessions, so your work survives disconnects.
225+
226+
```[tmux](/man/tmux) new -s mysession```
227+
228+
Detach from a session with **Ctrl+B** then **D**. Reattach later with:
229+
230+
```[tmux](/man/tmux) attach -t mysession```
231+
232+
## Scheduling tasks with cron
233+
Edit your user's crontab to schedule recurring tasks.
234+
235+
```[crontab](/man/crontab) -e```
236+
237+
Each line in the crontab follows a five-field format:
238+
239+
| Field | Value |
240+
|-------|-------|
241+
| Minute | 0 - 59 |
242+
| Hour | 0 - 23 |
243+
| Day of month | 1 - 31 |
244+
| Month | 1 - 12 |
245+
| Day of week | 0 - 7 (0 and 7 are Sunday) |
246+
247+
Example: Run a backup script every day at 2 AM.
248+
249+
```0 2 * * * /home/user/backup.sh```

0 commit comments

Comments
 (0)