Update cheatsheets

This commit is contained in:
ivuorinen
2025-10-09 00:19:00 +00:00
parent 52f5647220
commit d4e4abca39
60 changed files with 723 additions and 65 deletions

View File

@@ -8,15 +8,15 @@ source: https://github.com/tldr-pages/tldr.git
> Display an overview of the filesystem disk space usage.
> More information: <https://manned.org/df.1posix>.
- Display all filesystems and their disk usage using 512-byte units:
- Display all filesystems and their disk usage (using 512-byte units):
`df`
- Display the filesystem and its disk usage containing the given file or directory:
- Display the filesystem containing the specified file or directory:
`df {{path/to/file_or_directory}}`
- Use 1024-byte units when writing space figures:
- Use [k]ibibyte (1024 byte) units when showing size figures:
`df -k`

View File

@@ -13,7 +13,7 @@ source: https://github.com/tldr-pages/tldr.git
`dvc {{subcommand}}`
- Display general help:
- Display help:
`dvc {{[-h|--help]}}`

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Display an overview of the filesystem disk space usage.
> More information: <https://man.freebsd.org/cgi/man.cgi?df>.
- Display all filesystems and their disk usage using 512-byte units:
- Display all filesystems and their disk usage (using 512-byte units):
`df`
@@ -20,15 +20,15 @@ source: https://github.com/tldr-pages/tldr.git
`df -{{-si|H}}`
- Display the filesystem and its disk usage containing the given file or directory:
- Display the filesystem containing the specified file or directory:
`df {{path/to/file_or_directory}}`
- Include statistics on the number of free and used [i]nodes including the filesystem [T]ypes:
- Include statistics on the number of free and used [i]nodes, including the filesystem [T]ypes:
`df -iT`
- Use 1024-byte units when writing space figures:
- Use [k]ibibyte (1024 byte) units when showing size figures:
`df -k`

33
tldr/ibmcloud-api Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud api
> Set or view the IBM Cloud API endpoint.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli#ibmcloud_api>.
- View the current API endpoint:
`ibmcloud api`
- Set the API endpoint to `cloud.ibm.com`:
`ibmcloud api cloud.ibm.com`
- Set a private API endpoint:
`ibmcloud api private.cloud.ibm.com`
- Use a VPC connection for a private endpoint:
`ibmcloud api private.cloud.ibm.com --vpc`
- Bypass SSL validation of HTTP requests:
`ibmcloud api https://cloud.ibm.com --skip-ssl-validation`
- Remove the API endpoint setting:
`ibmcloud api --unset`

33
tldr/ibmcloud-config Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud config
> Modify or read out values in the IBM Cloud CLI configuration.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli#ibmcloud_config>.
- Set HTTP request timeout to 30 seconds:
`ibmcloud config --http-timeout 30`
- Enable trace output for HTTP requests:
`ibmcloud config --trace true`
- Trace HTTP requests to a specific file:
`ibmcloud config --trace {{path/to/trace_file}}`
- Disable color output:
`ibmcloud config --color false`
- Set the locale to a specific language:
`ibmcloud config --locale {{zh_Hans}}`
- Enable automatic SSO one-time passcode acceptance:
`ibmcloud config --sso-otp auto`

33
tldr/ibmcloud-cr Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud cr
> Manage IBM Cloud Container Registry content and configuration.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-containerregcli>.
- Set target region for IBM Cloud Container Registry:
`ibmcloud cr region-set`
- List images available:
`ibmcloud cr {{[images|image-list]}}`
- Inspect an image data:
`ibmcloud cr image-inspect {{image}}`
- Run vulnerability assessment on an image:
`ibmcloud cr {{[va|vulnerability-assessment]}} {{image}}`
- Log the local Docker or Podman client in to IBM Cloud Container Registry:
`ibmcloud cr login`
- List all actions available under this command:
`ibmcloud cr help`

25
tldr/ibmcloud-iam Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud iam
> Manage identities and access to resources.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_commands_iam>.
- List service IDs in an account:
`ibmcloud iam service-ids`
- List all API keys for a service ID:
`ibmcloud iam service-api-keys {{service_id}}`
- Create an API key for a service ID with a description and without confirmation:
`ibmcloud iam service-api-key-create {{api_key_name}} {{service_id}} {{[-d|--description]}} {{description}} {{[-f|--force]}}`
- List all actions available under this command:
`ibmcloud iam help`

29
tldr/ibmcloud-ks Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud ks
> Manage Kubernetes and OpenShift clusters in IBM Cloud.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-kubernetes-service-cli>.
- View the details of a cluster:
`ibmcloud ks cluster get {{[-c|--cluster]}} {{cluster_id}}`
- View the rotation status of Cluster Authority certificates for a cluster:
`ibmcloud ks cluster ca status {{[-c|--cluster]}} {{cluster_id}}`
- View worker pools of a cluster:
`ibmcloud ks worker-pool ls {{[-c|--cluster]}} {{cluster_id}}`
- Delete a worker node and replace it with a new one in the same worker pool:
`ibmcloud ks worker replace {{[-c|--cluster]}} {{cluster_id}} {{[-w|--worker]}} {{worker_id}}`
- List all actions available under this command:
`ibmcloud ks help`

13
tldr/ibmcloud-logout Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud logout
> Log out of the IBM Cloud CLI.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli#ibmcloud_logout>.
- Log out of the current session:
`ibmcloud logout`

13
tldr/ibmcloud-regions Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud regions
> List all available regions on IBM Cloud.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli#ibmcloud_regions>.
- View information for all regions:
`ibmcloud regions`

33
tldr/ibmcloud-target Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ibmcloud target
> Set or view the target account, region, or resource group.
> More information: <https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_cli#ibmcloud_target>.
- View the current target account and region:
`ibmcloud target`
- Set the target account:
`ibmcloud target -c {{account_id}}`
- Switch to a specific region:
`ibmcloud target -r {{region_name}}`
- Set the target resource group:
`ibmcloud target -g {{resource_group_name}}`
- Clear the targeted region:
`ibmcloud target --unset-region`
- Clear the targeted resource group:
`ibmcloud target --unset-resource-group`

13
tldr/kubectl-diff Normal file
View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# kubectl diff
> Check differences between live resources and files.
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_diff>.
- View differences between the live resource and file definition:
`kubectl diff {{[-f|--filename]}} {{path/to/filename}}`

26
tldr/kubectl-patch Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# kubectl patch
> Patch Kubernetes resources with new values.
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_patch>.
- Partially patch a secret using a strategic merge JSON patch to remove the finalizer:
`kubectl patch secrets {{secret_name}} {{[-p|--patch]}} '{"metadata":{"finalizers": []\}\}' --type merge`
- Partially patch a secret using a strategic merge YAML patch to remove the finalizer:
`kubectl patch secrets {{secret_name}} {{[-p|--patch]}} $'metadata:
finalizers: []' --type merge`
- Partially patch a pod's container using a JSON patch with positional arrays:
`kubectl patch {{[po|pods]}} {{pod_name}} --type 'json' {{[-p|--patch]}} '[{"op": "replace", "path": "/spec/containers/0/image", "value":"{{new_image_value}}"}]'`
- Update a deployment's replicas through the scale subresource using a strategic merge JSON patch:
`kubectl patch {{[deploy|deployments]}} {{deployment_name}} --subresource 'scale' --type 'merge' {{[-p|--patch]}} '{"spec":{"replicas":{{number_of_replicas}}\}\}'`

33
tldr/kubectl-port-forward Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# kubectl port-forward
> Forward one or more local ports to a pod.
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_port-forward/>.
- Forward local ports 5000 and 6000 to the pod ports 5000 and 6000:
`kubectl port-forward {{[po|pods]}}/{{pod_name}} 5000 6000`
- Forward a random local port to the pod port 5000:
`kubectl port-forward {{[po|pods]}}/{{pod_name}} :5000`
- Forward local ports 5000 and 6000 to the deployment ports 5000 and 6000:
`kubectl port-forward {{[deploy|deployment]}}/{{deployment_name}} 5000 6000`
- Forward local port 8443 to the service port named https:
`kubectl port-forward {{[svc|service]}}/{{service_name}} 8443:https`
- Forward port 8888 on all addresses to the pod port 5000:
`kubectl port-forward {{[po|pods]}}/{{pod_name}} 8888:5000 --address 0.0.0.0`
- Forward port 8888 on localhost and selected IP to the pod port 5000:
`kubectl port-forward {{[po|pods]}}/{{pod_name}} 8888:5000 --address localhost,{{10.19.21.23}}`

37
tldr/kubectl-top Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# kubectl top
> See the resource consumption for nodes or pods.
> More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_top>.
- Get the resource consumption of all nodes:
`kubectl top {{[no|nodes]}}`
- Get resource consumption of a specific node:
`kubectl top {{[no|nodes]}} {{node_name}}`
- Get resource consumption of all pods:
`kubectl top {{[po|pods]}}`
- Get resource consumption of a specific pod:
`kubectl top {{[po|pods]}} {{pod_name}}`
- Get resource consumption of all pods in a namespace:
`kubectl top {{[po|pods]}} {{[-n|--namespace]}} {{namespace_name}}`
- Get resource consumption of all containers in a pod:
`kubectl top {{[po|pods]}} --containers`
- Get resource consumption of all pods with the specified label:
`kubectl top {{[po|pods]}} {{[-l|--selector]}} {{key=value}}`

View File

@@ -12,11 +12,11 @@ source: https://github.com/tldr-pages/tldr.git
`df`
- Display all filesystems and their disk usage in human-readable form:
- Display all filesystems in human-readable form:
`df {{[-h|--human-readable]}}`
- Display the filesystem and its disk usage containing the given file or directory:
- Display the filesystem containing the specified file or directory:
`df {{path/to/file_or_directory}}`

View File

@@ -37,6 +37,6 @@ source: https://github.com/tldr-pages/tldr.git
`iw reg get`
- Display help for all commands:
- Display help:
`iw help`

31
tldr/linux/newrole Normal file
View File

@@ -0,0 +1,31 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# newrole
> Run a new shell with a different SELinux role.
> Allows users to switch to a different SELinux security context.
> See also: `runcon`, `semanage-user`.
> More information: <https://manned.org/newrole>.
- Start a new shell with a specific SELinux role:
`newrole {{[-r|--role]}} {{role_name}}`
- Start a new shell with a specific SELinux type:
`newrole {{[-t|--type]}} {{type_name}}`
- Start a new shell with a specific SELinux level (format: `s0-s0:c0.c1023` where levels range from `s0` to `s15`, `-` indicates level range, categories start with `c`, `:` separates level from categories, `.` indicates category range):
`newrole {{[-l|--level]}} {{s0-s0:c0.c1023}}`
- Display the current SELinux context:
`id {{[-Z|--context]}}`
- Start a new shell with both role and type:
`newrole {{[-r|--role]}} {{role_name}} {{[-t|--type]}} {{type_name}}`

29
tldr/linux/paclock Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# paclock
> Lock/unlock the libalpm database (used by `pacman`) to prevent or allow simultaneous package management operations.
> More information: <https://github.com/andrewgregory/pacutils/blob/master/doc/paclock.pod>.
- Lock the database:
`paclock`
- Write the lock file path to `stdout` (without locking the database):
`paclock --print`
- Unlock the database:
`paclock --unlock`
- Display help:
`paclock --help`
- Display version:
`paclock --version`

View File

@@ -16,7 +16,7 @@ source: https://github.com/tldr-pages/tldr.git
`plasmashell --replace & disown`
- Display help on command-line options:
- Display help:
`plasmashell {{[-h|--help]}}`

35
tldr/linux/restorecond Normal file
View File

@@ -0,0 +1,35 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# restorecond
> Daemon that monitors file creation and automatically restores SELinux contexts.
> Useful for directories where files are frequently created with incorrect contexts.
> See also: `restorecon`, `semanage-fcontext`.
> More information: <https://manned.org/restorecond>.
- Start the `restorecond` daemon:
`sudo restorecond`
- Run `restorecond` in [v]erbose mode to see restoration events:
`sudo restorecond -v`
- Run `restorecond` in [d]ebug mode:
`sudo restorecond -d`
- Use alternative restorecond.conf file:
`sudo restorecond -f restorecond_file`
- Check the status of the restorecond service:
`sudo systemctl status restorecond`
- Enable restorecond to start at boot:
`sudo systemctl enable restorecond --now`

27
tldr/linux/run_init Normal file
View File

@@ -0,0 +1,27 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# run_init
> Run init scripts in the proper SELinux context.
> Typically used to run system service scripts with correct SELinux domains.
> See also: `runcon`, `semanage`.
> More information: <https://manned.org/run_init>.
- Run a script in the init script context:
`sudo run_init {{path/to/script}}`
- Run a script with arguments:
`sudo run_init {{path/to/script}} {{start|stop|restart}}`
- Run a script and specify the init script context explicitly:
`sudo run_init {{[-t|--type]}} {{context_type}} {{path/to/script}}`
- Display the context that would be used without running the script:
`sudo run_init {{[-n|--dry-run]}} {{path/to/script}}`

27
tldr/linux/sealert Normal file
View File

@@ -0,0 +1,27 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# sealert
> Analyze and explain SELinux AVC denial messages.
> Part of the `setroubleshoot-server` package.
> See also: `audit2why`, `ausearch`, `audit2allow`.
> More information: <https://manned.org/sealert>.
- Analyze all recent SELinux denials:
`sudo sealert {{[-a|--analyze]}} {{/var/log/audit/audit.log}}`
- Analyze a specific alert ID from system logs:
`sudo sealert {{[-l|--lookupid]}} {{alert_id}}`
- Display a summary of recent SELinux alerts:
`sudo sealert {{[-b|--browser]}}`
- Monitor audit log in real-time for new alerts:
`sudo tail {{[-f|--follow]}} {{/var/log/audit/audit.log}} | sealert {{[-l|--lookupid]}} -`

View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# semanage interface
> Manage SELinux network interface type definitions.
> See also: `semanage`, `semanage-port`.
> More information: <https://manned.org/semanage-interface>.
- List all interface type definitions:
`sudo semanage interface {{[-l|--list]}}`
- Add a network interface type definition:
`sudo semanage interface {{[-a|--add]}} {{[-t|--type]}} {{type_name}} {{interface_name}}`
- Delete a network interface type definition:
`sudo semanage interface {{[-d|--delete]}} {{interface_name}}`
- Modify a network interface type definition:
`sudo semanage interface {{[-m|--modify]}} {{[-t|--type]}} {{type_name}} {{interface_name}}`
- List interface type definitions in a customized format:
`sudo semanage interface {{[-l|--list]}} {{[-C|--locallist]}}`

31
tldr/linux/setfiles Normal file
View File

@@ -0,0 +1,31 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# setfiles
> Set SELinux file security contexts based on policy rules.
> Similar to `restorecon` but reads contexts from a file_contexts file.
> See also: `restorecon`, `semanage-fcontext`, `fixfiles`.
> More information: <https://manned.org/setfiles>.
- Set file contexts according to the default policy file:
`sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}}`
- Set file contexts recursively and show changes:
`sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}} {{[-v|--verbose]}}`
- Preview what would be changed without actually modifying contexts:
`sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}} {{[-n|--nochange]}}`
- Set file contexts and verify them:
`sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/directory}} {{[-v|--verbose]}} {{[-F|--force]}}`
- Use a specific root path for context matching:
`sudo setfiles /etc/selinux/targeted/contexts/files/file_contexts {{path/to/new_directory}} {{[-r|--rootpath]}} {{path/to/old_directory}}`

View File

@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
- Add a user-level `Requires` dependency:
`systemctl --user add-requires {{target}} {{unit}}`
`systemctl add-requires {{target}} {{unit}} --user`

View File

@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
- Add a user-level `Wants` dependency:
`systemctl --user add-wants {{target}} {{unit}}`
`systemctl add-wants {{target}} {{unit}} --user`

View File

@@ -18,8 +18,8 @@ source: https://github.com/tldr-pages/tldr.git
- Bind-mount a path as read-only inside the unit:
`systemctl bind --read-only {{unit}} /{{path/to/host_directory}}`
`systemctl bind {{unit}} /{{path/to/host_directory}} --read-only`
- Create the destination path inside the unit before binding:
`systemctl bind --mkdir {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`
`systemctl bind {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}} --mkdir`

View File

@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
- Cancel a job in the user service manager:
`systemctl cancel --user {{job_id}}`
`systemctl cancel {{job_id}} --user`

View File

@@ -22,4 +22,4 @@ source: https://github.com/tldr-pages/tldr.git
- Show the contents of a user unit file:
`systemctl cat --user {{unit}}`
`systemctl cat {{unit}} --user`

View File

@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
- Stop a service from running on boot and stop its current execution:
`systemctl disable --now {{unit}}`
`systemctl disable {{unit}} --now`
- Stop a user service from running on login:
`systemctl disable --user {{unit}}`
`systemctl disable {{unit}} --user`

View File

@@ -14,12 +14,12 @@ source: https://github.com/tldr-pages/tldr.git
- Edit an unit file:
`sudo systemctl edit {{[-l|--full]}} {{unit_file}}`
`sudo systemctl edit {{unit_file}} {{[-l|--full]}}`
- Create a new unit file:
`sudo systemctl edit {{[-lf|--full --force]}} {{unit_file}}`
`sudo systemctl edit {{unit_file}} {{[-lf|--full --force]}}`
- Overlay a user unit file:
`systemctl edit --user {{unit_file}}`
`systemctl edit {{unit_file}} --user`

View File

@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
- Enable a service to run on boot and start it now:
`systemctl enable --now {{unit}}`
`systemctl enable {{unit}} --now`
- Enable a user unit to run on login:
`systemctl enable --user {{unit}}`
`systemctl enable {{unit}} --user`

View File

@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
- Exit the user service manager:
`systemctl --user exit`
`systemctl exit --user`
- Exit the user service manager with a specific exit code:
`systemctl --user exit {{code}}`
`systemctl exit {{code}} --user`
- Ask the containers service manager to exit (equivalent of `systemctl poweroff` if not in a container):

View File

@@ -0,0 +1,13 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl get-default
> Display the default target (runlevel) that the system will boot into.
> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#get-default>.
- Check the default target on your system:
`systemctl get-default`

View File

@@ -18,8 +18,8 @@ source: https://github.com/tldr-pages/tldr.git
- Check whether a unit is active without printing the state to `stdout`:
`systemctl is-active {{[-q|--quiet]}} {{unit}}`
`systemctl is-active {{unit}} {{[-q|--quiet]}}`
- Check whether a user unit is active:
`systemctl is-active --user {{unit}}`
`systemctl is-active {{unit}} --user`

View File

@@ -0,0 +1,17 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl list-jobs
> List of active systemd jobs that are currently queued or running on the system.
> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#list-jobs%20PATTERN…>.
- List all active jobs:
`systemctl list-jobs`
- Filter jobs for a specific unit:
`systemctl list-jobs {{unit}}`

View File

@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
- Ensure that the service is shut down while masking:
`systemctl mask --now {{service_name}}`
`systemctl mask {{service_name}} --now`
- Mask a user service:
`sysemctl mask --user {{service_name}}`
`systemctl mask {{service_name}} --user`

View File

@@ -19,4 +19,4 @@ source: https://github.com/tldr-pages/tldr.git
- Reload a service for the current user:
`systemctl --user reload {{pipewire}}`
`systemctl reload {{pipewire}} --user`

View File

@@ -19,4 +19,4 @@ source: https://github.com/tldr-pages/tldr.git
- Restart a user unit:
`systemctl restart --user {{unit}}`
`systemctl restart {{unit}} --user`

View File

@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
- Set an environment variable for the user service manager:
`systemctl --user set-environment {{var value}}`
`systemctl set-environment {{var value}} --user`

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Show properties of a specific user unit:
`systemctl show --user {{unit}}`
`systemctl show {{unit}} --user`
- Include empty properties in the list:
@@ -30,4 +30,4 @@ source: https://github.com/tldr-pages/tldr.git
- Only show the specified properties:
`systemctl show {{[-p|--property]}} {{Wants,Conflicts,...}} {{unit}}`
`systemctl show {{unit}} {{[-p|--property]}} {{Wants,Conflicts,...}}`

View File

@@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git
- Start a user unit:
`systemctl start --user {{unit}}`
`systemctl start {{unit}} --user`

View File

@@ -34,4 +34,4 @@ source: https://github.com/tldr-pages/tldr.git
- Show the status of a user unit:
`systemctl status --user {{unit}}`
`systemctl status {{unit}} --user`

View File

@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
- Stop a service and suppress warnings:
`systemctl stop --no-warn {{unit}}`
`systemctl stop {{unit}} --no-warn`
- Stop a user unit:
`systemctl stop --user {{unit}}`
`systemctl stop {{unit}} --user`

View File

@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
- Switch to a new root filesystem with verbose output:
`systemctl --verbose switch-root {{path/to/new_root}}`
`systemctl switch-root {{path/to/new_root}} --verbose`

View File

@@ -15,8 +15,8 @@ source: https://github.com/tldr-pages/tldr.git
- Unmask and start a service immediately:
`systemctl unmask --now {{service_name}}`
`systemctl unmask {{service_name}} --now`
- Unmask a user service:
`systemctl unmask --user {{service_name}}`
`systemctl unmask {{service_name}} --user`

View File

@@ -19,4 +19,4 @@ source: https://github.com/tldr-pages/tldr.git
- Unset an environment variable in the user service manager:
`systemctl --user unset-environment {{var}}`
`systemctl unset-environment {{var}} --user`

View File

@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
- Show the unit of the current shell in user service manager (services managed for your login session):
`systemctl --user whoami`
`systemctl whoami --user`
- Show the unit a specific process belongs to:

View File

@@ -24,6 +24,6 @@ source: https://github.com/tldr-pages/tldr.git
`vgremove --config '{{global/locking_type=1}}' {{volume_group}}`
- Display help text for usage information:
- Display help:
`vgremove {{[-h|--help]}}`

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Display an overview of the filesystem disk space usage.
> More information: <https://man.netbsd.org/df.1>.
- Display all filesystems and their disk usage using 512-byte units:
- Display all filesystems and their disk usage (using 512-byte units):
`df`
@@ -20,7 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
`df -G`
- Display the filesystem and its disk usage containing the given file or directory:
- Display the filesystem containing the specified file or directory:
`df {{path/to/file_or_directory}}`
@@ -28,7 +28,7 @@ source: https://github.com/tldr-pages/tldr.git
`df -i`
- Use 1024-byte units when writing space figures:
- Use [k]ibibyte (1024 byte) units when showing size figures:
`df -k`

14
tldr/npm-edit Normal file
View File

@@ -0,0 +1,14 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm edit
> Select a dependency in the current project and open the package folder in the default editor (`$EDITOR`).
> After editing, the package is rebuilt to pick up any changes in compiled packages.
> More information: <https://docs.npmjs.com/cli/commands/npm-edit>.
- Edit a locally installed package in the default editor:
`npm edit {{package_name}}`

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`npm {{[x|exec]}} {{command}} {{argument1 argument2 ...}}`
- In case multiple commands with the same name exist, it is possible to explicitly specify the package:
- Specify the package explicitly (useful if multiple commands with the same name exist):
`npm {{[x|exec]}} --package {{package}} {{command}}`
@@ -20,7 +20,7 @@ source: https://github.com/tldr-pages/tldr.git
`npm {{[x|exec]}} --no-install {{command}} {{argument1 argument2 ...}}`
- Execute a specific command suppressing any output from `npm` itself:
- Execute a specific command, suppressing any output from `npm` itself:
`npm {{[x|exec]}} --quiet {{command}} {{argument1 argument2 ...}}`

21
tldr/npm-sbom Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm sbom
> Generate a Software Bill of Materials (SBOM) for your Node.js project.
> More information: <https://docs.npmjs.com/cli/npm-sbom>.
- Output a list of all dependencies in your project:
`npm sbom`
- Exclude both `dev` and `optional` dependencies:
`npm sbom --omit dev --omit optional`
- Generate an SBOM based only on the `package-lock.json`:
`npm sbom --package-lock-only`

View File

@@ -8,15 +8,15 @@ source: https://github.com/tldr-pages/tldr.git
> Display an overview of the filesystem disk space usage.
> More information: <https://man.openbsd.org/df.1>.
- Display all filesystems and their disk usage using 512-byte units:
- Display all filesystems and their disk usage (using 512-byte units):
`df`
- Display all filesystems and their disk usage in [h]uman-readable form (based on powers of 1024):
- Display all filesystems in [h]uman-readable form (based on powers of 1024):
`df -h`
- Display the filesystem and its disk usage containing the given file or directory:
- Display the filesystem containing the specified file or directory:
`df {{path/to/file_or_directory}}`
@@ -24,7 +24,7 @@ source: https://github.com/tldr-pages/tldr.git
`df -i`
- Use 1024-byte units when writing space figures:
- Use [k]ibibyte (1024 byte) units when showing size figures:
`df -k`

View File

@@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git
> Display an overview of the filesystem disk space usage.
> More information: <https://keith.github.io/xcode-man-pages/df.1.html>.
- Display all filesystems and their disk usage using 512-byte units:
- Display all filesystems and their disk usage (using 512-byte units):
`df`
@@ -18,17 +18,17 @@ source: https://github.com/tldr-pages/tldr.git
- Use [H]uman-readable units (based on powers of 1000):
`df -{{-si|H}}`
`df {{[-H|--si]}}`
- Display the filesystem and its disk usage containing the given file or directory:
- Display the filesystem containing the specified file or directory:
`df {{path/to/file_or_directory}}`
- Include statistics on the number of free and used [i]nodes including the filesystem t[Y]pes:
- Include statistics on the number of free and used [i]nodes, including the filesystem t[Y]pes:
`df -iY`
- Use 1024-byte units when writing space figures:
- Use [k]ibibyte (1024 byte) units when showing size figures:
`df -k`

21
tldr/pg_test_fsync Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# pg_test_fsync
> Determine the fastest wal_sync_method on your system.
> More information: <https://www.postgresql.org/docs/current/pgtestfsync.html>.
- Run the default fsync benchmark (5 seconds):
`pg_test_fsync`
- Specify a custom test duration:
`pg_test_fsync {{[-s|--secs-per-test]}} {{seconds}}`
- Use a specific filename (it must be in same file system that the pg_wal directory is or will be placed in):
`pg_test_fsync {{[-f|--filename]}} {{path/to/file}}`

41
tldr/reindexdb Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# reindexdb
> Rebuild indexes in a PostgreSQL database.
> More information: <https://www.postgresql.org/docs/current/app-reindexdb.html>.
- Reindex a specific database:
`reindexdb {{database_name}}`
- Reindex a specific database using connection options:
`reindexdb {{database_name}} {{[-h|--host]}} {{hostname}} {{[-p|--port]}} {{port}} {{[-U|--username]}} {{username}}`
- Reindex all databases:
`reindexdb {{[-a|--all]}}`
- Reindex a specific table in a database:
`reindexdb {{database_name}} {{[-t|--table]}} {{table_name}}`
- Reindex a specific index in a database:
`reindexdb {{database_name}} {{[-i|--index]}} {{index_name}}`
- Reindex a specific schema in a database:
`reindexdb {{database_name}} {{[-S|--schema]}} {{schema_name}}`
- Reindex with verbose output:
`reindexdb {{database_name}} {{[-v|--verbose]}}`
- Reindex a database using multiple parallel jobs:
`reindexdb {{database_name}} {{[-j|--jobs]}} {{number_of_jobs}}`

View File

@@ -33,10 +33,10 @@ source: https://github.com/tldr-pages/tldr.git
`del {{file_pattern}} /q`
- Display the help and list available attributes:
`del /?`
- Delete files based on specified attributes:
`del {{file_pattern}} /a {{attribute}}`
- Display help and list available attributes:
`del /?`

View File

@@ -21,6 +21,6 @@ source: https://github.com/tldr-pages/tldr.git
`finger {{user}}@{{host}} -l`
- Display help information:
- Display help:
`finger /?`