mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-06 07:46:09 +00:00
Update cheatsheets
This commit is contained in:
@@ -17,7 +17,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`sudo emerge {{[-avuDN|--ask --verbose --update --deep --newuse]}} @world`
|
||||
|
||||
- Resume a failed updated, skipping the failing package:
|
||||
- Resume a failed update, skipping the failing package:
|
||||
|
||||
`sudo emerge --resume --skipfirst`
|
||||
|
||||
|
||||
41
tldr/linux/rnm
Normal file
41
tldr/linux/rnm
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# rnm
|
||||
|
||||
> Bulk Rename Utility.
|
||||
> More information: <https://github.com/neurobin/rnm>.
|
||||
|
||||
- Replace a search string with a replacement string in filenames:
|
||||
|
||||
`rnm -ss {{old}} -rs {{new}} {{path/to/directory}}`
|
||||
|
||||
- Use a fixed (literal) search and replace string instead of regex:
|
||||
|
||||
`rnm -ssf {{old}} -rs {{new}} {{path/to/files}}`
|
||||
|
||||
- Add an auto-incremented index to filenames starting from 1:
|
||||
|
||||
`rnm -i 1 -inc 1 -rs {{_}} {{path/to/files}}`
|
||||
|
||||
- Rename files using a list of new names from a text file:
|
||||
|
||||
`rnm -ns/f {{path/to/names.txt}} {{path/to/files}}`
|
||||
|
||||
- Rename only files (ignoring directories and links):
|
||||
|
||||
`rnm -fo -ss {{pattern}} -rs {{replacement}} {{path/to/files}}`
|
||||
|
||||
- Sort input files by modification time before renaming:
|
||||
|
||||
`rnm -s/mt -ss {{pattern}} -rs {{replacement}} {{path/to/files}}`
|
||||
|
||||
- Run a simulation without making actual changes:
|
||||
|
||||
`rnm -sim -ss {{pattern}} -rs {{replacement}} {{path/to/files}}`
|
||||
|
||||
- Undo the last renaming operation:
|
||||
|
||||
`rnm -u`
|
||||
14
tldr/pandoc
14
tldr/pandoc
@@ -8,17 +8,25 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Convert documents between various formats.
|
||||
> More information: <https://pandoc.org/MANUAL.html>.
|
||||
|
||||
- Convert file to PDF (the output format is determined by file extension):
|
||||
- Convert a Markdown file to PDF using `pdflatex` (the formats are determined by file extensions):
|
||||
|
||||
`pandoc {{path/to/input.md}} {{[-o|--output]}} {{path/to/output.pdf}}`
|
||||
|
||||
- Convert a Markdown file to PDF using the specified PDF engine:
|
||||
|
||||
`pandoc {{path/to/input.md}} --pdf-engine {{tectonic|weasyprint|typst|...}} {{[-o|--output]}} {{path/to/output.pdf}}`
|
||||
|
||||
- Convert to a standalone file with the appropriate headers/footers (for LaTeX, HTML, etc.):
|
||||
|
||||
`pandoc {{path/to/input.md}} {{[-s|--standalone]}} {{[-o|--output]}} {{path/to/output.html}}`
|
||||
|
||||
- Manually specify format detection and conversion (overriding automatic format detection using filename extension or when filename extension is missing altogether):
|
||||
- Manually specify formats (overriding automatic format detection using the filename extension, or when there is no extension):
|
||||
|
||||
`pandoc {{-f|-r|--from|--read}} {{docx|...}} {{path/to/input}} {{-t|-w|--to|--write}} {{pdf|...}} {{[-o|--output]}} {{path/to/output}}`
|
||||
`pandoc {{[-f|--from]}} {{docx|...}} {{path/to/input}} {{[-t|--to]}} {{pdf|...}} {{[-o|--output]}} {{path/to/output}}`
|
||||
|
||||
- Transform a document using a Lua script (see <https://pandoc.org/lua-filters.html> for more information):
|
||||
|
||||
`pandoc {{path/to/input}} {{[-L|--lua-filter]}} {{path/to/filter.lua}} {{[-o|--output]}} {{path/to/output}}`
|
||||
|
||||
- List all supported input formats:
|
||||
|
||||
|
||||
16
tldr/tqdm
16
tldr/tqdm
@@ -5,9 +5,21 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# tqdm
|
||||
|
||||
> Create a progress bar.
|
||||
> Show progress over time of a command.
|
||||
> More information: <https://tqdm.github.io/>.
|
||||
|
||||
- Show iterations per second and use `stdout` afterwards:
|
||||
|
||||
`{{seq 10000000}} | tqdm | {{command}}`
|
||||
|
||||
- Create a progress bar:
|
||||
|
||||
`seq 10000000 | tqdm --total 10000000 --null`
|
||||
`{{seq 10000000}} | tqdm --total {{10000000}} | {{command}}`
|
||||
|
||||
- Create an archive out of a directory and use the file count of that directory to create a progress bar:
|
||||
|
||||
`zip -r {{path/to/archive.zip}} {{path/to/directory}} | tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null`
|
||||
|
||||
- Create an archive with tar and create a progress bar (system agnostic, GNU tar uses `stdout` while BSD tar uses `stderr`):
|
||||
|
||||
`tar vzcf {{path/to/archive.tar.gz}} {{path/to/directory}} 2>&1 | tqdm --total $(find {{path/to/directory}} | wc -l) --unit files --null`
|
||||
|
||||
Reference in New Issue
Block a user