neulab/tldr huggingface dataset:
The method of checking each of the first three file descriptors in sequence until a terminal is found was adopted from System V.
The file /dev/tty is not specified for the terminal device because it was thought to be too restrictive. Typical environment changes for the n operand are that write permissions are removed for others and group from the appropriate device. It was decided to leave the actual description of what is done as unspecified because of potential differences between implementations.
The format for standard output is unspecified because of differences between historical implementations. This output is generally not useful to shell scripts (they can use the exit status), so exact parsing of the output is unnecessary.
talk, write
The Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment Variables
TEST(1)                           User Commands                          TEST(1)
test - check file types and compare values
test EXPRESSION test [ EXPRESSION ] [ ] [ OPTION
Exit with the status determined by EXPRESSION.
An omitted EXPRESSION defaults to false.  Otherwise, EXPRESSION is true or false and sets exit status.  It is one of:
( EXPRESSION ) EXPRESSION is true
! EXPRESSION EXPRESSION is false
EXPRESSION1 -a EXPRESSION2 both EXPRESSION1 and EXPRESSION2 are true
EXPRESSION1 -o EXPRESSION2 either EXPRESSION1 or EXPRESSION2 is true
-n STRING the length of STRING is nonzero
STRING equivalent to -n STRING
-z STRING the length of STRING is zero
STRING1 = STRING2 the strings are equal
STRING1 != STRING2 the strings are not equal
INTEGER1 -eq INTEGER2 INTEGER1 is equal to INTEGER2
INTEGER1 -ge INTEGER2 INTEGER1 is greater than or equal to INTEGER2
INTEGER1 -gt INTEGER2 INTEGER1 is greater than INTEGER2
INTEGER1 -le INTEGER2 INTEGER1 is less than or equal to INTEGER2
INTEGER1 -lt INTEGER2 INTEGER1 is less than INTEGER2
INTEGER1 -ne INTEGER2 INTEGER1 is not equal to INTEGER2
FILE1 -ef FILE2 FILE1 and FILE2 have the same device and inode numbers
FILE1 -nt FILE2 FILE1 is newer (modification date) than FILE2
FILE1 -ot FILE2 FILE1 is older than FILE2
-b FILE FILE exists and is block special
-c FILE FILE exists and is character special
-d FILE FILE exists and is a directory
-e FILE FILE exists
-f FILE FILE exists and is a regular file
-g FILE FILE exists and is set-group-ID
-G FILE FILE exists and is owned by the effective group ID
-h FILE FILE exists and is a symbolic link (same as -L)
-k FILE FILE exists and has its sticky bit set
-L FILE FILE exists and is a symbolic link (same as -h)
-N FILE FILE exists and has been modified since it was last read
-O FILE FILE exists and is owned by the effective user ID
-p FILE FILE exists and is a named pipe
-r FILE FILE exists and read permission is granted
-s FILE FILE exists and has a size greater than zero
-S FILE FILE exists and is a socket
-t FD  file descriptor FD is opened on a terminal
-u FILE FILE exists and its set-user-ID bit is set
-w FILE FILE exists and write permission is granted
-x FILE FILE exists and execute (or search) permission is granted
Except for -h and -L, all FILE-related tests dereference symbolic links. Beware that parentheses need to be escaped (e.g., by backslashes) for shells.  INTEGER may also be -l STRING, which evaluates to the length of STRING.
NOTE: Binary -a and -o are inherently ambiguous.  Use 'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2' instead.
NOTE: [ honors the --help and --version options, but test does not.  test treats each of those as it treats any other nonempty STRING.
NOTE: your shell may have its own version of test and/or [, which usually supersedes the version described here.  Please refer to your shell's documentation for details about the options it supports.
Written by Kevin Braunsdorf and Matthew Bradburn.
Copyright Â© 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.
Full documentation <https://www.gnu.org/software/coreutils/[> or available locally via: info '(coreutils) test invocation'
AUTHCONFIG(8)                System Manager's Manual               AUTHCONFIG(8)
authconfig, authconfig-tui - an interface for configuring system authentication resources
authconfig [options] {--update|--updateall|--test|--probe|--restorebackup <name>|--savebackup <name>|--restorelastbackup}
authconfig provides a simple method of configuring /etc/sysconfig/network to handle NIS, as well as /etc/passwd and /etc/shadow, the files used for shadow password support.  Basic LDAP, Kerberos 5, and Winbind client configuration is also provided.
If --test action is specified, the authconfig just reads the current settings from the various configuration files and prints their values. If --update action is specified, authconfig must be run by root and configuration changes are saved. Only the files affected by the configuration changes are overwritten.  If --updateall action is specified, authconfig must be run by root and all configuration files are written.  The --probe action instructs authconfig to use DNS and other means to guess at configuration information for the current host, print its guesses if it finds them, to standard output, and exit.
The --restorebackup, --savebackup, and --restorelastbackup actions provide a possibility to save and later restore a backup of configuration files which authconfig modifies. Authconfig also saves an automatic backup of configuration files before every configuration change. This special backup can be restored by the --restorelastbackup action.
If --nostart is specified (which is what the install program does), ypbind or other daemons will not be started or stopped immediately following program execution, but only enabled to start or stop at boot time.
The --enablenis, --enableldap, --enablewinbind, and --enablehesiod options are used to configure user information services in /etc/nsswitch.conf, the --enablecache option is used to configure naming services caching, and the --enableshadow, --enableldapauth, --enablekrb5, and --enablewinbindauth options are used to configure authentication functions via /etc/pam.d/system-auth.  Each --enable has a matching --disable option that disables the service if it is already enabled. The respective services have parameters which configure their server names etc.
The algorithm used for storing new password hashes can be specified by the --passalgo option which takes one of the following possible values as a parameter: descrypt, bigcrypt, md5, sha256, and sha512.
The --enablelocauthorize option allows to bypass checking network authentication services for authorization and the --enablesysnetauth allows authentication of system accounts (with uid < 500) by these services.
When the configuration settings allow use of SSSD for user information services and authentication, SSSD will be automatically used instead of the legacy services and the SSSD configuration will be set up so there is a default domain populated with the settings required to connect the services. The --enablesssd and --enablesssdauth options force adding SSSD to /etc/nsswitch.conf and /etc/pam.d/system-auth, but they do not set up the domain in the SSSD configuration files. The SSSD configuration has to be set up manually. The allowed configuration of services for SSSD are: LDAP for user information (--enableldap) and either LDAP (--enableldapauth), or Kerberos (--enablekrb5) for authentication. Please note that even though these options alone do not trigger any change in SSSD configuration files this may not be true if any of these options is used in conjunction with other options such as --enableldap or --updateall.
In case SSSD does not support some feature of the legacy services that are required for the site configuration, the use of the legacy services can be forced by setting FORCELEGACY=yes in /etc/sysconfig/authconfig.
The list of options mentioned here in the manual page is not exhaustive, please refer to authconfig --help for the complete list of the options.
For namelist you may substitute either a single name or a comma-separated list of names.
The SSSD service is enabled and possibly started by authconfig when at least two of the following three conditions are met: 1) /etc/sssd/sssd.conf file exists (or is configured via the implicit SSSD support) 2) SSSD authentication is enabled (pam_sss.so is used in PAM configuration) 3) SSSD is enabled for user identity (nsswitch.conf contains sss)
When --update action is used the enablement or disablement and possible restart of services happens only in case the changed configuration options affect the service to be restarted. This means that if for example the ypbind service is enabled with authconfig --update --nostart --enablenis but not started and you run the same command without the --nostart later the ypbind service will not be started because no configuration change affecting ypbind happened.
authconfig returns 0 on success, 1 on backup operation errors, 2 if not running with sufficient privileges, 3 if unknown password hash algorithm is specified or incorrect values are set for password strength checking (this error is non fatal), 4 if download of CA certificate fails, 5 if writing configuration files fails on --updateall action, 6 if writing fails on --update action, 7 if Winbind domain join fails.
/etc/sysconfig/authconfig Used to track whether or not particular authentication mechanisms are enabled.  Currently includes variables named USESHADOW, USEMD5, USEKERBEROS, USELDAPAUTH, USEWINBIND, USEWINBINDAUTH, USENIS, USELDAP, and others. /etc/passwd /etc/shadow Used for shadow password support. /etc/yp.conf Configuration file for NIS support. /etc/sysconfig/network Another configuration file for NIS support. /etc/ldap.conf /etc/nss_ldap.conf /etc/pam_ldap.conf /etc/nslcd.conf /etc/openldap/ldap.conf Used to configure nss_ldap, pam_ldap, nslcd, and the OpenLDAP library. Only the files already existing on the system are modified. /etc/krb5.conf Used to configure Kerberos 5. /etc/samba/smb.conf Used to configure winbind authentication. /etc/nsswitch.conf Used to configure user information services. /etc/login.defs Used to configure parameters of user accounts (minimum UID of a regular user, password hashing algorithm). /etc/pam.d/system-auth Common PAM configuration for system services which include it using the include directive. It is created as symlink and not relinked if it points to another file. /etc/pam.d/system-auth-ac Contains the actual PAM configuration for system services and is the default target of the /etc/pam.d/system-auth symlink. If a local configuration of PAM is created (and symlinked from system- auth file) this file can be included there.
authconfig-gtk(8), system-auth-ac(5), passwd(5), shadow(5), pwconv(1), domainname(1), ypbind(8), nsswitch.conf(5), smb.conf(5), sssd(8)
Nalin Dahyabhai <nalin@redhat.com>, Preston Brown <pbrown@redhat.com>, Matt Wilson <msw@redhat.com>, Tomas Mraz <tmraz@redhat.com>
docker-start - Start one or more stopped containers
docker start [OPTIONS] CONTAINER [CONTAINER...]
Alias for docker container start.
-a, --attach[=false]      Attach STDOUT/STDERR and forward signals
--checkpoint=""      Restore from this checkpoint
--checkpoint-dir=""      Use a custom checkpoint storage directory
--detach-keys=""      Override the key sequence for detaching a container
-h, --help[=false]      help for start
-i, --interactive[=false]      Attach container's STDIN
GROUPMOD(1M)                                                        GROUPMOD(1M)
groupmod - グループに変更を加える
groupmod [ -g gid [ -o ] ] [ -n group_name  ] group
groupmodコマンドは、コマンドライン上で指定した変更事項に即して システムのアカウントファイルを改変する。 groupmodコマンドに指定できるオプションは次の通り
-g gid 変更を受けるグループのID番号。 この値は、-oオプションを用いる場合以外は、他と重複してはならない。 また、非負値でなくてはならない。 ディフォルトでは、99より大きく且つ他の全ての既存グループのIDよりも 大きなものの中で最小のものである。 変更前のグループIDを持つ全てのファイルは、手作業で新しいグループIDへと 変更しなくてはならない。
-n group_name グループの名前がgroupからgroup_nameに変更される。
/etc/group - グループの情報 /etc/gshadow - グループの安全な情報
chfn(1), chsh(1), useradd(1M), userdel(1M), usermod(1M), passwd(1), groupadd(1M), groupdel(1M)
古高和禎 <furutaka@Flux.tokai.jaeri.go.jp>
KAK(1)                     BSD General Commands Manual                    KAK(1)
kak — a vim-inspired, selection oriented code editor
kak [-d] [-n] [-ro] [-c session_id | -s session_id] [-ui ui_type] [-e command] [-E command] [+line[:column] | +:] [file ...] kak -f keys [-q] [-i suffix] [file ...] kak -p session_id kak -l kak -clear kak -version kak -help
Kakoune is a code editor heavily inspired by vim(1) and vi(1).  As such, most of its commands are similar to vi(1)'s, sharing its “keystrokes as a text editing language” model.
Kakoune operates in two modes, normal and insertion.  In insertion mode, keys are directly inserted into the current buffer.  In normal mode, keys are used to manipulate the current selection and to enter insertion mode.
Kakoune has a strong focus on interactivity.  Most commands provide immediate and incremental results, while still being competitive in keystroke count with vim.
Kakoune works on selections, which are oriented, inclusive ranges of characters.  Selections have an anchor and a cursor.  Most commands move both of them except when extending selection, where the anchor character stays fixed and the cursor moves around.
-help   Display a help message and quit.
-version Display Kakoune version and quit.
-n      Do not load the system's kakrc.  (often, /usr/share/kak/kakrc)
-l      List existing sessions.
-d      Run as a headless session (requires -s).
-e command Execute command after the client initialization phase.
-E command Execute command after the server initialization phase.
-f keys Enter in ‘filter mode’: select the whole file, then execute keys.
-i suffix Backup the files on which a filter is applied, using the given suffix.
-q      When in ‘filter mode’, don't print any errors
-p session_id Send the commands written on the standard input to session session_id.
-c session_id Connect to the given session session_id.
-s session_id Set the current session name to session_id.
-ui type Select the user interface type, which can be terminal, dummy, or json.
-clear  Remove sessions that were terminated in an incorrect state (e.g. after a crash).
-ro     Begin in readonly mode, all the buffers opened will not be written to disk.
+line[:column] | +: Specify a target line and column for the first file.  When the plus sign is followed by only a colon, then the cursor is sent to the last line of the file.
file ... One or more file(s) to edit.
KAKOUNE_POSIX_SHELL Overrides the POSIX shell used for %sh{...} expansion, which is /bin/sh (sh(1)) if unset.
KAKOUNE_CONFIG_DIR Overrides the location of the directory containing Kakoune user configuration.  If unset, $XDG_CONFIG_HOME/kak is used.
XDG_CONFIG_HOME Path to the user's configuration directory.  If unset, $HOME/.config is used.
XDG_RUNTIME_DIR Path to the user's session's sockets.  If unset, $TMPDIR/kakoune is used.
In the paths documented below, <rtdir> refers to the runtime directory, whose value is determined in relation to the path to kak's binary location: <rtdir> = <path_to_kak_binary>/../share/kak.
If not started with the -n switch, kak will first load <rtdir>/kakrc, which will in turn load the following additional files:
•   If the $KAKOUNE_CONFIG_DIR/autoload directory exists, recursively load every *.kak file in it, and its sub-directories.
•   If it does not exist, fall back to the system-wide autoload directory in <rtdir>/autoload, and recursively load all files in a similar way.
•   <rtdir>/kakrc.local, if it exists; this is a user-defined system-wide configuration.
•   $KAKOUNE_CONFIG_DIR/kakrc, if it exists; this is the user configuration.
Consequently, if the $KAKOUNE_CONFIG_DIR/autoload directory exists, only scripts stored within that directory will be loaded — the built-in *.kak files will not be.
Users who still want the built-in scripts to be loaded along their own can create a symbolic link to <rtdir>/autoload (or to individual scripts in it) in their user-configuration directory:
ln -s <rtdir>/autoload ${XDG_CONFIG_HOME:-$HOME/.config} /kak/autoload
Edit a file: kak /path/to/file
Edit multiple files (multiple buffers will be created): kak ./file1.txt /path/to/file2.c
Prepend a modeline that sets the tabstop to multiple files: kak -f "ggO// kak: tabstop=8<esc>" *.c
For the complete on-line documentation, use the :doc command after starting kak.
The Kakoune wiki: https://github.com/mawww/kakoune/wiki
The main Kakoune web site: https://kakoune.org
vi(1), vim(1), sam(1plan9).
Maxime Coste <frrrwww@gmail.com> and many others.
Lynis(8)               Unix System Administrator's Manual               Lynis(8)
Lynis - System and security auditing tool
lynis [scan mode] [other options]
Lynis is a security auditing tool for Linux, macOS, and other systems based on UNIX. The tool checks the system and the software configuration, to see if there is any room for improvement the security defenses. All details are stored in a log file. Findings and other discovered data is stored in a report file.  This can be used to compare differences between audits. Lynis can run interactively or as a cronjob. Root permissions (e.g. sudo) are not required, however provide more details during the audit.
The following system areas may be checked:
- Boot loader files
- Configuration files
- Software packages
- Directories and files related to logging and auditing
When running Lynis for the first time, run: lynis audit system
audit <type> Perform an audit of the selected type
upload-only Upload the available report data file
See HELPERS section for more commands.
audit system Performs a system audit, which is the most common audit.
audit system remote <host> Provide commands to do a remote scan.
For more scan modes, see the helper utilities.
--auditor <name> Define the name of the auditor/pentester. When a full name is used, add double quotes, like "Your Name".
--cronjob Perform automatic scan with cron safe options (no colors, no questions, no breaks).
--debug Display debug information to screen for troubleshooting purposes.
--developer Display detailed information useful for developers when creating tests.
--forensics Perform the audit on a running or mounted system (see --rootdir)
--help Show available commands and most-used options.
--logfile </path/to/logfile> Defines location and name of log file, instead of default /var/log/lynis.log.
--man  Show the man page. Useful for systems that do not have the man page installed.
--no-colors Disable colored output.
--no-log Redirect all logging information to /dev/null, prevents sensitive information to be written to disk.
--no-plugins Do not run any of the enabled plugins.
--pentest Run a non-privileged scan, usually used for penetration testing. Some of the tests will be skipped if they require root permissions.
--plugin-dir </path/to/plugins> Define location where plugins can be found.
--profile <file> Provide alternative profile to perform the scan.
--quick (-Q) Do a quick scan (default: don't wait for user input).
--quiet (-q) Run quietly and do not show anything to the screen. Will also enable quick mode.
--report-file <file> Provide an alternative name for report file.
--reverse-colors Optimize screen output for light backgrounds.
--tests TEST-IDs Only run the specific test(s). When using multiple tests, add quotes around the line.
--tests-from-category <category> Tests are only performed if they belong to the defined category. Use the command  'show categories' to determine all valid options.
--tests-from-group <group> Similar to --tests-from-category. Only perform tests from a particular group.  Use 'show groups' to determine valid options.
--use-cwd Run from the current working directory.
--upload Upload data to Lynis Enterprise server (profile option: upload=yes).
--verbose Show more details on screen, such as components that could not found. These details are hidden by default.
--wait Wait for user to continue. This adds a break after each section (opposed of --quick).
--warnings-only Run quietly, except show warnings.
Multiple parameters are allowed, though some parameters can only be used together with others. When running Lynis without any parameters, help will be shown and the program will exit.
Lynis has special helpers to do certain tasks. This way the framework of Lynis is used, while at the same time storing most of the functionality in a separated file. This speeds up execution and keeps the code clean.
audit  Run audit on the system or on other targets
configure <parameter> Change or add settings to the config file
generate <parameter> Generate specific details such as host IDs
show <parameter> Show information, such as configuration and paths
update <parameter> Perform activities regarding updating
To use a helper, run 'lynis' followed by the helper name.
Lynis uses exit codes to signal any invoking script. Currently the following codes are used:
0      Program exited normally
1      Fatal error
64     An unknown parameter is used, or incomplete
65     Incorrect data encountered
66     Can't open file or directory
78     Lynis found 1 or more warnings or configurations errors (with error-on-warnings=yes)
Bugs can be reported via GitHub at https://github.com/CISOfy/lynis or via support@cisofy.com
Supporting documentation can be found via https://cisofy.com/support/
Lynis is licensed as GPLv3. The tool was created by Michael Boelen in 2007. Since 2013 its development has been taken over by CISOfy under the management of Michael Boelen. Plugins may have a different license.
Support requests and project related questions can be addressed via e- mail: lynis-dev@cisofy.com.
LATEXMK(1L)                                                          LATEXMK(1L)
latexmk - generate LaTeX document
latexmk [options] [file ...]
Latexmk completely automates the process of compiling a LaTeX document. Essentially, it is like a specialized relative of the general make utility, but one which determines dependencies automatically and has some other very useful features.  In its basic mode of operation latexmk is given the name of the primary source file for a document, and it issues the appropriate sequence of commands to generate a .dvi, .ps, .pdf and/or hardcopy version of the document.
By default latexmk will run the commands necessary to generate a .dvi file.
Latexmk can also be set to run continuously with a suitable previewer. In that case the latex program (or one of its relatives), etc, are rerun whenever one of the source files is modified, and the previewer automatically updates the on-screen view of the compiled document.
Latexmk determines which are the source files by examining the log file. (Optionally, it also examines the list of input and output files generated by the -recorder option of modern versions of latex (and pdflatex, xelatex, lualatex, etc).  See the documentation for the -recorder option of latexmk below.)  When latexmk is run, it examines properties of the source files, and if any have been changed since the last document generation, latexmk will run the various LaTeX processing programs as necessary.  In particular, it will repeat the run of latex (or a related program)) often enough to resolve all cross references; depending on the macro packages used.  With some macro packages and document classes, four, or even more, runs may be needed. If necessary, latexmk will also run bibtex, biber, and/or makeindex.  In addition, latexmk can be configured to generate other necessary files.  For example, from an updated figure file it can automatically generate a file in encapsulated postscript or another suitable format for reading by LaTeX.
Latexmk has two different previewing options.  In the simple -pv option, a dvi, postscript or pdf previewer is automatically run after generating the dvi, postscript or pdf version of the document.  The type of file to view is selected according to configuration settings and command line options.
The second previewing option is the powerful -pvc option (mnemonic: "preview continuously").  In this case, latexmk runs continuously, regularly monitoring all the source files to see if any have changed. Every time a change is detected, latexmk runs all the programs necessary to generate a new version of the document.  A good previewer (like gv) will then automatically update its display.  Thus the user can simply edit a file and, when the changes are written to disk, latexmk completely automates the cycle of updating the .dvi (and possibly the .ps and .pdf) file, and refreshing the previewer's display.  It's not quite WYSIWYG, but usefully close.
For other previewers, the user may have to manually make the previewer update its display, which can be (some versions of xdvi and gsview) as simple as forcing a redraw of its display.
Latexmk has the ability to print a banner in gray diagonally across each page when making the postscript file.  It can also, if needed, call an external program to do other postprocessing on generated dvi and postscript files.  (See the options -dF and -pF, and the documentation for the $dvi_filter and $ps_filter configuration variables.)  These capabilities are leftover from older versions of latexmk.  More flexibility can be obtained in current versions, since the command strings for running latex, pdflatex, etc can now be configured to run multiple commands.  This also extends the possibility of postprocessing generated files to pdf files.  files.
Latexmk is highly configurable, both from the command line and in configuration files, so that it can accommodate a wide variety of user needs and system configurations.  Default values are set according to the operating system, so latexmk often works without special configuration on MS-Windows, cygwin, Linux, OS-X, and other UNIX systems (notably Solaris).
A very annoying complication handled very reliably by latexmk, is that LaTeX is a multiple pass system.  On each run, LaTeX reads in information generated on a previous run, for things like cross referencing and indexing.  In the simplest cases, a second run of LaTeX suffices, and often the log file contains a message about the need for another pass. However, there is a wide variety of add-on macro packages to LaTeX, with a variety of behaviors.  The result is to break simple-minded determinations of how many runs are needed and of which programs.  In its new version, latexmk has a highly general and efficient solution to these issues.  The solution involves retaining between runs information on the source files, and a symptom is that latexmk generates an extra file (with extension .fdb_latexmk, by default) that contains the source file information.
In general the command line to invoke latexmk has the form
latexmk [options] [file]
All options can be introduced by single or double "-" characters, e.g., "latexmk -help" or "latexmk --help".
Note 1: In addition to the options in the list below, latexmk recognizes almost all the options recognized by the latex, pdflatex programs (and their relatives) in their current TeXLive and MiKTeX implementations. Some of the options for these programs also trigger special action or behavior by latexmk, in which case they have specific explanations in this document.  Otherwise, they are just passed through to a called latex or pdflatex program. Run latexmk with the -showextraoptions to get a list of the options that latexmk accepts and that are simply passed through to latex or pdflatex (etc).  See also the explanation of the -showextraoptions option for more information.
Note 2: In this documentation, the program pdflatex is often referred to. Users of programs like lualatex and xelatex should know that from latexmk's point of view, these other programs behave like pdflatex, i.e., they make a pdf file from a tex file, etc.  So whenever pdflatex is mentioned without mention of the other programs, the statements apply equally to lualatex, xelatex, and any other similar programs.  Latexmk can be easily configured to use whichever of these programs is needed. See the documentation for the following options: -pdflatex="COMMAND", -lualatex, and -xelatex, and also see the documentation for the $pdflatex configuration variable.  At present latexmk cannot do automatic detection of which program is to be used.
Definitions of options and arguments
file   One or more files can be specified.  If no files are specified, latexmk will, by default, run on all files in the current working directory with a ".tex" extension.  This behavior can be changed: see the description concerning the @default_files variable in the section "List of configuration variables usable in initialization files".
If a file is specified without an extension, then the ".tex" extension is automatically added, just as LaTeX does.  Thus, if you specify:
latexmk foo
then latexmk will operate on the file "foo.tex".
-auxdir=FOO or -aux-directory=FOO
Sets the directory for auxiliary output files of (pdf)latex (.aux, .log etc).  This achieves its effect by the -aux-directory option of (pdf)latex, which currently is only implemented on the MiKTeX version of (pdf)latex.
See also the -outdir/-output-directory options, and the $aux_dir, $out_dir, and $search_path_separator configuration variables of latexmk.  In particular, see the documentation of $out_dir for some complications on what directory names are suitable.
-bibtex When the source file uses bbl files for bibliography, run bibtex or biber as needed to regenerate the bbl files.
This property can also be configured by setting the $bibtex_use variable to 2 in a configuration file
-bibtex- Never run bibtex or biber.
A common use for this option is when a document comes from an external source, complete with its bbl file(s), and the user does not have the corresponding bib files available.  In this situation use of the -bibtex- option will prevent latexmk from trying to run bibtex or biber, which would result in overwriting of the bbl files.
-bibtex-cond When the source file uses bbl file(s) for the bibliography, run bibtex or biber as needed to regenerate the bbl files, but only if the relevant bib file(s) exist.  Thus when the bib files are not available, bibtex or biber is not run, thereby avoiding overwriting of the bbl file(s).  This is the default setting.
(Note that it is possible for latexmk to decide that the bib file does not exist, even though the bib file does exist and bibtex or biber finds it.  The problem is that the bib file may not be in the current directory but in some search path; the places latexmk and bibtex or biber cause to be searched need not be identical. On modern installations of TeX and related programs this problem should not arise, since latexmk uses the kpsewhich program to do the search, and kpsewhich should use the same search path as bibtex and biber.  If this problem arises, use the -bibtex option when invoking latexmk.)
-bm <message> A banner message to print diagonally across each page when converting the dvi file to postscript.  The message must be a single argument on the command line so be careful with quoting spaces and such.
Note that if the -bm option is specified, the -ps option is assumed.
-bi <intensity> How dark to print the banner message.  A decimal number between 0 and 1.  0 is black and 1 is white.  The default is 0.95, which is OK unless your toner cartridge is getting low.
-bs <scale> A decimal number that specifies how large the banner message will be printed.  Experimentation is necessary to get the right scale for your message, as a rule of thumb the scale should be about equal to 1100 divided by the number of characters in the message. The default is 220.0 which is just right for 5 character messages.
-commands List the commands used by latexmk for processing files, and then exit.
-c     Clean up (remove) all regeneratable files generated by latex and bibtex or biber except dvi, postscript and pdf.  These files are a combination of log files, aux files, latexmk's database file of source file information, and those with extensions specified in the @generated_exts configuration variable.  In addition, files specified by the $clean_ext configuration variable are removed.
This cleanup is instead of a regular make.  See the -gg option if you want to do a cleanup then a make.
If $bibtex_use is set to 0 or 1, bbl files are counted as non- regeneratable.
If $cleanup_includes_cusdep_generated is nonzero, regeneratable files are considered as including those generated by custom dependencies and are also deleted.  Otherwise these files are not deleted.
-C     Clean up (remove) all regeneratable files generated by latex and bibtex or biber.  This is the same as the -c option with the addition of dvi, postscript and pdf files, and those specified in the $clean_full_ext configuration variable.
This cleanup is instead of a regular make.  See the -gg option if you want to do a cleanup than a make.
-CA    (Obsolete).  Now equivalent to the -C option.  See that option for details.
-cd    Change to the directory containing the main source file before processing it.  Then all the generated files (aux, log, dvi, pdf, etc) will be relative to the source file.
This option is particularly useful when latexmk is invoked from a GUI configured to invoke latexmk with a full pathname for the source file.
-cd-   Do NOT change to the directory containing the main source file before processing it.  Then all the generated files (aux, log, dvi, pdf, etc) will be relative to the current directory rather than the source file.
This is the default behavior and corresponds to the behavior of the latex and pdflatex programs.  However, it is not desirable behavior when latexmk is invoked by a GUI configured to invoke latexmk with a full pathname for the source file.  See the -cd option.
-CF    Remove the file containing the database of source file information, before doing the other actions requested.
-d     Set draft mode.  This prints the banner message "DRAFT" across your page when converting the dvi file to postscript.  Size and intensity can be modified with the -bs and -bi options.  The -bm option will override this option as this is really just a short way of specifying:
latexmk -bm DRAFT
Note that if the -d option is specified, the -ps option is assumed.
-deps  Show a list of dependent files after processing.  This is in the form of a dependency list of the form used by the make program, and it is therefore suitable for use in a Makefile.  It gives an overall view of the files without listing intermediate files, as well as latexmk can determine them.
By default the list of dependent files is sent to stdout (i.e., normally to the screen unless you've redirected latexmk's output). But you can set the filename where the list is sent by the -deps- out= option.
See the section "USING latexmk WITH make" for an example of how to use a dependency list with make.
Users familiar with GNU automake and gcc will find that the -deps option is very similar in its purpose and results to the -M option to gcc.  (In fact, latexmk also has options -M, -MF, and -MP options that behave like those of gcc.)
-dependents Equivalent to -deps.
-deps- Do not show a list of dependent files after processing.  (This is the default.)
-dependents- Equivalent to -deps-.
-deps-out=FILENAME Set the filename to which the list of dependent files is written. If the FILENAME argument is omitted or set to "-", then the output is sent to stdout.
Use of this option also turns on the output of the list of dependent files after processing.
-dF    Dvi file filtering.  The argument to this option is a filter which will generate a filtered dvi file with the extension ".dviF".  All extra processing (e.g. conversion to postscript, preview, printing) will then be performed on this filtered dvi file.
Example usage: To use dviselect to select only the even pages of the dvi file:
latexmk -dF "dviselect even" foo.tex
-diagnostics Print detailed diagnostics during a run.  This may help for debugging problems or to understand latexmk's behavior in difficult situations.
-dvi   Generate dvi version of document.
-dvi-  Turn off generation of dvi version of document.  (This may get overridden, if some other file is made (e.g., a .ps file) that is generated from the dvi file, or if no generated file at all is requested.)
-e <code> Execute the specified initialization code before processing.  The code is Perl code of the same form as is used in latexmk's initialization files -- for more details, see the information on the -r option, and the section about "Configuration/initialization (RC) files".  The code is typically a sequence of assignment statements separated by semicolons.
The code is executed when the -e option is encountered during latexmk's parsing of its command line.  See the -r option for a way of executing initialization code from a file.  An error results in latexmk stopping.  Multiple instances of the -r and -e options can be used, and they are executed in the order they appear on the command line.
Some care is needed to deal with proper quoting of special characters in the code on the command line.  For example, suppose you want to set the latex command to use its -shell-escape option, then under UNIX/LINUX you could use the line
latexmk -e '$latex=q/latex %O -shell-escape %S/' file.tex
Note that the single quotes block normal UNIX/LINUX command shells from treating the characters inside the quotes as special.  (In this example, the q/.../ construct is a Perl idiom equivalent to using single quotes.  This avoids the complications of getting a quote character inside an already quoted string in a way that is independent of both the shell and the operating-system.)
The above command line will NOT work under MS-Windows with cmd.exe or command.com or 4nt.exe.  For MS-Windows with these command shells you could use
latexmk -e "$latex=q/latex %O -shell-escape %S/" file.tex
latexmk -e "$latex='latex %O -shell-escape %S'" file.tex
The last two examples will NOT work with UNIX/LINUX command shells.
-f     Force latexmk to continue document processing despite errors. Normally, when latexmk detects that LaTeX or another program has found an error which will not be resolved by further processing, no further processing is carried out.
Note: "Further processing" means the running of other programs or the rerunning of latex (etc) that would be done if no errors had occurred.  If instead, or additionally, you want the latex (etc) program not to pause for user input after an error, you should arrange this by an option that is passed to the program, e.g., by latexmk's option -interaction=nonstopmode.
-f-    Turn off the forced processing-past-errors such as is set by the -f option.  This could be used to override a setting in a configuration file.
-g     Force latexmk to process document fully, even under situations where latexmk would normally decide that no changes in the source files have occurred since the previous run.  This option is useful, for example, if you change some options and wish to reprocess the files.
-g-    Turn off -g.
-gg    "Super go mode" or "clean make": clean out generated files as if -C had been given, and then do a regular make.
-h, -help Print help information.
-jobname=STRING Set the basename of output files(s) to STRING, instead of the default, which is the basename of the specified TeX file.
This is like the same option for current implementations of the latex, pdflatex, etc, and the passing of this option to these programs is part of latexmk's implementation of -jobname.
-l     Run in landscape mode, using the landscape mode for the previewers and the dvi to postscript converters.  This option is not normally needed nowadays, since current previewers normally determine this information automatically.
-l-    Turn off -l.
-latex="COMMAND" This sets the string specifying the command to run latex, and is typically used to add desired options.  Since the string normally contains spaces, it should be quoted, e.g.,
latexmk -latex="latex --shell-escape %O %S"  foo.tex
The specification of the contents of the string are the same as for the $latex configuration variable.  Depending on your operating system and the command-line shell you are using, you may need to change the single quotes to double quotes (or something else).
To set the command for running pdflatex (rather than the command for latex) see the -pdflatex option.
Note that the effect of this option can also be achieved by using the -e option with a suitable line of Perl code to set the $latex variable.  See the explanation of the -e option.
-lualatex Use lualatex.  That is, use lualatex to process the source file(s) to pdf (in place of pdflatex).  This option is exactly equivalent to specifying the following sequence of options:
-pdflatex="lualatex %O %S" -pdf -dvi- -ps-
-M     Show list of dependent files after processing.  This is equivalent to the -deps option.
-MF file If a list of dependents is made, the -MF specifies the file to write it to.
-MP    If a list of dependents is made, includes phony target for each source file.  If you use the dependents list in a Makefile, the dummy rules work around errors make gives if you remove header files without updating the Makefile to match.
-new-viewer When in continuous-preview mode, always start a new viewer to view the generated file.  By default, latexmk will, in continuous- preview mode, test for a previously running previewer for the same file and not start a new one if a previous previewer is running. However, its test sometimes fails (notably if there is an already- running previewer that is viewing a file of the same name as the current file, but in a different directory).  This option turns off the default behavior.
-new-viewer- The inverse of the -new-viewer option.  It puts latexmk in its normal behavior that in preview-continuous mode it checks for an already-running previewer.
-nobibtex Never run bibtex or biber.
A common use for this option is when a document comes from an external source, complete with its bbl file(s), and the user does not have the corresponding bib files available.  In this situation use of the -nobibtex option will prevent latexmk from trying to run bibtex or biber, which would result in overwriting of the bbl files.
-norc  Turn off the automatic reading of initialization (rc) files.
N.B. Normally the initialization files are read and obeyed, and then command line options are obeyed in the order they are encountered.  But -norc is an exception to this rule: it is acted on first, no matter where it occurs on the command line.
-outdir=FOO or -output-directory=FOO
Sets the directory for the output files of (pdf)latex.  This achieves its effect by the -output-directory option of (pdf)latex, which currently (Dec. 2011 and later) is implemented on the common versions of (pdf)latex, i.e., MiKTeX and TeXLive.  It may not be present in other versions.
See also the -auxdir/-aux-directory options, and the $aux_dir, $out_dir, and $search_path_separator configuration variables of latexmk.  In particular, see the documentation of $out_dir for some complications on what directory names are suitable.
-p     Print out the document.  By default the file to be printed is the first in the list postscript, pdf, dvi that is being made.  But you can use the -print=... option to change the type of file to be printed, and you can configure this in a start up file (by setting the $print_type variable).
However, printing is enabled by default only under UNIX/LINUX systems, where the default is to use the lpr command and only on postscript files.  In general, the correct behavior for printing very much depends on your system's software.  In particular, under MS-Windows you must have suitable program(s) available, and you must have configured the print commands used by latexmk.  This can be non-trivial.  See the documentation on the $lpr, $lpr_dvi, and $lpr_pdf configuration variables to see how to set the commands for printing.
This option is incompatible with the -pv and -pvc options, so it turns them off.
-pdf   Generate pdf version of document using pdflatex.  (If you wish to use lualatex or xelatex, you can use whichever of the options -lualatex or -xelatex applies.)  To configure latexmk to have such behavior by default, see the section on "Configuration/initialization (rc) files".
-pdfdvi Generate pdf version of document from the dvi file, by default using dvipdf.
-pdfps Generate pdf version of document from the ps file, by default using ps2pdf.
-pdf-  Turn off generation of pdf version of document.  (This can be used to override a setting in a configuration file.  It may get overridden if some other option requires the generation of a pdf file.)
-pdflatex="COMMAND" This sets the string specifying the command to run pdflatex, and is typically used to add desired options.  Since the string normally contains spaces, it should be quoted, e.g.,
latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" foo.tex
The specification of the contents of the string are the same as for the $pdflatex configuration variable.  Depending on your operating system and the command-line shell you are using, you may need to change the single quotes to double quotes (or something else).
This option can also be used to set a program to be used instead of the standard pdflatex program, e.g.,
latexmk -pdf -pdflatex="lualatex %O %S"  foo.tex
to use lualatex or
latexmk -pdf -pdflatex="xelatex %O %S"  foo.tex
to use xelatex.
To set the command for running latex (rather than the command for pdflatex) see the -latex option.
Note that the effect of this option can also be achieved by using the -e option with a suitable line of Perl code to set the $pdflatex variable. See the explanation of the -e option.
-print=dvi, -print=ps, -print=pdf, -print=auto, Define which kind of file is printed.  This option also ensures that the requisite file is made, and turns on printing.
The (default) case -print=auto determines the kind of print file automatically from the set of files that is being made.  The first in the list postscript, pdf, dvi that is among the files to be made is the one used for print out.
-ps    Generate postscript version of document.
-ps-   Turn off generation of postscript version of document.  This can be used to override a setting in a configuration file.  (It may get overridden by some other option that requires a postscript file, for example a request for printing.)
-pF    Postscript file filtering.  The argument to this option is a filter which will generate a filtered postscript file with the extension ".psF".  All extra processing (e.g. preview, printing) will then be performed on this filtered postscript file.
Example of usage: Use psnup to print two pages on the one page:
latexmk -ps -pF 'psnup -2' foo.tex
latexmk -ps -pF "psnup -2" foo.tex
Whether to use single or double quotes round the "psnup -2" will depend on your command interpreter, as used by the particular version of perl and the operating system on your computer.
-pv    Run file previewer.  If the -view option is used, this will select the kind of file to be previewed (dvi, ps or pdf).  Otherwise the viewer views the "highest" kind of file selected, by the -dvi, -ps, -pdf, -pdfps options, in the order dvi, ps, pdf (low to high).  If no file type has been selected, the dvi previewer will be used.  This option is incompatible with the -p and -pvc options, so it turns them off.
-pv-   Turn off -pv.
-pvc   Run a file previewer and continually update the .dvi, .ps, and/or .pdf files whenever changes are made to source files (see the Description above).  Which of these files is generated and which is viewed is governed by the other options, and is the same as for the -pv option.  The preview-continuous option -pvc can only work with one file.  So in this case you will normally only specify one filename on the command line.  It is also incompatible with the -p and -pv options, so it turns these options off.
The -pvc option also turns off force mode (-f), as is normally best for continuous preview mode.  If you really want force mode, use the options in the order -pvc -f.
With a good previewer the display will be automatically updated. (Under some but not all versions of UNIX/Linux "gv -watch" does this for postscript files; this can be set by a configuration variable.  This would also work for pdf files except for an apparent bug in gv that causes an error when the newly updated pdf file is read.)  Many other previewers will need a manual update.
Important note: the acroread program on MS-Windows locks the pdf file, and prevents new versions being written, so it is a bad idea to use acroread to view pdf files in preview-continuous mode.  It is better to use a different viewer: SumatraPDF and gsview are good possibilities.