mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-12 21:47:52 +00:00
Update cheatsheets
This commit is contained in:
@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Match a variable against string literals to decide which command to run:
|
||||
|
||||
`case {{$COUNTRULE}} in {{words}}) {{wc -w README}} ;; {{lines}}) {{wc -l README}} ;; esac`
|
||||
`case {{$COUNTRULE}} in {{words}}) {{wc --words README}} ;; {{lines}}) {{wc --lines README}} ;; esac`
|
||||
|
||||
- Combine patterns with |, use * as a fallback pattern:
|
||||
|
||||
`case {{$COUNTRULE}} in {{[wW]|words}}) {{wc -w README}} ;; {{[lL]|lines}}) {{wc -l README}} ;; *) {{echo "what?"}} ;; esac`
|
||||
`case {{$COUNTRULE}} in {{[wW]|words}}) {{wc --words README}} ;; {{[lL]|lines}}) {{wc --lines README}} ;; *) {{echo "what?"}} ;; esac`
|
||||
|
||||
- Allow matching multiple patterns:
|
||||
|
||||
|
||||
16
tldr/cmake
16
tldr/cmake
@@ -12,14 +12,6 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`cmake {{path/to/project_directory}}`
|
||||
|
||||
- Generate a build recipe, with build type set to `Release` with CMake variable:
|
||||
|
||||
`cmake {{path/to/project_directory}} -D {{CMAKE_BUILD_TYPE=Release}}`
|
||||
|
||||
- Generate a build recipe using `generator_name` as the underlying build system:
|
||||
|
||||
`cmake -G {{generator_name}} {{path/to/project_directory}}`
|
||||
|
||||
- Use a generated recipe in a given directory to build artifacts:
|
||||
|
||||
`cmake --build {{path/to/build_directory}}`
|
||||
@@ -28,6 +20,14 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`cmake --install {{path/to/build_directory}} --strip`
|
||||
|
||||
- Generate a build recipe, with build type set to `Release` with CMake variable:
|
||||
|
||||
`cmake {{path/to/project_directory}} -D {{CMAKE_BUILD_TYPE=Release}}`
|
||||
|
||||
- Generate a build recipe using `generator_name` as the underlying build system:
|
||||
|
||||
`cmake -G {{generator_name}} {{path/to/project_directory}}`
|
||||
|
||||
- Install the build artifacts using the custom prefix for paths:
|
||||
|
||||
`cmake --install {{path/to/build_directory}} --strip --prefix {{path/to/directory}}`
|
||||
|
||||
12
tldr/kate
12
tldr/kate
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# kate
|
||||
|
||||
> KDE's advanced text editor.
|
||||
> More information: <https://kate-editor.org/>.
|
||||
> More information: <https://docs.kde.org/stable/en/kate/kate/fundamentals.html#starting-from-the-command-line>.
|
||||
|
||||
- Open specific files:
|
||||
|
||||
@@ -18,20 +18,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Create a new editor instance even if one is already open:
|
||||
|
||||
`kate --new`
|
||||
`kate {{[-n|--new]}}`
|
||||
|
||||
- Open a file with the cursor at the specific line:
|
||||
|
||||
`kate --line {{line_number}} {{path/to/file}}`
|
||||
`kate {{[-l|--line]}} {{line_number}} {{path/to/file}}`
|
||||
|
||||
- Open a file with the cursor at the specific line and column:
|
||||
|
||||
`kate --line {{line_number}} --column {{column_number}} {{path/to/file}}`
|
||||
`kate {{[-l|--line]}} {{line_number}} {{[-c|--column]}} {{column_number}} {{path/to/file}}`
|
||||
|
||||
- Create a file from `stdin`:
|
||||
|
||||
`cat {{path/to/file}} | kate --stdin`
|
||||
`cat {{path/to/file}} | kate {{[-i|--stdin]}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`kate --help`
|
||||
`kate {{[-h|--help]}}`
|
||||
|
||||
@@ -5,21 +5,25 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# genfstab
|
||||
|
||||
> Arch Linux install script to generate output suitable for addition to an fstab file.
|
||||
> More information: <https://manned.org/genfstab.8>.
|
||||
> Generate output suitable for addition to the `/etc/fstab` file.
|
||||
> More information: <https://manned.org/genfstab>.
|
||||
|
||||
- Display an fstab compatible output based on a volume label:
|
||||
|
||||
`genfstab -L {{path/to/mount_point}}`
|
||||
|
||||
- Display an fstab compatible output based on a volume UUID:
|
||||
|
||||
`genfstab -U {{path/to/mount_point}}`
|
||||
|
||||
- A usual way to generate an fstab file, requires root permissions:
|
||||
- Generate the `/etc/fstab` file using volume UUIDs during an Arch Linux installation (requires root permissions):
|
||||
|
||||
`genfstab -U {{/mnt}} >> {{/mnt/etc/fstab}}`
|
||||
|
||||
- Append a volume into an fstab file to mount it automatically:
|
||||
- Display fstab-compatible output based on volume labels:
|
||||
|
||||
`genfstab -L {{path/to/mount_point}}`
|
||||
|
||||
- Display fstab-compatible output based on volume UUIDs:
|
||||
|
||||
`genfstab -U {{path/to/mount_point}}`
|
||||
|
||||
- Display fstab-compatible output based on the specified identifier:
|
||||
|
||||
`genfstab -t {{LABEL|UUID|PARTLABEL|PARTUUID}}`
|
||||
|
||||
- Append a volume into the `/etc/fstab` file to mount it automatically:
|
||||
|
||||
`genfstab -U {{path/to/mount_point}} | sudo tee -a /etc/fstab`
|
||||
|
||||
13
tldr/linux/linux-boot-prober
Normal file
13
tldr/linux/linux-boot-prober
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# linux-boot-prober
|
||||
|
||||
> Probe a partition for bootable operating systems.
|
||||
> More information: <https://github.com/MaddieM4/os-prober>.
|
||||
|
||||
- Probe a partition:
|
||||
|
||||
`sudo linux-boot-prober {{/dev/sdXY}}`
|
||||
@@ -19,7 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Make a package, install its dependencies then install it to the system:
|
||||
|
||||
`makepkg {{[-s|--syncdeps]}} {{[-i|--install]}}`
|
||||
`makepkg {{[-si|--syncdeps --install]}}`
|
||||
|
||||
- Make a package, but skip checking the source's hashes:
|
||||
|
||||
@@ -36,3 +36,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Generate and save the source information into `.SRCINFO`:
|
||||
|
||||
`makepkg --printsrcinfo > .SRCINFO`
|
||||
|
||||
- Download the source and install only the build dependencies for a program:
|
||||
|
||||
`makepkg {{[-so|--syncdeps --nobuild]}}`
|
||||
|
||||
@@ -35,3 +35,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Build the configuration and open it in a virtual machine:
|
||||
|
||||
`sudo nixos-rebuild build-vm`
|
||||
|
||||
- List available generations similar to the boot loader menu:
|
||||
|
||||
`nixos-rebuild list-generations`
|
||||
|
||||
@@ -5,18 +5,22 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# pacstrap
|
||||
|
||||
> Arch Linux install script to install packages to the specified new root directory.
|
||||
> More information: <https://manned.org/pacstrap.8>.
|
||||
> Install Arch Linux packages in the specified new root directory.
|
||||
> More information: <https://manned.org/pacstrap>.
|
||||
|
||||
- Install the `base` package, Linux kernel and firmware for common hardware:
|
||||
- Install the `base` package, the Linux kernel and firmware for common hardware:
|
||||
|
||||
`pacstrap {{path/to/new/root}} {{base}} {{linux}} {{linux-firmware}}`
|
||||
|
||||
- Install the `base` package, Linux LTS kernel and `base-devel` build tools:
|
||||
- Install the `base` package, the Linux LTS kernel and `base-devel` build tools:
|
||||
|
||||
`pacstrap {{path/to/new/root}} {{base}} {{base-devel}} {{linux-lts}}`
|
||||
|
||||
- Install packages without copy the host's mirrorlist to the target:
|
||||
- Install packages and copy the host's Pacman config to the target:
|
||||
|
||||
`pacstrap -P {{path/to/new/root}} {{packages}}`
|
||||
|
||||
- Install packages without copying the host's mirrorlist to the target:
|
||||
|
||||
`pacstrap -M {{path/to/new/root}} {{packages}}`
|
||||
|
||||
@@ -35,7 +39,3 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Install packages in interactive mode (prompts for confirmation):
|
||||
|
||||
`pacstrap -i {{path/to/new/root}} {{packages}}`
|
||||
|
||||
- Install packages using package files:
|
||||
|
||||
`pacstrap -U {{path/to/new/root}} {{path/to/package1}} {{path/to/package2}}`
|
||||
|
||||
Reference in New Issue
Block a user