From d4e4abca39ff41735b57d4e283e9896eb4bb8167 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Thu, 9 Oct 2025 00:19:00 +0000 Subject: [PATCH] Update cheatsheets --- tldr/df | 6 ++-- tldr/dvc | 2 +- tldr/freebsd/df | 8 ++--- tldr/ibmcloud-api | 33 +++++++++++++++++++++ tldr/ibmcloud-config | 33 +++++++++++++++++++++ tldr/ibmcloud-cr | 33 +++++++++++++++++++++ tldr/ibmcloud-iam | 25 ++++++++++++++++ tldr/ibmcloud-ks | 29 ++++++++++++++++++ tldr/ibmcloud-logout | 13 ++++++++ tldr/ibmcloud-regions | 13 ++++++++ tldr/ibmcloud-target | 33 +++++++++++++++++++++ tldr/kubectl-diff | 13 ++++++++ tldr/kubectl-patch | 26 ++++++++++++++++ tldr/kubectl-port-forward | 33 +++++++++++++++++++++ tldr/kubectl-top | 37 +++++++++++++++++++++++ tldr/linux/df | 4 +-- tldr/linux/iw | 2 +- tldr/linux/newrole | 31 +++++++++++++++++++ tldr/linux/paclock | 29 ++++++++++++++++++ tldr/linux/plasmashell | 2 +- tldr/linux/restorecond | 35 ++++++++++++++++++++++ tldr/linux/run_init | 27 +++++++++++++++++ tldr/linux/sealert | 27 +++++++++++++++++ tldr/linux/semanage-interface | 30 +++++++++++++++++++ tldr/linux/setfiles | 31 +++++++++++++++++++ tldr/linux/systemctl-add-requires | 2 +- tldr/linux/systemctl-add-wants | 2 +- tldr/linux/systemctl-bind | 4 +-- tldr/linux/systemctl-cancel | 2 +- tldr/linux/systemctl-cat | 2 +- tldr/linux/systemctl-disable | 4 +-- tldr/linux/systemctl-edit | 6 ++-- tldr/linux/systemctl-enable | 4 +-- tldr/linux/systemctl-exit | 4 +-- tldr/linux/systemctl-get-default | 13 ++++++++ tldr/linux/systemctl-is-active | 4 +-- tldr/linux/systemctl-list-jobs | 17 +++++++++++ tldr/linux/systemctl-mask | 4 +-- tldr/linux/systemctl-reload | 2 +- tldr/linux/systemctl-restart | 2 +- tldr/linux/systemctl-set-environment | 2 +- tldr/linux/systemctl-show | 4 +-- tldr/linux/systemctl-start | 2 +- tldr/linux/systemctl-status | 2 +- tldr/linux/systemctl-stop | 4 +-- tldr/linux/systemctl-switch-root | 2 +- tldr/linux/systemctl-unmask | 4 +-- tldr/linux/systemctl-unset-environment | 2 +- tldr/linux/systemctl-whoami | 2 +- tldr/linux/vgremove | 2 +- tldr/netbsd/df | 6 ++-- tldr/npm-edit | 14 +++++++++ tldr/npm-exec | 4 +-- tldr/npm-sbom | 21 +++++++++++++ tldr/openbsd/df | 8 ++--- tldr/osx/df | 10 +++---- tldr/pg_test_fsync | 21 +++++++++++++ tldr/reindexdb | 41 ++++++++++++++++++++++++++ tldr/windows/del | 8 ++--- tldr/windows/finger | 2 +- 60 files changed, 723 insertions(+), 65 deletions(-) create mode 100644 tldr/ibmcloud-api create mode 100644 tldr/ibmcloud-config create mode 100644 tldr/ibmcloud-cr create mode 100644 tldr/ibmcloud-iam create mode 100644 tldr/ibmcloud-ks create mode 100644 tldr/ibmcloud-logout create mode 100644 tldr/ibmcloud-regions create mode 100644 tldr/ibmcloud-target create mode 100644 tldr/kubectl-diff create mode 100644 tldr/kubectl-patch create mode 100644 tldr/kubectl-port-forward create mode 100644 tldr/kubectl-top create mode 100644 tldr/linux/newrole create mode 100644 tldr/linux/paclock create mode 100644 tldr/linux/restorecond create mode 100644 tldr/linux/run_init create mode 100644 tldr/linux/sealert create mode 100644 tldr/linux/semanage-interface create mode 100644 tldr/linux/setfiles create mode 100644 tldr/linux/systemctl-get-default create mode 100644 tldr/linux/systemctl-list-jobs create mode 100644 tldr/npm-edit create mode 100644 tldr/npm-sbom create mode 100644 tldr/pg_test_fsync create mode 100644 tldr/reindexdb diff --git a/tldr/df b/tldr/df index f920feba..53ac5bfc 100644 --- a/tldr/df +++ b/tldr/df @@ -8,15 +8,15 @@ source: https://github.com/tldr-pages/tldr.git > Display an overview of the filesystem disk space usage. > More information: . -- 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` diff --git a/tldr/dvc b/tldr/dvc index b0c98c42..9ce32b6f 100644 --- a/tldr/dvc +++ b/tldr/dvc @@ -13,7 +13,7 @@ source: https://github.com/tldr-pages/tldr.git `dvc {{subcommand}}` -- Display general help: +- Display help: `dvc {{[-h|--help]}}` diff --git a/tldr/freebsd/df b/tldr/freebsd/df index 706a78dd..f9372549 100644 --- a/tldr/freebsd/df +++ b/tldr/freebsd/df @@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git > Display an overview of the filesystem disk space usage. > More information: . -- 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` diff --git a/tldr/ibmcloud-api b/tldr/ibmcloud-api new file mode 100644 index 00000000..b99b78de --- /dev/null +++ b/tldr/ibmcloud-api @@ -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: . + +- 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` diff --git a/tldr/ibmcloud-config b/tldr/ibmcloud-config new file mode 100644 index 00000000..756fb537 --- /dev/null +++ b/tldr/ibmcloud-config @@ -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: . + +- 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` diff --git a/tldr/ibmcloud-cr b/tldr/ibmcloud-cr new file mode 100644 index 00000000..4ecb87e4 --- /dev/null +++ b/tldr/ibmcloud-cr @@ -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: . + +- 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` diff --git a/tldr/ibmcloud-iam b/tldr/ibmcloud-iam new file mode 100644 index 00000000..c4c97b9a --- /dev/null +++ b/tldr/ibmcloud-iam @@ -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: . + +- 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` diff --git a/tldr/ibmcloud-ks b/tldr/ibmcloud-ks new file mode 100644 index 00000000..2da1bf07 --- /dev/null +++ b/tldr/ibmcloud-ks @@ -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: . + +- 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` diff --git a/tldr/ibmcloud-logout b/tldr/ibmcloud-logout new file mode 100644 index 00000000..9af3b946 --- /dev/null +++ b/tldr/ibmcloud-logout @@ -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: . + +- Log out of the current session: + +`ibmcloud logout` diff --git a/tldr/ibmcloud-regions b/tldr/ibmcloud-regions new file mode 100644 index 00000000..92c40ae1 --- /dev/null +++ b/tldr/ibmcloud-regions @@ -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: . + +- View information for all regions: + +`ibmcloud regions` diff --git a/tldr/ibmcloud-target b/tldr/ibmcloud-target new file mode 100644 index 00000000..9c0ba4e8 --- /dev/null +++ b/tldr/ibmcloud-target @@ -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: . + +- 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` diff --git a/tldr/kubectl-diff b/tldr/kubectl-diff new file mode 100644 index 00000000..3a6a0d61 --- /dev/null +++ b/tldr/kubectl-diff @@ -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: . + +- View differences between the live resource and file definition: + +`kubectl diff {{[-f|--filename]}} {{path/to/filename}}` diff --git a/tldr/kubectl-patch b/tldr/kubectl-patch new file mode 100644 index 00000000..aa22c897 --- /dev/null +++ b/tldr/kubectl-patch @@ -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: . + +- 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}}\}\}'` diff --git a/tldr/kubectl-port-forward b/tldr/kubectl-port-forward new file mode 100644 index 00000000..4218f22f --- /dev/null +++ b/tldr/kubectl-port-forward @@ -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: . + +- 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}}` diff --git a/tldr/kubectl-top b/tldr/kubectl-top new file mode 100644 index 00000000..21913ad3 --- /dev/null +++ b/tldr/kubectl-top @@ -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: . + +- 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}}` diff --git a/tldr/linux/df b/tldr/linux/df index dc0632b1..8f4f03b9 100644 --- a/tldr/linux/df +++ b/tldr/linux/df @@ -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}}` diff --git a/tldr/linux/iw b/tldr/linux/iw index 736a016d..47dcc185 100644 --- a/tldr/linux/iw +++ b/tldr/linux/iw @@ -37,6 +37,6 @@ source: https://github.com/tldr-pages/tldr.git `iw reg get` -- Display help for all commands: +- Display help: `iw help` diff --git a/tldr/linux/newrole b/tldr/linux/newrole new file mode 100644 index 00000000..5b53c862 --- /dev/null +++ b/tldr/linux/newrole @@ -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: . + +- 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}}` diff --git a/tldr/linux/paclock b/tldr/linux/paclock new file mode 100644 index 00000000..715375e3 --- /dev/null +++ b/tldr/linux/paclock @@ -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: . + +- 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` diff --git a/tldr/linux/plasmashell b/tldr/linux/plasmashell index bc6e68f4..6beb8984 100644 --- a/tldr/linux/plasmashell +++ b/tldr/linux/plasmashell @@ -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]}}` diff --git a/tldr/linux/restorecond b/tldr/linux/restorecond new file mode 100644 index 00000000..3c97c7f5 --- /dev/null +++ b/tldr/linux/restorecond @@ -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: . + +- 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` diff --git a/tldr/linux/run_init b/tldr/linux/run_init new file mode 100644 index 00000000..ba496004 --- /dev/null +++ b/tldr/linux/run_init @@ -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: . + +- 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}}` diff --git a/tldr/linux/sealert b/tldr/linux/sealert new file mode 100644 index 00000000..15f548f1 --- /dev/null +++ b/tldr/linux/sealert @@ -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: . + +- 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]}} -` diff --git a/tldr/linux/semanage-interface b/tldr/linux/semanage-interface new file mode 100644 index 00000000..f4a04525 --- /dev/null +++ b/tldr/linux/semanage-interface @@ -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: . + +- 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]}}` diff --git a/tldr/linux/setfiles b/tldr/linux/setfiles new file mode 100644 index 00000000..2a516df0 --- /dev/null +++ b/tldr/linux/setfiles @@ -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: . + +- 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}}` diff --git a/tldr/linux/systemctl-add-requires b/tldr/linux/systemctl-add-requires index 91bd4e58..d08f2cc9 100644 --- a/tldr/linux/systemctl-add-requires +++ b/tldr/linux/systemctl-add-requires @@ -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` diff --git a/tldr/linux/systemctl-add-wants b/tldr/linux/systemctl-add-wants index d32d42d5..f7a89fe7 100644 --- a/tldr/linux/systemctl-add-wants +++ b/tldr/linux/systemctl-add-wants @@ -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` diff --git a/tldr/linux/systemctl-bind b/tldr/linux/systemctl-bind index 96b80cd4..8300ed3a 100644 --- a/tldr/linux/systemctl-bind +++ b/tldr/linux/systemctl-bind @@ -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` diff --git a/tldr/linux/systemctl-cancel b/tldr/linux/systemctl-cancel index 4eb3101c..67604522 100644 --- a/tldr/linux/systemctl-cancel +++ b/tldr/linux/systemctl-cancel @@ -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` diff --git a/tldr/linux/systemctl-cat b/tldr/linux/systemctl-cat index ffb8bde3..2837510d 100644 --- a/tldr/linux/systemctl-cat +++ b/tldr/linux/systemctl-cat @@ -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` diff --git a/tldr/linux/systemctl-disable b/tldr/linux/systemctl-disable index 5c5d8d24..6ac96e10 100644 --- a/tldr/linux/systemctl-disable +++ b/tldr/linux/systemctl-disable @@ -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` diff --git a/tldr/linux/systemctl-edit b/tldr/linux/systemctl-edit index 863b32b9..11ebc2be 100644 --- a/tldr/linux/systemctl-edit +++ b/tldr/linux/systemctl-edit @@ -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` diff --git a/tldr/linux/systemctl-enable b/tldr/linux/systemctl-enable index 9e580c74..795a27f8 100644 --- a/tldr/linux/systemctl-enable +++ b/tldr/linux/systemctl-enable @@ -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` diff --git a/tldr/linux/systemctl-exit b/tldr/linux/systemctl-exit index 1faea9e0..e050181f 100644 --- a/tldr/linux/systemctl-exit +++ b/tldr/linux/systemctl-exit @@ -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 container’s service manager to exit (equivalent of `systemctl poweroff` if not in a container): diff --git a/tldr/linux/systemctl-get-default b/tldr/linux/systemctl-get-default new file mode 100644 index 00000000..6339674e --- /dev/null +++ b/tldr/linux/systemctl-get-default @@ -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: . + +- Check the default target on your system: + +`systemctl get-default` diff --git a/tldr/linux/systemctl-is-active b/tldr/linux/systemctl-is-active index 2ccb177c..2d1cc359 100644 --- a/tldr/linux/systemctl-is-active +++ b/tldr/linux/systemctl-is-active @@ -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` diff --git a/tldr/linux/systemctl-list-jobs b/tldr/linux/systemctl-list-jobs new file mode 100644 index 00000000..3a043dab --- /dev/null +++ b/tldr/linux/systemctl-list-jobs @@ -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: . + +- List all active jobs: + +`systemctl list-jobs` + +- Filter jobs for a specific unit: + +`systemctl list-jobs {{unit}}` diff --git a/tldr/linux/systemctl-mask b/tldr/linux/systemctl-mask index 803a75fd..59646b5f 100644 --- a/tldr/linux/systemctl-mask +++ b/tldr/linux/systemctl-mask @@ -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` diff --git a/tldr/linux/systemctl-reload b/tldr/linux/systemctl-reload index bfd9506f..e125882e 100644 --- a/tldr/linux/systemctl-reload +++ b/tldr/linux/systemctl-reload @@ -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` diff --git a/tldr/linux/systemctl-restart b/tldr/linux/systemctl-restart index 1e80678e..04879113 100644 --- a/tldr/linux/systemctl-restart +++ b/tldr/linux/systemctl-restart @@ -19,4 +19,4 @@ source: https://github.com/tldr-pages/tldr.git - Restart a user unit: -`systemctl restart --user {{unit}}` +`systemctl restart {{unit}} --user` diff --git a/tldr/linux/systemctl-set-environment b/tldr/linux/systemctl-set-environment index 2542e3db..bcb19866 100644 --- a/tldr/linux/systemctl-set-environment +++ b/tldr/linux/systemctl-set-environment @@ -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` diff --git a/tldr/linux/systemctl-show b/tldr/linux/systemctl-show index 9d4f4eb4..46899878 100644 --- a/tldr/linux/systemctl-show +++ b/tldr/linux/systemctl-show @@ -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,...}}` diff --git a/tldr/linux/systemctl-start b/tldr/linux/systemctl-start index 29827d71..aa38e18a 100644 --- a/tldr/linux/systemctl-start +++ b/tldr/linux/systemctl-start @@ -14,4 +14,4 @@ source: https://github.com/tldr-pages/tldr.git - Start a user unit: -`systemctl start --user {{unit}}` +`systemctl start {{unit}} --user` diff --git a/tldr/linux/systemctl-status b/tldr/linux/systemctl-status index 44644c58..1b81d077 100644 --- a/tldr/linux/systemctl-status +++ b/tldr/linux/systemctl-status @@ -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` diff --git a/tldr/linux/systemctl-stop b/tldr/linux/systemctl-stop index c1f18312..db3ff5bd 100644 --- a/tldr/linux/systemctl-stop +++ b/tldr/linux/systemctl-stop @@ -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` diff --git a/tldr/linux/systemctl-switch-root b/tldr/linux/systemctl-switch-root index c3a8fc25..20cd0e6c 100644 --- a/tldr/linux/systemctl-switch-root +++ b/tldr/linux/systemctl-switch-root @@ -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` diff --git a/tldr/linux/systemctl-unmask b/tldr/linux/systemctl-unmask index 213cb3b2..d47b4d62 100644 --- a/tldr/linux/systemctl-unmask +++ b/tldr/linux/systemctl-unmask @@ -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` diff --git a/tldr/linux/systemctl-unset-environment b/tldr/linux/systemctl-unset-environment index 1e8011d9..86c4e49b 100644 --- a/tldr/linux/systemctl-unset-environment +++ b/tldr/linux/systemctl-unset-environment @@ -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` diff --git a/tldr/linux/systemctl-whoami b/tldr/linux/systemctl-whoami index 7197b3b8..ca731421 100644 --- a/tldr/linux/systemctl-whoami +++ b/tldr/linux/systemctl-whoami @@ -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: diff --git a/tldr/linux/vgremove b/tldr/linux/vgremove index 5150eb0e..b9f9cd13 100644 --- a/tldr/linux/vgremove +++ b/tldr/linux/vgremove @@ -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]}}` diff --git a/tldr/netbsd/df b/tldr/netbsd/df index 765b7e79..21ae5914 100644 --- a/tldr/netbsd/df +++ b/tldr/netbsd/df @@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git > Display an overview of the filesystem disk space usage. > More information: . -- 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` diff --git a/tldr/npm-edit b/tldr/npm-edit new file mode 100644 index 00000000..5760d5fc --- /dev/null +++ b/tldr/npm-edit @@ -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: . + +- Edit a locally installed package in the default editor: + +`npm edit {{package_name}}` diff --git a/tldr/npm-exec b/tldr/npm-exec index b7e444e6..f0349e35 100644 --- a/tldr/npm-exec +++ b/tldr/npm-exec @@ -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 ...}}` diff --git a/tldr/npm-sbom b/tldr/npm-sbom new file mode 100644 index 00000000..f1b08bf1 --- /dev/null +++ b/tldr/npm-sbom @@ -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: . + +- 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` diff --git a/tldr/openbsd/df b/tldr/openbsd/df index 75364df6..7648d5ea 100644 --- a/tldr/openbsd/df +++ b/tldr/openbsd/df @@ -8,15 +8,15 @@ source: https://github.com/tldr-pages/tldr.git > Display an overview of the filesystem disk space usage. > More information: . -- 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` diff --git a/tldr/osx/df b/tldr/osx/df index 54afebec..773e73fc 100644 --- a/tldr/osx/df +++ b/tldr/osx/df @@ -8,7 +8,7 @@ source: https://github.com/tldr-pages/tldr.git > Display an overview of the filesystem disk space usage. > More information: . -- 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` diff --git a/tldr/pg_test_fsync b/tldr/pg_test_fsync new file mode 100644 index 00000000..47b604bf --- /dev/null +++ b/tldr/pg_test_fsync @@ -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: . + +- 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}}` diff --git a/tldr/reindexdb b/tldr/reindexdb new file mode 100644 index 00000000..8082f54c --- /dev/null +++ b/tldr/reindexdb @@ -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: . + +- 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}}` diff --git a/tldr/windows/del b/tldr/windows/del index 1f42c738..ea7c8435 100644 --- a/tldr/windows/del +++ b/tldr/windows/del @@ -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 /?` diff --git a/tldr/windows/finger b/tldr/windows/finger index 3c68149c..097cf056 100644 --- a/tldr/windows/finger +++ b/tldr/windows/finger @@ -21,6 +21,6 @@ source: https://github.com/tldr-pages/tldr.git `finger {{user}}@{{host}} -l` -- Display help information: +- Display help: `finger /?`