-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into switch-to-https
- Loading branch information
Showing
12 changed files
with
104 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Dollar sign | ||
|
||
> Expand a bash variable. | ||
> More information: <https://gnu.org/software/bash/manual/bash.html#Shell-Variables>. | ||
- Print a variable: | ||
|
||
`echo ${{VARIABLE}}` | ||
|
||
- Print the exit status of the previous command: | ||
|
||
`echo $?` | ||
|
||
- Print a random number between 0 and 32767: | ||
|
||
`echo $RANDOM` | ||
|
||
- Print one of the prompt strings: | ||
|
||
`echo ${{PS1|PS2|PS3|PS4}}` | ||
|
||
- Expand with the output of `command` and run it. Same as enclosing `command` in backtics: | ||
|
||
`$({{command}})` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Greater than | ||
|
||
> Redirect output to a file. | ||
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Output>. | ||
- Redirect `stdout` to a file: | ||
|
||
`{{command}} > {{path/to/file}}` | ||
|
||
- Append to a file: | ||
|
||
`{{command}} >> {{path/to/file}}` | ||
|
||
- Redirect both `stdout` and `stderr` to a file: | ||
|
||
`{{command}} &> {{path/to/file}}` | ||
|
||
- Redirect both `stdout` and `stderr` to `/dev/null` to keep the terminal output clean: | ||
|
||
`{{command}} &> /dev/null` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Less than | ||
|
||
> Redirect a file to `stdin`. | ||
> Achieves the same effect as `cat file.txt |`. | ||
> More information: <https://gnu.org/software/bash/manual/bash.html#Redirecting-Input>. | ||
- Redirect a file to `stdin`: | ||
|
||
`{{command}} < {{path/to/file.txt}}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Vertical bar | ||
|
||
> Pipe data between programs. | ||
> More information: <https://gnu.org/software/bash/manual/bash.html#Pipelines>. | ||
- Pipe `stdout` to `stdin`: | ||
|
||
`{{command}} | {{command}}` | ||
|
||
- Pipe both `stdout` and `stderr` to `stdin`: | ||
|
||
`{{command}} |& {{command}}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# apt-clone | ||
|
||
> Clone/backup/restore the package state of a Debian-based system. | ||
> More information: <https://github.com/mvo5/apt-clone>. | ||
- Clone the package state of the current system into a specified directory: | ||
|
||
`apt-clone clone {{path/to/directory}}` | ||
|
||
- Create a clone file (`tar.gz`) for backup purposes: | ||
|
||
`apt-clone clone --destination {{path/to/backup.tar.gz}}` | ||
|
||
- Restore the package state from a clone file: | ||
|
||
`apt-clone restore {{path/to/backup.tar.gz}}` | ||
|
||
- Show information about a clone file (e.g., the release, architecture): | ||
|
||
`apt-clone info {{path/to/backup.tar.gz}}` | ||
|
||
- Check if the clone file can be restored on the current system: | ||
|
||
`apt-clone restore {{path/to/backup.tar.gz}} --destination {{path/to/restore}}` |