mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 17:26:01 +02:00
multiple pages: Unify file path syntax to indicate a 'path to' (#4816)
This commit is contained in:
parent
8b07793aa6
commit
1d32985f2f
28 changed files with 60 additions and 56 deletions
|
@ -5,24 +5,24 @@
|
|||
|
||||
- Search a disk for bad blocks by using a non-destructive read-only test:
|
||||
|
||||
`sudo badblocks {{/dev/sda}}`
|
||||
`sudo badblocks {{/dev/sdX}}`
|
||||
|
||||
- Search an unmounted disk for bad blocks with a non-destructive read-write test:
|
||||
|
||||
`sudo badblocks -n {{/dev/sda}}`
|
||||
`sudo badblocks -n {{/dev/sdX}}`
|
||||
|
||||
- Search an unmounted disk for bad blocks with a destructive write test:
|
||||
|
||||
`sudo badblocks -w {{/dev/sda}}`
|
||||
`sudo badblocks -w {{/dev/sdX}}`
|
||||
|
||||
- Search an unmounted disk for bad blocks with a destructive write test and show verbose status:
|
||||
|
||||
`sudo badblocks -svw {{/dev/sda}}`
|
||||
`sudo badblocks -svw {{/dev/sdX}}`
|
||||
|
||||
- Search an unmounted disk in destructive mode and output found blocks to a file:
|
||||
|
||||
`sudo badblocks -o {{/path/to/file}} -w {{/dev/sda}}`
|
||||
`sudo badblocks -o {{path/to/file}} -w {{/dev/sdX}}`
|
||||
|
||||
- Search an unmounted disk in destructive mode with improved speed using 4K block size and 64K block count:
|
||||
|
||||
`sudo badblocks -w -b {{4096}} -c {{65536}} {{/dev/sda}}`
|
||||
`sudo badblocks -w -b {{4096}} -c {{65536}} {{/dev/sdX}}`
|
||||
|
|
|
@ -6,27 +6,27 @@
|
|||
|
||||
- Initialise a (local) repository:
|
||||
|
||||
`borg init {{/path/to/repo_directory}}`
|
||||
`borg init {{path/to/repo_directory}}`
|
||||
|
||||
- Backup a directory into the repository, creating an archive called "Monday":
|
||||
|
||||
`borg create --progress {{/path/to/repo_directory}}::{{Monday}} {{/path/to/source_directory}}`
|
||||
`borg create --progress {{path/to/repo_directory}}::{{Monday}} {{path/to/source_directory}}`
|
||||
|
||||
- List all archives in a repository:
|
||||
|
||||
`borg list {{/path/to/repo_directory}}`
|
||||
`borg list {{path/to/repo_directory}}`
|
||||
|
||||
- Extract a specific directory from the "Monday" archive in a remote repository, excluding all *.ext files:
|
||||
|
||||
`borg extract {{user}}@{{host}}:{{/path/to/repo_directory}}::{{Monday}} {{path/to/target_directory}} --exclude '{{*.ext}}'`
|
||||
`borg extract {{user}}@{{host}}:{{path/to/repo_directory}}::{{Monday}} {{path/to/target_directory}} --exclude '{{*.ext}}'`
|
||||
|
||||
- Prune a repository by deleting all archives older than 7 days, listing changes:
|
||||
|
||||
`borg prune --keep-within {{7d}} --list {{/path/to/repo_directory}}`
|
||||
`borg prune --keep-within {{7d}} --list {{path/to/repo_directory}}`
|
||||
|
||||
- Mount a repository as a FUSE filesystem:
|
||||
|
||||
`borg mount {{/path/to/repo_directory}}::{{Monday}} {{/path/to/mountpoint}}`
|
||||
`borg mount {{path/to/repo_directory}}::{{Monday}} {{path/to/mountpoint}}`
|
||||
|
||||
- Display help on creating archives:
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
- Run command as new root directory:
|
||||
|
||||
`chroot {{/path/to/new/root}} {{command}}`
|
||||
`chroot {{path/to/new/root}} {{command}}`
|
||||
|
||||
- Specify user and group (ID or name) to use:
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
- Find files in a specific directory:
|
||||
|
||||
`fd {{pattern}} {{path/to/dir}}`
|
||||
`fd {{pattern}} {{path/to/directory}}`
|
||||
|
||||
- Include ignored and hidden files in the search:
|
||||
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
|
||||
- Set the import prefix string after 3rd-party packages (comma-separated list):
|
||||
|
||||
`goimports -local {{/path/to/package}} {{file}}.go`
|
||||
`goimports -local {{path/to/package}} {{file}}.go`
|
||||
|
|
|
@ -13,4 +13,4 @@
|
|||
|
||||
- Set a refresh token for hangups:
|
||||
|
||||
`hangups --token-path {{/path/to/token}}`
|
||||
`hangups --token-path {{path/to/token}}`
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
- Upload a file with a POST request:
|
||||
|
||||
`cat {{/path/to/file}} | lwp-request -m POST {{http://example.com/some/path}}`
|
||||
`cat {{path/to/file}} | lwp-request -m POST {{http://example.com/some/path}}`
|
||||
|
||||
- Make a request with a custom user agent:
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
- Package and compress a directory and its contents:
|
||||
|
||||
`tar cvf - {{path/to/dir}} | lz4 - {{dir.tar.lz4}}`
|
||||
`tar cvf - {{path/to/directory}} | lz4 - {{dir.tar.lz4}}`
|
||||
|
||||
- Decompress and unpack a directory and its contents:
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
- Connect to a remote server with a specific identity (private key):
|
||||
|
||||
`mosh --ssh="ssh -i {{/path/to/key_file}}" {{username}}@{{remote_host}}`
|
||||
`mosh --ssh="ssh -i {{path/to/key_file}}" {{username}}@{{remote_host}}`
|
||||
|
||||
- Connect to a remote server using a specific port:
|
||||
|
||||
|
@ -26,4 +26,4 @@
|
|||
|
||||
- Usage when `mosh-server` binary is outside standard path:
|
||||
|
||||
`mosh --server={{/path/to/bin/}}mosh-server {{remote_host}}`
|
||||
`mosh --server={{path/to/bin/}}mosh-server {{remote_host}}`
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
|
||||
- Add a directory (must be written with trailing slash) to the include file search path before assembling:
|
||||
|
||||
`nasm -i {{/path/to/include_dir/}} {{source.asm}}`
|
||||
`nasm -i {{path/to/include_dir/}} {{source.asm}}`
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
- Run with a given work directory for intermediate files, save execution report:
|
||||
|
||||
`nextflow run {{workflow}} -work-dir {{/path/to/directory}} -with-report {{report.html}}`
|
||||
`nextflow run {{workflow}} -work-dir {{path/to/directory}} -with-report {{report.html}}`
|
||||
|
||||
- Show details of previous runs in current directory:
|
||||
|
||||
|
|
|
@ -24,4 +24,4 @@
|
|||
|
||||
- Copy to a directory, while keeping the original metadata; `target/` must exist:
|
||||
|
||||
`pax -rw {{path/to/file1}} {{path/to/dir1}} {{path/to/dir2}} {{target/}}`
|
||||
`pax -rw {{path/to/file1}} {{path/to/directory1}} {{path/to/directory2}} {{target/}}`
|
||||
|
|
|
@ -20,4 +20,4 @@
|
|||
|
||||
- Convert a VMWare .vmdk disk image to a KVM .qcow2 disk image:
|
||||
|
||||
`qemu-img convert -O qcow2 {{/path/to/file/foo.vmdk}} {{/path/to/file/foo.qcow2}}`
|
||||
`qemu-img convert -O qcow2 {{path/to/file/foo.vmdk}} {{path/to/file/foo.qcow2}}`
|
||||
|
|
|
@ -2,18 +2,19 @@
|
|||
|
||||
> Securely remove files or directories.
|
||||
> Overwrites the existing data one or multiple times. Drop in replacement for rm.
|
||||
> More information: <http://srm.sourceforge.net/srm.html>.
|
||||
|
||||
- Remove a file after a single-pass overwriting with random data:
|
||||
|
||||
`srm -s {{/path/to/file}}`
|
||||
`srm -s {{path/to/file}}`
|
||||
|
||||
- Remove a file after seven passes of overwriting with random data:
|
||||
|
||||
`srm -m {{/path/to/file}}`
|
||||
`srm -m {{path/to/file}}`
|
||||
|
||||
- Recursively remove a directory and its contents overwriting each file with a single-pass of random data:
|
||||
|
||||
`srm -r -s {{/path/to/directory}}`
|
||||
`srm -r -s {{path/to/directory}}`
|
||||
|
||||
- Prompt before every removal:
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
- Extract zip files(s) to given path:
|
||||
|
||||
`unzip {{compressed_file(s)}} -d {{/path/to/put/extracted_file(s)}}`
|
||||
`unzip {{compressed_file(s)}} -d {{path/to/put/extracted_file(s)}}`
|
||||
|
||||
- List the contents of a zip file without extracting:
|
||||
|
||||
|
|
|
@ -4,23 +4,23 @@
|
|||
|
||||
- Package and compress a directory and its contents, [r]ecursively:
|
||||
|
||||
`zip -r {{compressed.zip}} {{/path/to/dir}}`
|
||||
`zip -r {{compressed.zip}} {{path/to/directory}}`
|
||||
|
||||
- E[x]clude unwanted files from being added to the compressed archive:
|
||||
|
||||
`zip -r {{compressed.zip}} {{path/to/dir}} -x {{path/to/exclude}}`
|
||||
`zip -r {{compressed.zip}} {{path/to/directory}} -x {{path/to/exclude}}`
|
||||
|
||||
- Archive a directory and its contents with the highest level [9] of compression:
|
||||
|
||||
`zip -r -{{9}} {{compressed.zip}} {{/path/to/dir}}`
|
||||
`zip -r -{{9}} {{compressed.zip}} {{path/to/directory}}`
|
||||
|
||||
- Package and compress multiple directories and files:
|
||||
|
||||
`zip -r {{compressed.zip}} {{/path/to/dir1 /path/to/dir2 /path/to/file}}`
|
||||
`zip -r {{compressed.zip}} {{path/to/directory1}} {{path/to/directory2}} {{path/to/file}}`
|
||||
|
||||
- Create an encrypted archive (user will be prompted for a password):
|
||||
|
||||
`zip -e -r {{compressed.zip}} {{path/to/dir}}`
|
||||
`zip -e -r {{compressed.zip}} {{path/to/directory}}`
|
||||
|
||||
- Add files to an existing zip file:
|
||||
|
||||
|
@ -32,4 +32,4 @@
|
|||
|
||||
- Archive a directory and its contents to a multi-part [s]plit zip file (e.g. 3GB parts):
|
||||
|
||||
`zip -r -s {{3g}} {{compressed.zip}} {{path/to/dir}}`
|
||||
`zip -r -s {{3g}} {{compressed.zip}} {{path/to/directory}}`
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
|
||||
- Add a directory or increment its rank:
|
||||
|
||||
`zoxide add {{path/to/dir}}`
|
||||
`zoxide add {{path/to/directory}}`
|
||||
|
||||
- Remove a directory from `zoxide`'s database:
|
||||
|
||||
`zoxide remove {{path/to/dir}}`
|
||||
`zoxide remove {{path/to/directory}}`
|
||||
|
||||
- Generate shell configuration for command aliases (`z`, `za`, `zi`, `zq`, `zr`):
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
- Convert single images and/or whole directories containing valid image formats:
|
||||
|
||||
`imgp -x {{1366x1000}} {{path/to/dir}} {{path/to/file}}`
|
||||
`imgp -x {{1366x1000}} {{path/to/directory}} {{path/to/file}}`
|
||||
|
||||
- Scale an image by 75% and overwrite the source image to a target resolution:
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# ltrace
|
||||
|
||||
> Display dynamic library calls of a process.
|
||||
> More information: <https://linux.die.net/man/1/ltrace>.
|
||||
|
||||
- Print (trace) library calls of a program binary:
|
||||
|
||||
|
@ -8,12 +9,12 @@
|
|||
|
||||
- Count library calls. Print a handy summary at the bottom:
|
||||
|
||||
`ltrace -c {{/path/to/program}}`
|
||||
`ltrace -c {{path/to/program}}`
|
||||
|
||||
- Trace calls to malloc and free, omit those done by libc:
|
||||
|
||||
`ltrace -e malloc+free-@libc.so* {{/path/to/program}}`
|
||||
`ltrace -e malloc+free-@libc.so* {{path/to/program}}`
|
||||
|
||||
- Write to file instead of terminal:
|
||||
|
||||
`ltrace -o {{file}} {{/path/to/program}}`
|
||||
`ltrace -o {{file}} {{path/to/program}}`
|
||||
|
|
|
@ -1,27 +1,28 @@
|
|||
# mdadm
|
||||
|
||||
> RAID management utility.
|
||||
> More information: <https://linux.die.net/man/8/mdadm>.
|
||||
|
||||
- Create array:
|
||||
|
||||
`mdadm --create {{/path/to/raid_device_file}} --level {{raid_level}} --raid-devices {{number_of_disks}} {{/path/to/disk_device_file}}`
|
||||
`mdadm --create {{/dev/md/MyRAID}} --level {{raid_level}} --raid-devices {{number_of_disks}} {{/dev/sdXN}}`
|
||||
|
||||
- Stop array:
|
||||
|
||||
`mdadm -S {{/path/to/raid_device_file}}`
|
||||
`mdadm --stop {{/dev/md0}}`
|
||||
|
||||
- Mark disk as failed:
|
||||
|
||||
`mdadm {{/path/to/raid_device_file}} -f {{/path/to/disk_device_file}}`
|
||||
`mdadm --fail {{/dev/md0}} {{/dev/sdXN}}`
|
||||
|
||||
- Remove disk:
|
||||
|
||||
`mdadm {{/path/to/raid_device_file}} -r {{/path/to/disk_device_file}}`
|
||||
`mdadm --remove {{/dev/md0}} {{/dev/sdXN}}`
|
||||
|
||||
- Add disk to array:
|
||||
|
||||
`mdadm {{/path/to/raid_device_file}} -a {{/path/to/disk_device_file}}`
|
||||
`mdadm --assemble {{/dev/md0}} {{/dev/sdXN}}`
|
||||
|
||||
- Show RAID info:
|
||||
|
||||
`mdadm -D {{/path/to/raid_device_file}}`
|
||||
`mdadm --detail {{/dev/md0}}`
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
# runsvchdir
|
||||
|
||||
> Change the directory `runsvdir` uses by default.
|
||||
> More information: <http://manpages.ubuntu.com/manpages/focal/man8/runsvchdir.8.html>.
|
||||
|
||||
- Switch `runsvdir` directories:
|
||||
|
||||
`sudo runsvchdir {{/path/to/directory}}`
|
||||
`sudo runsvchdir {{path/to/directory}}`
|
||||
|
|
|
@ -9,4 +9,4 @@
|
|||
|
||||
- Combine two arbitrary shadow and password files:
|
||||
|
||||
`sudo unshadow {{/path/to/passwd}} {{/path/to/shadow}}`
|
||||
`sudo unshadow {{path/to/passwd}} {{path/to/shadow}}`
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
- Create new user with specified shell:
|
||||
|
||||
`useradd --shell {{/path/to/shell}} {{name}}`
|
||||
`useradd --shell {{path/to/shell}} {{name}}`
|
||||
|
||||
- Create new user belonging to additional groups (mind the lack of whitespace):
|
||||
|
||||
|
|
|
@ -12,4 +12,4 @@
|
|||
|
||||
- Create a new home directory for a user and move their files to it:
|
||||
|
||||
`usermod -m -d {{/path/to/home}} {{user}}`
|
||||
`usermod -m -d {{path/to/home}} {{user}}`
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
- Sign an application with a certificate:
|
||||
|
||||
`codesign -s "{{My Company Name}}" {{/path/to/App.app}}`
|
||||
`codesign -s "{{My Company Name}}" {{path/to/App.app}}`
|
||||
|
||||
- Verify the certificate of an application:
|
||||
|
||||
`codesign -v {{/path/to/App.app}}`
|
||||
`codesign -v {{path/to/App.app}}`
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
- Switch `runsvdir` directories:
|
||||
|
||||
`sudo runsvchdir {{/path/to/directory}}`
|
||||
`sudo runsvchdir {{path/to/directory}}`
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
- Switch `runsvdir` directories:
|
||||
|
||||
`sudo runsvchdir {{/path/to/directory}}`
|
||||
`sudo runsvchdir {{path/to/directory}}`
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
- When repairing offline, specify the boot directory:
|
||||
|
||||
`sfc /offbootdir={{path/to/dir}}`
|
||||
`sfc /offbootdir={{path/to/directory}}`
|
||||
|
||||
- When repairing offline, specify the Windows directory:
|
||||
|
||||
`sfc /offwindir={{path/to/dir}}`
|
||||
`sfc /offwindir={{path/to/directory}}`
|
||||
|
|
Loading…
Add table
Reference in a new issue