neulab/tldr huggingface dataset:
Uncompress PDF page streams for editing the PDF in a text editor (e.g., vim, emacs) pdftk doc.pdf output doc.unc.pdf uncompress
Repair a PDF's corrupted XREF table and stream lengths, if possible pdftk broken.pdf output fixed.pdf
Burst a single PDF document into pages and dump its data to doc_data.txt pdftk in.pdf burst
Burst a single PDF document into encrypted pages. Allow low-quality printing pdftk in.pdf burst owner_pw foopass allow DegradedPrinting
Write a report on PDF document metadata and bookmarks to report.txt pdftk in.pdf dump_data output report.txt
Rotate the first PDF page to 90 degrees clockwise pdftk in.pdf cat 1east 2-end output out.pdf
Rotate an entire PDF document to 180 degrees pdftk in.pdf cat 1-endsouth output out.pdf
This is a port of pdftk to java. See https://gitlab.com/pdftk-java/pdftk The original program can be found at www.pdftk.com
Original author of pdftk is Sid Steward (sid.steward at pdflabs dot com).
Passing a password as a command line parameter is insecure because it can get saved into the shell's history and be accessible by other users via /proc. Use the keyword PROMPT and input any passwords via standard input instead.
DLV(1)                       General Commands Manual                      DLV(1)
dlv - Delve is a debugger for the Go programming language.
dlv [flags]
Delve is a source level debugger for Go programs.
Delve enables you to interact with your program by controlling the execution of the process, evaluating variables, and providing information of thread / goroutine state, CPU register state and more.
The goal of this tool is to provide a simple yet powerful interface for debugging Go programs.
Pass flags to the program you are debugging using --, for example:
dlv exec ./hello -- server --config conf/config.toml
--accept-multiclient[=false]      Allows a headless server to accept multiple client connections.
--allow-non-terminal-interactive[=false]      Allows interactive sessions of Delve that don't have a terminal as stdin, stdout and stderr
--api-version=1      Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md.
--backend="default"      Backend selection (see 'dlv help backend').
--build-flags=""      Build flags, to be passed to the compiler. For example: --build-flags="-tags=integration -mod=vendor -cover -v"
--check-go-version[=true]      Exits if the version of Go in use is not compatible (too old or too new) with the version of Delve.
--disable-aslr[=false]      Disables address space randomization
--headless[=false]      Run debug server only, in headless mode.
-h, --help[=false]      help for dlv
--init=""      Init file, executed by the terminal client.
-l, --listen="127.0.0.1:0"      Debugging server listen address.
--log[=false]      Enable debugging server logging.
--log-dest=""      Writes logs to the specified file or file descriptor (see 'dlv help log').
--log-output=""      Comma separated list of components that should produce debug output (see 'dlv help log')
--only-same-user[=true]      Only connections from the same user that started this instance of Delve are allowed to connect.
-r, --redirect=[]      Specifies redirect rules for target process (see 'dlv help redirect')
--wd=""      Working directory for running the program.
dlv-attach(1), dlv-connect(1), dlv-core(1), dlv-dap(1), dlv-debug(1), dlv-exec(1), dlv-replay(1), dlv-run(1), dlv-test(1), dlv-trace(1), dlv-version(1)
AUTORANDR(1)                 General Commands Manual                AUTORANDR(1)
autorandr - automatically select a display configuration based on connected devices
autorandr [OPTION] [PROFILE]
This program automatically detects connected display hardware and then loads an appropriate X11 setup using xrandr. It also supports the use of display profiles for different hardware setups.
Autorandr also includes several virtual configurations including off, common, clone-largest, horizontal, and vertical. See the documentation for explanation of each.
-h, --help Display help text and exit
-c, --change Automatically load the first detected profile
-d, --default PROFILE Make profile PROFILE the default profile. The default profile is used if no suitable profile can be identified. Else, the current configuration is kept.
-l, --load PROFILE Load profile PROFILE
-s, --save PROFILE Save the current setup to profile PROFILE
-r, --remove PROFILE Remove profile PROFILE
--batch Run autorandr for all users with active X11 sessions
--current List only the current (active) configuration(s)
--config Dump the variable values of your current xrandr setup
--debug Enable verbose output
--detected List only the detected (i.e. available) configuration(s)
--dry-run Don't change anything, only print the xrandr commands
--fingerprint Fingerprint the current hardware setup
--force Force loading or reloading of a profile
--skip-options [OPTION] ... Set a comma-separated list of xrandr arguments to skip both in change detection and profile application. See xrandr(1) for xrandr arguments.
Phillip Berndt <phillip.berndt@googlemail.com> See https://github.com/phillipberndt/autorandr for a full list of contributors.
Report issues upstream on GitHub: https://github.com/phillipberndt/autorandr/issues Please attach the output of xrandr --verbose to your bug report if appropriate.
For examples, advanced usage (including predefined per-profile & global hooks and wildcard EDID matching), and full documentation, see https://github.com/phillipberndt/autorandr.
DEBCHANGE(1)                 General Commands Manual                DEBCHANGE(1)
debchange - Tool for maintenance of the debian/changelog file in a source package
debchange [options] [text ...] dch [options] [text ...]
debchange or its alias dch will add a new comment line to the Debian changelog in the current source tree.  This command must be run from within that tree.  If the text of the change is given on the command line, debchange will run in batch mode and simply add the text, with line breaks as necessary, at the appropriate place in debian/changelog (or the changelog specified by options, as described below).  If the text given on the command line is a null string, debchange will run in batch mode without adding any text.  If the text given on the command line is a space string, debchange will run in batch mode and add a blank changelog entry.  If no text is specified then debchange will run the editor as determined by sensible-editor for you to edit the file.  (The environment variables VISUAL and EDITOR are used in this order to determine which editor to use.)  Editors which understand the +n option for starting the editing on a specified line will use this to move to the correct line of the file for editing.  If the editor is quit without modifying the temporary file, debchange will exit without touching the existing changelog.  Note that the changelog is assumed to be encoded with the UTF-8 encoding.  If it is not, problems may occur.  Please see the iconv(1) manpage to find out how to convert changelogs from legacy encodings.  Finally, a changelog or NEWS file can be created from scratch using the --create option described below.
debchange also supports automatically producing bug-closing changelog entries, using the --closes option.  This will usually query the BTS, the Debian Bug Tracking System (see https://bugs.debian.org/) to determine the title of the bug and the package in which it occurs.  This behaviour can be stopped by giving a --noquery option or by setting the configuration variable DEBCHANGE_QUERY_BTS to no, as described below.  In either case, the editor (as described above) will always be invoked to give an opportunity to modify the entries, and the changelog will be accepted whether or not modifications are made.  An extra changelog entry can be given on the command line in addition to the closes entries.
At most one of --append, --increment, --edit, --release, and --newversion may be specified as listed below. If no options are specified, debchange will use heuristics to guess whether or not the package has been successfully released, and behave as if --increment had been specified if the package has been released, or otherwise as if --append has been specified.
Two different sets of heuristics can be used, as controlled by the --release-heuristic option or the DEBCHANGE_RELEASE_HEURISTIC configuration variable. The default changelog heuristic assumes the package has been released unless its changelog contains UNRELEASED in the distribution field. If this heuristic is enabled then the distribution will default to UNRELEASED in new changelog entries, and the --mainttrailer option described below will be automatically enabled. This can be useful if a package can be released by different maintainers, or if you do not keep the upload logs. The alternate log heuristic determines if a package has been released by looking for an appropriate dupload(1) or dput(1) log file in the parent directory.  A warning will be issued if the log file is found but a successful upload is not recorded. This may be because the previous upload was performed with a version of dupload prior to 2.1 or because the upload failed.
If either --increment or --newversion is used, the name and email for the new version will be determined as follows.  If the environment variable DEBFULLNAME is set, this will be used for the maintainer full name; if not, then NAME will be checked.  If the environment variable DEBEMAIL is set, this will be used for the email address.  If this variable has the form "name <email>", then the maintainer name will also be taken from here if neither DEBFULLNAME nor NAME is set.  If this variable is not set, the same test is performed on the environment variable EMAIL.  Next, if the full name has still not been determined, then use getpwuid(3) to determine the name from the password file.  If this fails, use the previous changelog entry.  For the email address, if it has not been set from DEBEMAIL or EMAIL, then look in /etc/mailname, then attempt to build it from the username and FQDN, otherwise use the email address in the previous changelog entry.  In other words, it's a good idea to set DEBEMAIL and DEBFULLNAME when using this script.
Support is included for changelogs that record changes by multiple co- maintainers of a package. If an entry is appended to the current version's entries, and the maintainer is different from the maintainer who is listed as having done the previous entries, then lines will be added to the changelog to tell which maintainers made which changes. Currently only one of the several such styles of recording this information is supported, in which the name of the maintainer who made a set of changes appears on a line before the changes, inside square brackets. This can be switched on and off using the --[no]multimaint option or the DEBCHANGE_MULTIMAINT configuration file option; the default is to enable it.  Note that if an entry has already been marked in this way, then this option will be silently ignored.
If the directory name of the source tree has the form package-version, then debchange will also attempt to rename it if the (upstream) version number changes.  This can be prevented by using the --preserve command line or configuration file option as described below.
If --force-bad-version or --allow-lower-version is used, debchange will not stop if the new version is less than the current one.  This is especially useful while doing backports.
Directory name checking In common with several other scripts in the devscripts package, debchange will climb the directory tree until it finds a debian/changelog file.  As a safeguard against stray files causing potential problems, it will examine the name of the parent directory once it finds the debian/changelog file, and check that the directory name corresponds to the package name.  Precisely how it does this is controlled by two configuration file variables DEVSCRIPTS_CHECK_DIRNAME_LEVEL and DEVSCRIPTS_CHECK_DIRNAME_REGEX, and their corresponding command-line options --check-dirname-level and --check-dirname-regex.
The default changelog to be edited is debian/changelog; however, this can be changed using the --changelog or --news options or the CHANGELOG environment variable, as described below.
--append, -a Add a new changelog entry at the end of the current version's entries.
--increment, -i Increment either the final component of the Debian release number or, if this is a native Debian package, the version number.  On Ubuntu or Tanglu, this will also change the suffix from buildX to ubuntu1/tanglu1.  Use -R, --rebuild for a no change rebuild increment.  This creates a new section at the beginning of the changelog with appropriate headers and footers.  Also, if this is a new version of a native Debian package, the directory name is changed to reflect this.  If DEBCHANGE_RELEASE_HEURISTIC is changelog (default) and the current release is UNRELEASED, this will only change the version of the current changelog stanza. Otherwise, this will create a new changelog stanza with the new version.
--newversion version, -v version This specifies the version number (including the Debian release part) explicitly and behaves as the --increment option in other respects.  It will also change the directory name if the upstream version number has changed.  If DEBCHANGE_RELEASE_HEURISTIC is changelog (default) and the current release is UNRELEASED, this will only change the version of the current changelog stanza. Otherwise, this will create a new changelog stanza with the new version.
--edit, -e Edit the changelog in an editor.
--release, -r Finalize the changelog for a release.  Update the changelog timestamp. If the distribution is set to UNRELEASED, change it to the distribution from the previous changelog entry (or another distribution as specified by --distribution).  If there are no previous changelog entries and an explicit distribution has not been specified, unstable will be used (or the name of the current development release when run under Ubuntu).
--force-save-on-release When --release is used, an editor is opened to allow inspection of the changelog.  The user is required to save the file to accept the modified changelog, otherwise the original will be kept (default).
--no-force-save-on-release Do not do so. Note that a dummy changelog entry may be supplied in order to achieve the same effect - e.g. debchange --release "". The entry will not be added to the changelog but its presence will suppress the editor.
--create This will create a new debian/changelog file (or NEWS if the --news option is used).  You must be in the top-level directory to use this; no directory name checking will be performed.  The package name and version can either be specified using the --package and --newversion options, determined from the directory name using the --fromdirname option or entered manually into the generated changelog file.  The maintainer name is determined from the environment if this is possible, and the distribution is specified either using the --distribution option or in the generated changelog file.
--empty When used in combination with --create, suppress the automatic addition of an "initial release" changelog entry (so that the next invocation of debchange adds the first entry).  Note that this will cause a dpkg-parsechangelog warning on the next invocation due to the lack of changes.
--package package This specifies the package name to be used in the new changelog; this may only be used in conjunction with the --create, --increment and --newversion options.
--nmu, -n Increment the Debian release number for a non-maintainer upload by either appending a ".1" to a non-NMU version number (unless the package is Debian native, in which case "+nmu1" is appended) or by incrementing an NMU version number, and add an NMU changelog comment.  This happens automatically if the packager is neither in the Maintainer nor the Uploaders field in debian/control, unless DEBCHANGE_AUTO_NMU is set to no or the --no-auto-nmu option is used.
--bin-nmu Increment the Debian release number for a binary non-maintainer upload by either appending a "+b1" to a non-binNMU version number or by incrementing a binNMU version number, and add a binNMU changelog comment.
--qa, -q Increment the Debian release number for a Debian QA Team upload, and add a QA upload changelog comment.
--rebuild, -R Increment the Debian release number for a no-change rebuild by appending a "build1" or by incrementing a rebuild version number.
--security, -s Increment the Debian release number for a Debian Security Team non-maintainer upload, and add a Security Team upload changelog comment.
--lts  Increment the Debian release number for a LTS Security Team non- maintainer upload, and add a LTS Security Team upload changelog comment.
--team Increment the Debian release number for a team upload, and add a Team upload changelog comment.
--upstream, -U Don't append distro-name1 to the version on a derived distribution. Increment the Debian version.
--bpo  Increment the Debian release number for an upload to bullseye- backports, and add a backport upload changelog comment.
--stable Increment the Debian release number for an upload to the current stable release.
--local, -lsuffix Add a suffix to the Debian version number for a local build.
--force-bad-version, -b Force a version number to be less than the current one (e.g., when backporting).
--allow-lower-version pattern Allow a version number to be less than the current one if the new version matches the specified pattern.
--force-distribution Force the provided distribution to be used, even if it doesn't match the list of known distributions (e.g. for unofficial distributions).
--auto-nmu Attempt to automatically determine whether a change to the changelog represents a Non Maintainer Upload.  This is the default.
--no-auto-nmu Disable automatic NMU detection.  Equivalent to setting DEBCHANGE_AUTO_NMU to no.
--fromdirname, -d This will take the upstream version number from the directory name, which should be of the form package-version.  If the upstream version number has increased from the most recent changelog entry, then a new entry will be made with version number version-1 (or version if the package is Debian native), with the same epoch as the previous package version.  If the upstream version number is the same, this option will behave in the same way as -i.
--closes nnnnn[,nnnnn ...] Add changelog entries to close the specified bug numbers.  Also invoke the editor after adding these entries.  Will generate warnings if the BTS cannot be contacted (and --noquery has not been specified), or if there are problems with the bug report located.
--[no]query Should we attempt to query the BTS when generating closes entries?
--preserve, -p Preserve the source tree directory name if the upstream version number (or the version number of a Debian native package) changes. See also the configuration variables section below.
--no-preserve, --nopreserve Do not preserve the source tree directory name (default).
--vendor vendor Override the distributor ID over the default returned by dpkg- vendor.  This name is used for heuristics applied to new package versions and for sanity checking of the target distribution.
--distribution dist, -D dist Use the specified distribution in the changelog entry being edited, instead of using the previous changelog entry's distribution for new entries or the existing value for existing entries.
--urgency urgency, -u urgency Use the specified urgency in the changelog entry being edited, instead of using the default "medium" for new entries or the existing value for existing entries.
--changelog file, -c file This will edit the changelog file instead of the standard debian/changelog.  This option overrides any CHANGELOG environment variable setting.  Also, no directory traversing or checking will be performed when this option is used.
--news [newsfile] This will edit newsfile (by default, debian/NEWS) instead of the regular changelog.  Directory searching will be performed.  The changelog will be examined in order to determine the current package version.
--[no]multimaint Should we indicate that parts of a changelog entry have been made by different maintainers?  Default is yes; see the discussion above and also the DEBCHANGE_MULTIMAINT configuration file option below.
--[no]multimaint-merge Should all changes made by the same author be merged into the same changelog section?  Default is no; see the discussion above and also the DEBCHANGE_MULTIMAINT_MERGE configuration file option below.
--maintmaint, -m Do not modify the maintainer details previously listed in the changelog.  This is useful particularly for sponsors wanting to automatically add a sponsorship message without disrupting the other changelog details.  Note that there may be some interesting interactions if multi-maintainer mode is in use; you will probably wish to check the changelog manually before uploading it in such cases.
--controlmaint, -M Use maintainer details from the debian/control Maintainer field rather than relevant environment variables (DEBFULLNAME, DEBEMAIL, etc.).  This option might be useful to restore details of the main maintainer in the changelog trailer after a bogus edit (e.g. when -m was intended but forgot) or when releasing a package in the name of the main maintainer (e.g. the team).
--[no]mainttrailer, -t If mainttrailer is set, it will avoid modifying the existing changelog trailer line (i.e. the maintainer and date-stamp details), unless used with options that require the trailer to be modified (e.g. --create, --release, -i, --qa, etc.)  This option differs from --maintmaint in that it will use multi-maintainer mode if appropriate, with the exception of editing the trailer. See also the DEBCHANGE_MAINTTRAILER configuration file option below.
--check-dirname-level N See the above section "Directory name checking" for an explanation of this option.
--check-dirname-regex regex See the above section "Directory name checking" for an explanation of this option.
--release-heuristic log|changelog Controls how debchange determines if a package has been released, when deciding whether to create a new changelog entry or append to an existing changelog entry.
--help, -h Display a help message and exit successfully.
--version Display version and copyright information and exit successfully.
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced in that order to set configuration variables.  Command line options can be used to override configuration file settings.  Environment variable settings are ignored for this purpose.  The currently recognised variables are:
DEBCHANGE_PRESERVE If this is set to yes, then it is the same as the --preserve command line parameter being used.
DEBCHANGE_QUERY_BTS If this is set to no, then it is the same as the --noquery command line parameter being used.
DEVSCRIPTS_CHECK_DIRNAME_LEVEL, DEVSCRIPTS_CHECK_DIRNAME_REGEX See the above section "Directory name checking" for an explanation of these variables.  Note that these are package-wide configuration variables, and will therefore affect all devscripts scripts which check their value, as described in their respective manpages and in devscripts.conf(5).
DEBCHANGE_RELEASE_HEURISTIC Controls how debchange determines if a package has been released, when deciding whether to create a new changelog entry or append to an existing changelog entry. Can be either log or changelog.
DEBCHANGE_MULTIMAINT If set to no, debchange will not introduce multiple-maintainer distinctions when a different maintainer appends an entry to an existing changelog.  See the discussion above.  Default is yes.
DEBCHANGE_MULTIMAINT_MERGE If set to yes, when adding changes in multiple-maintainer mode debchange will check whether previous changes by the current maintainer exist and add the new changes to the existing block rather than creating a new block.  Default is no.
DEBCHANGE_MAINTTRAILER If this is set to no, then it is the same as the --nomainttrailer command line parameter being used.
DEBCHANGE_TZ Use this timezone for changelog entries.  Default is the user/system timezone as shown by `date -R` and affected by the environment variable TZ.
DEBCHANGE_LOWER_VERSION_PATTERN If this is set, then it is the same as the --allow-lower-version command line parameter being used.
DEBCHANGE_AUTO_NMU If this is set to no then debchange will not attempt to automatically determine whether the current changelog stanza represents an NMU.  The default is yes.  See the discussion of the --nmu option above.
DEBCHANGE_FORCE_SAVE_ON_RELEASE If this is set to no, then it is the same as the --no-force-save-on-release command line parameter being used.
DEBCHANGE_VENDOR Use this vendor instead of the default (dpkg-vendor output).  See --vendor for details.
DEBEMAIL, EMAIL, DEBFULLNAME, NAME See the above description of the use of these environment variables.
CHANGELOG This variable specifies the changelog to edit in place of debian/changelog.  No directory traversal or checking is performed when this variable is set.  This variable is overridden by the --changelog command-line setting.
VISUAL, EDITOR These environment variables (in this order) determine the editor used by sensible-editor.
debc(1), debclean(1), dput(1), dupload(1), devscripts.conf(5)
The original author was Christoph Lameter <clameter@debian.org>.  Many substantial changes and improvements were made by Julian Gilbey <jdg@debian.org>.
CODESPELL(1)                      User Commands                     CODESPELL(1)
codespell - detect spelling mistakes in source code
codespell [OPTIONS] [file1 file2 ... fileN]
codespell is designed to find and fix common misspellings in text files. It is designed primarily for checking misspelled words in source code, but it can be used with other files as well.
-d, --disable-colors disable colors even when printing to terminal (always on for Windows)
-c, --enable-colors enable colors even when not printing to terminal
-w, --write-changes write changes in place if possible
-D FILE, --dictionary=FILE Custom dictionary file that contains spelling corrections. If this flag is not specified or equals "-" then the default dictionary is used. This option can be specified multiple times.
-I FILE, --ignore-words=FILE File that contains words which will be ignored by codespell. File must contain 1 word per line. Words are case sensitive based on how they are written in codespell_lib/data/dictionary.txt
-L WORDS, --ignore-words-list=WORDS Comma separated list of words to be ignored by codespell. Words are case sensitive based on how they are written in codespell_lib/data/dictionary.txt
-r REGEX, --regex=REGEX Regular expression which is used to find words. By default any alphanumeric character, the underscore, the hyphen, and the apostrophe is used to build words (i.e. [\w\-'?`]+). This option cannot be specified together with the write-changes functionality.
-s, --summary print summary of fixes
-S SKIP, --skip=SKIP Comma-separated list of files to skip. It accepts globs as well. E.g.: if you want codespell to skip .eps and .txt files, you'd give "*.eps,*.txt" to this option.
-x FILE, --exclude-file=FILE FILE with lines that should not be changed
-i INTERACTIVE, --interactive=INTERACTIVE Set interactive mode when writing changes. 0 is the same as no interactivity; 1 makes codespell ask for confirmation; 2 ask user to choose one fix when more than one is available; 3 applies both 1 and 2
-q QUIET_LEVEL, --quiet-level=QUIET_LEVEL Bitmask that allows codespell to run quietly. 0: the default, in which all messages are printed. 1: disable warnings about wrong encoding. 2: disable warnings about binary file. 4: shut down warnings about automatic fixes that were disabled in dictionary. 8: don't print anything for non-automatic fixes. 16: don't print fixed files.
-e, --hard-encoding-detection Use chardet to detect the encoding of each file. This can slow down codespell, but is more reliable in detecting encodings other than utf-8, iso8859-1 and ascii.
-f, --check-filenames Check file names as well.
-H, --check-hidden Check hidden files (those starting with ".") as well.
Lucas De Marchi <lucas.de.marchi@gmail.com>
https://github.com/codespell-project/codespell
CHOWN(1)                          User Commands                         CHOWN(1)
chown - change file owner and group
chown [OPTION]... [OWNER][:[GROUP]] FILE... chown [OPTION]... --reference=RFILE FILE...
This manual page documents the GNU version of chown.  chown changes the user and/or group ownership of each given file.  If only an owner (a user name or numeric user ID) is given, that user is made the owner of each given file, and the files' group is not changed.  If the owner is followed by a colon and a group name (or numeric group ID), with no spaces between them, the group ownership of the files is changed as well. If a colon but no group name follows the user name, that user is made the owner of the files and the group of the files is changed to that user's login group.  If the colon and group are given, but the owner is omitted, only the group of the files is changed; in this case, chown performs the same function as chgrp.  If only a colon is given, or if the entire operand is empty, neither the owner nor the group is changed.
Change the owner and/or group of each FILE to OWNER and/or GROUP.  With --reference, change the owner and group of each FILE to those of RFILE.
--from=CURRENT_OWNER:CURRENT_GROUP change the owner and/or group of each file only if its current owner and/or group match those specified here.  Either may be omitted, in which case a match is not required for the omitted attribute
--reference=RFILE use RFILE's owner and group rather than specifying OWNER:GROUP values
Owner is unchanged if missing.  Group is unchanged if missing, but changed to login group if implied by a ':' following a symbolic OWNER. OWNER and GROUP may be numeric as well as symbolic.
chown root /u Change the owner of /u to "root".
chown root:staff /u Likewise, but also change its group to "staff".
chown -hR root /u Change the owner of /u and subfiles to "root".
chown(2)
Full documentation <https://www.gnu.org/software/coreutils/chown> or available locally via: info '(coreutils) chown invocation'
RANGER(1)                         ranger manual                        RANGER(1)
ranger - visual file manager
ranger [--version] [--help] [--debug] [--clean] [--cachedir=directory] [--confdir=directory] [--datadir=directory] [--copy-config=which] [--choosefile=target] [--choosefiles=target] [--choosedir=target] [--selectfile=filepath] [--show-only-dirs] [--list-unused-keys] [--list-tagged-files=tag] [--profile] [--cmd=command] [path ...]
ranger is a console file manager with VI key bindings.
This manual contains instructions on how to use and configure ranger.
Inside ranger, you can press ? for a list of key bindings, commands or settings.
The README contains install instructions.
The file HACKING.md contains guidelines for code modification.
The directory doc/configs contains configuration files.  They are usually installed to /usr/share/doc/ranger/config and can be obtained with ranger's --copy-config option.
The directory examples contains reference implementations for ranger plugins, sample configuration files and some programs for integrating ranger with other software.  They are usually installed to /usr/share/doc/ranger/examples.
The man page of rifle(1) describes the functions of the file opener
The section LINKS of this man page contains further resources.
path ...      Each path will be opened in a tab and if the path is a file it will be selected.  Omitting this is equivalent to providing the current directory.
-d, --debug   Activate the debug mode: Whenever an error occurs, ranger will exit and print a full traceback.  The default behavior is to merely print the name of the exception in the statusbar/log and try to keep running.
-c, --clean   Activate the clean mode:  ranger will not access or create any configuration files nor will it leave any traces on your system.  This is useful when your configuration is broken, when you want to avoid clutter, etc.
--cachedir=dir Change the cache directory of ranger from $XDG_CACHE_HOME or ~/.cache/ranger to "dir".
-r dir, --confdir=dir Change the configuration directory of ranger from $XDG_CONFIG_HOME or ~/.config/ranger to "dir".
--datadir=dir Change the data directory of ranger from $XDG_DATA_HOME or ~/.local/share/ranger to "dir".
--copy-config=file Create copies of the default configuration files in your local configuration directory.  Existing ones will not be overwritten.  Possible values: all, commands, commands_full, rc, rifle, scope.
Note: You may want to disable loading of the global configuration files by exporting RANGER_LOAD_DEFAULT_RC=FALSE in your environment.  See also: FILES, ENVIRONMENT
--copy-config=commands will copy only a small sample configuration file with a thoroughly commented example.  It is recommended to keep this file tidy to avoid getting defunct commands on ranger upgrades.  The full default commands.py can be copied with --copy-config=commands_full, but that file will be ignored by ranger and serves only as a reference for making your own commands.
--choosefile=targetfile Allows you to pick a file with ranger.  This changes the behavior so that when you open a file, ranger will exit and write the absolute path of that file into targetfile.
--choosefiles=targetfile Allows you to pick multiple files with ranger.  This changes the behavior so that when you open a file, ranger will exit and write the absolute paths of all selected files into targetfile, adding one newline after each filename.
--choosedir=targetfile Allows you to pick a directory with ranger.  When you exit ranger, it will write the last visited directory into targetfile.
--selectfile=targetfile Open ranger with targetfile selected. This is a legacy option, superseded by the behavior for the POSITIONAL ARGUMENTS.
--show-only-dirs Display only the directories. May be used in conjunction with --choosedir=targetfile.
--list-unused-keys List common keys which are not bound to any action in the "browser" context.  This list is not complete, you can bind any key that is supported by curses: use the key code returned by "getch()".
--list-tagged-files=tag List all files which are tagged with the given tag.  Note: Tags are single characters.  The default tag is "*"
--profile     Print statistics of CPU usage on exit.
--cmd=command Execute the command after the configuration has been read. Use this option multiple times to run multiple commands.
--version     Print the version and exit.
-h, --help    Print a list of options and exit.
This part explains how certain parts of ranger work and how they can be used efficiently.
TAGS Tags are single characters which are displayed left of a filename.  You can use tags however you want.  Press "t" to toggle tags and "ut" to remove any tags of the selection. The default tag is an Asterisk ("*"), but you can use any tag by typing "<tagname>.
PREVIEWS By default, only text files are previewed, but you can enable external preview scripts by setting the option "use_preview_script" and "preview_files" to true.
This default script is %rangerdir/data/scope.sh. It contains more documentation and calls to many external programs to generate previews. They are automatically used when available but completely optional.
For general usage: - "file" for determining file types
- "chardet" (Python package) for improved encoding detection of text files
- "sudo" to use the "run as root" feature
- "python-bidi" (Python package) to display right-to-left file names correctly (Hebrew, Arabic)
For enhanced file previews (with scope.sh): - "img2txt" (from "caca-utils") for ASCII-art image previews
- "w3mimgdisplay", "ueberzug", "mpv", "iTerm2", "kitty", "terminology" or "urxvt" for image previews
- "convert" (from "imagemagick") to auto-rotate images and for SVG previews
- "ffmpegthumbnailer" for video thumbnails
- "highlight", "bat" or "pygmentize" for syntax highlighting of code
- "atool", "bsdtar", "unrar" and/or "7z" to preview archives
- "bsdtar", "tar", "unrar", "unzip" and/or "zipinfo" (and "sed") to preview archives as their first image
- "lynx", "w3m" or "elinks" to preview html pages
- "pdftotext" or "mutool" (and "fmt") for textual pdf previews, "pdftoppm" to preview as image
- "djvutxt" for textual DjVu previews, "ddjvu" to preview as image
- "calibre" or "epub-thumbnailer" for image previews of ebooks
- "transmission-show" for viewing BitTorrent information
- "mediainfo" or "exiftool" for viewing information about media files
- "odt2txt" for OpenDocument text files (odt, ods, odp and sxw)
- "python" or "jq" for JSON files
- "fontimage" for font previews
Install these programs (just the ones you need) and scope.sh will automatically use them.
Independently of the preview script, there is a feature to preview images by drawing them directly into the terminal. To enable this feature, set the option "preview_images" to true and enable one of the image preview modes:
This only works in iTerm2 compiled with image preview support, but works over ssh.
To enable this feature, set the option "preview_images_method" to iterm2.
This feature relies on the dimensions of the terminal's font.  By default, a width of 8 and height of 11 are used.  To use other values, set the options "iterm2_font_width" and "iterm2_font_height" to the desired values.
This only works in Kitty. It requires PIL (or pillow) to work.  Allows remote image previews, for example in an ssh session.
To enable this feature, set the option "preview_images_method" to kitty.
This only works in terminology. It can render vector graphics, but works only locally.
To enable this feature, set the option "preview_images_method" to terminology.
ueberzug
Ueberzug is a command line utility which draws images on terminals using child windows. It requires PIL (or pillow) and relies on X11. This makes it compatible (in a limited way, i.e., tmux splits are not supported) with many terminals and tmux but not the Linux console or Wayland.
To enable this feature, set the option "preview_images_method" to ueberzug.
This only works in urxvt compiled with pixbuf support. Does not work over ssh.
Essentially this mode sets an image as a terminal background temporarily, so it will break any previously set image background.
To enable this feature, set the option "preview_images_method" to urxvt.
urxvt-full
The same as urxvt but utilizing not only the preview pane but the whole terminal window.
To enable this feature, set the option "preview_images_method" to urxvt- full.
This does not work over ssh, requires certain terminals (tested on "xterm" and "urxvt") and is incompatible with tmux, although it works with screen.
To enable this feature, install the program "w3m" and set the option "preview_images_method" to w3m.
When using a terminal with a nonzero border which is not automatically detected, the w3m preview will be misaligned.  Use the "w3m_offset" option to manually adjust the image offset. This should be the same value as the terminal's border value.
SELECTION The selection is defined as "All marked files IF THERE ARE ANY, otherwise the current file."  Be aware of this when using the :delete command, which deletes all files in the selection.
You can mark files by pressing <Space>, v, etc.  A yellow Mrk symbol at the bottom right indicates that there are marked files in this directory.
MACROS Macros can be used in commands to abbreviate things.
%f   the highlighted file %d   the path of the current directory %s   the selected files in the current directory %t   all tagged files in the current directory %c   the full paths of the currently copied/cut files %p   the full paths of selected files
The macros %f, %d, %p, and %s also have upper case variants, %F, %D, %P, and %S, which refer to the next tab.  To refer to specific tabs, add a number in between.  (%7s = selection of the seventh tab.)
%c is the only macro which ranges out of the current directory. So you may "abuse" the copying function for other purposes, like diffing two files which are in different directories:
Yank the file A (type yy), move to the file B, then type @diff %c %f
Macros for file paths are generally shell-escaped so they can be used in the "shell" command.
When mapping keys you can use the placeholder <any>, the key entered in that position can be used through the %any and %any_path macros. (When using multiple <any> placeholders you can index the macros: %any0, %any_path0, %any1, %any_path1...) The macro %any will be replaced with the key pressed in the position of the <any> placeholder. The macro %any_path will be replaced with the path of the bookmark mapped to the key pressed in the position of the <any> placeholder. For example this macro can be used to echo the key that was pressed after "c":
map c<any> echo %any
%any is used in the ranger configuration to create a keybinding for adding a bookmark. c<set_bookmark> creates a bookmark for the current directory and the key for the bookmark is the first supplied argument. In this case the key pressed after "m":
map m<any> set_bookmark %any
The %any_path macro can be used to echo the path of the bookmark that is set to the key pressed after "c":
map c<any> echo %any_path
A practical example of the use of %any_path is the pasting of cut/copied files to a bookmarked directory:
map p'<any> paste dest=%any_path
The macro %rangerdir expands to the directory of ranger's python library, you can use it for something like this command: alias show_commands shell less %rangerdir/config/commands.py
%confdir expands to the directory given by --confdir.
%datadir expands to the directory given by --datadir.
The macro %space expands to a space character. You can use it to add spaces to the end of a command when needed, while preventing editors to strip spaces off the end of the line automatically.
To write a literal %, you need to escape it by writing %%.
Note that macros are expanded twice when using chain. For example, to insert a space character in a chained command, you would write %%space: chain command1; command2%%space
BOOKMARKS Type m<key> to bookmark the current directory. You can re-enter this directory by typing `<key>. <key> can be any letter or digit.  Unlike vim, both lowercase and uppercase bookmarks are persistent.
Each time you jump to a bookmark, the special bookmark at key ` will be set to the last directory. So typing "``" gets you back to where you were before.
Bookmarks are selectable when tabbing in the :cd command.
Note: The bookmarks ' (Apostrophe) and ` (Backtick) are the same.
RIFLE Rifle is the file opener of ranger.  It can be used as a standalone program or a python module.  It is located at $repo/ranger/ext/rifle.py. In contrast to other, more simple file openers, rifle can automatically find installed programs so it can be used effectively out of the box on a variety of systems.
It's configured in rifle.conf through a list of conditions and commands. For each line the conditions are checked and if they are met, the respective command is taken into consideration.  By default, simply the first matching rule is used.  In ranger, you can list and choose rules by typing "r" or simply by typing "<rulenumber><enter>".  If you use rifle standalone, you can list all rules with the "-l" option and pick a rule with "-p <number>".
The rules, along with further documentation, are contained in $repo/ranger/config/rifle.conf.
FLAGS Flags give you a way to modify the behavior of the spawned process.  They are used in the commands ":open_with" (key "r") and ":shell" (key "!").
f   Fork the process, i.e. run in background. Please use this flag instead of calling "disown" or "nohup", to avoid killing the background command when pressing Ctrl+C in ranger. c   Run the current file only, instead of the selection r   Run application with root privilege (requires sudo) t   Run application in a new terminal window
There are some additional flags that can currently be used only in the "shell" command: (for example ":shell -w df")
p   Redirect output to the pager s   Silent mode.  Output will be discarded. w   Wait for an Enter-press when the process is done
By default, all the flags are off unless otherwise specified in rc.conf key bindings or rifle.conf rules. You can specify as many flags as you want. An uppercase flag negates the effect: "ffcccFsf" is equivalent to "cs".
The terminal program name for the "t" flag is taken from the environment variable $TERMCMD.  If it doesn't exist, it tries to extract it from $TERM, uses "x-terminal-emulator" as a fallback, and then "xterm" if that fails.
Examples: ":open_with c" will open the file that you currently point at, even if you have selected other files.  ":shell -w df" will run "df" and wait for you to press Enter before switching back to ranger.
PLUGINS ranger's plugin system consists of python files which are located in ~/.config/ranger/plugins/ and are imported in alphabetical order when starting ranger.  A plugin changes rangers behavior by overwriting or extending a function that ranger uses.  This allows you to change pretty much every part of ranger, but there is no guarantee that things will continue to work in future versions as the source code evolves.
Adding new commands via a plugin as simple as specifying them like you would do in the commands.py.
There are some hooks that are specifically made for the use in plugins. They are functions that start with hook_ and can be found throughout the code.
grep 'def hook_' -r /path/to/rangers/source
Also try:
pydoc ranger.api
Note that you should NOT simply overwrite a function unless you know what you're doing.  Instead, save the existing function and call it from your new one.  This way, multiple plugins can use the same hook.  There are several sample plugins in the /usr/share/doc/ranger/examples/ directory, including a hello-world plugin that describes this procedure.
Key bindings are defined in the file %rangerdir/config/rc.conf.  Check this file for a list of all key bindings.  You can copy it to your local configuration directory with the --copy-config=rc option.
Many key bindings take an additional numeric argument.  Type 5j to move down 5 lines, 2l to open a file in mode 2, 10<Space> to mark 10 files.
This list contains the most useful bindings:
MAIN BINDINGS h, j, k, l    Move left, down, up or right
^D or J, ^U or K Move a half page down, up
H, L          Move back and forward in the history
gg            Move to the top
G             Move to the bottom
[, ]          Move up and down in the parent directory.
^R            Reload everything
F             Toggle freeze_files setting.  When active (indicated by a cyan FROZEN message in the status bar), directories and files will not be loaded, improving performance when all the files you need are already loaded.  This does not affect file previews, which can be toggled with zI.  Also try disabling the preview of directories with zP.
^L            Redraw the screen
i             Inspect the current file in a bigger window.
E             Edit the current file in $VISUAL otherwise $EDITOR otherwise "vim"
S             Open a shell in the current directory
?             Opens this man page
W             Opens the log window where you can review messages that pop up at the bottom.
w             Opens the task window where you can view and modify background processes that currently run in ranger.  In there, you can type "dd" to abort a process and "J" or "K" to change the priority of a process.  Only one process is run at a time.
^C            Stop the currently running background process that ranger has started, like copying files, loading directories or file previews.
<octal>=, +<who><what>, -<who><what> Change the permissions of the selection.  For example, "777=" is equivalent to "chmod 777 %s", "+ar" does "chmod a+r %s", "-ow" does "chmod o-w %s" etc.
yy            Copy (yank) the selection, like pressing Ctrl+C in modern GUI programs.  (You can also type "ya" to add files to the copy buffer, "yr" to remove files again, or "yt" for toggling.)
dd            Cut the selection, like pressing Ctrl+X in modern GUI programs.  (There are also "da", "dr" and "dt" shortcuts equivalent to "ya", "yr" and "yt".)
pp            Paste the files which were previously copied or cut, like pressing Ctrl+V in modern GUI programs.
Conflicts will be renamed by appending an '_' (and a counter if necessary), resulting in "file.ext_", "file.ext_0", etc. If you prefer "file_.ext" you can use the "paste_ext" command.
po            Paste the copied/cut files, overwriting existing files.