Update cheatsheets

This commit is contained in:
ivuorinen
2025-05-24 00:19:30 +00:00
parent 19fae7249d
commit eca9d9488d
5 changed files with 57 additions and 6 deletions

41
tldr/git-name-rev Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git name-rev
> Describe a commit using existing ref names.
> More information: <https://git-scm.com/docs/git-name-rev>.
- Show the name for HEAD:
`git name-rev HEAD`
- Show only the name:
`git name-rev --name-only HEAD`
- Enumerate all matching ref names:
`git name-rev --all`
- Use only tags to name the commit:
`git name-rev --tags HEAD`
- Exit with a non-zero status code instead of printing `undefined` for unknown commits:
`git name-rev --no-undefined {{commit-ish}}`
- Show names for multiple commits:
`git name-rev HEAD~1 HEAD~2 main`
- Restrict names to branch refs:
`git name-rev --refs refs/heads/ {{commit-ish}}`
- Read commit IDs from `stdin`:
`echo "{{commit-ish}}" | git name-rev --annotate-stdin`

View File

@@ -6,11 +6,12 @@ source: https://github.com/tldr-pages/tldr.git
# fadvise
> Control Linux file caching behavior.
> See also: `fincore`.
> More information: <https://manned.org/fadvise>.
- Preload a file into cache:
- Preload a file or directory into cache:
`fadvise {{[-a|--advice]}} willneeded {{path/to/file}}`
`fadvise {{[-a|--advice]}} willneeded {{path/to/file_or_directory}}`
- Suggest dropping a file from cache:

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# fincore
> Display how much cache memory a file is taking.
> See also: `fadvise`.
> More information: <https://manned.org/fincore>.
- Display cache details for a file:

View File

@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
- Open a dialog containing a specific dropdown menu and print the selected item to `stdout`:
`kdialog --combobx "{{message}}" "{{item1}}" "{{item2}}" "{{...}}"`
`kdialog --combobox "{{message}}" "{{item1}}" "{{item2}}" "{{...}}"`
- Open a file chooser dialog and print the selected file's path to `stdout`:

View File

@@ -8,9 +8,9 @@ source: https://github.com/tldr-pages/tldr.git
> A service that watches files, and triggers actions when changes occur.
> More information: <https://facebook.github.io/watchman/docs/cli-options>.
- Start watching a directory for changes:
- Infer the root directory of the project containing the specified directory, and watch its files and sub-folders for changes:
`watchman watch {{path/to/directory}}`
`watchman watch-project {{path/to/directory}}`
- Add a trigger to run a command when files with a specified filename pattern in a watched directory change:
@@ -20,10 +20,14 @@ source: https://github.com/tldr-pages/tldr.git
`watchman watch-list`
- Delete a watch on a directory:
- Delete a watch on a directory and its associated triggers:
`watchman watch-del {{path/to/watched_directory}}`
- Delete all watched directories and triggers:
`watchman watch-del-all`
- List all triggers on a watched directory:
`watchman trigger-list {{path/to/watched_directory}}`
@@ -31,3 +35,7 @@ source: https://github.com/tldr-pages/tldr.git
- Delete a trigger from a watched directory:
`watchman trigger-del {{path/to/watched_directory}} {{trigger_name}}`
- Temporarily stop `watchman`, until the next time you call a `watchman` command:
`watchman shutdown-server`