neulab/tldr huggingface dataset:
The at_job_id is composed of a limited character set in historical practice, and it is mandated here to invalidate systems that might try using characters that require shell quoting or that could not be easily parsed by shell scripts.
The at utility varies between System V and BSD systems in the way timezones are used. On System V systems, the TZ variable affects the at- job submission times and the times displayed for the user. On BSD systems, TZ is not taken into account. The BSD behavior is easily achieved with the current specification. If the user wishes to have the timezone default to that of the system, they merely need to issue the at command immediately following an unsetting or null assignment to TZ.  For example:
TZ= at noon ...
gives the desired BSD result.
While the yacc-like grammar specified in the OPERANDS section is lexically unambiguous with respect to the digit strings, a lexical analyzer would probably be written to look for and return digit strings in those cases. The parser could then check whether the digit string returned is a valid day_number, year_number, and so on, based on the context.
batch, crontab
TRACEPATH(8)                         iputils                        TRACEPATH(8)
tracepath - traces path to a network host discovering MTU along this path
tracepath [-4] [-6] [-n] [-b] [-l pktlen] [-m max_hops] [-p port] [-V] {destination}
It traces the network path to destination discovering MTU along this path. It uses UDP port port or some random port. It is similar to traceroute. However, it does not require superuser privileges and has no fancy options.
tracepath -6 is a good replacement for traceroute6 and classic example of application of Linux error queues. The situation with IPv4 is worse, because commercial IP routers do not return enough information in ICMP error messages. Probably, it will change, when they are updated. For now it uses Van Jacobson's trick, sweeping a range of UDP ports to maintain trace history.
-n Print primarily IP addresses numerically.
-b Print both: Host names and IP addresses.
-l Sets the initial packet length to pktlen instead of 65535 for IPv4 or 128000 for IPv6.
-m Set maximum hops (or maximum TTLs) to max_hops instead of 30.
-p Sets the initial destination port to use.
-V Print version and exit.
root@mops:~ # tracepath -6 3ffe:2400:0:109::2 1?: [LOCALHOST]                              pmtu 1500 1:  dust.inr.ac.ru                   0.411ms 2:  dust.inr.ac.ru        asymm  1   0.390ms pmtu 1480 2:  3ffe:2400:0:109::2               463.514ms reached Resume: pmtu 1480 hops 2 back 2
The first column shows the TTL of the probe, followed by colon. Usually the value of TTL is obtained from the reply from the network, but sometimes it does not contain the necessary information and we have to guess it. In this case the number is followed by ?.
The second column shows the network hop which replied to the probe. It is either the address of the router or the word [LOCALHOST], if the probe was not sent to the network.
The rest of the line shows miscellaneous information about the path to the corresponding network hop. It contains the value of RTT, and additionally it can show Path MTU when it changes. If the path is asymmetric or the probe finishes before it reaches the prescribed hop, the difference between number of hops in forward and return direction is shown next to the keyword "async". This information is not reliable, e.g. the third line shows asymmetry of 1. This is because the first probe with TTL of 2 was rejected at the first hop due to Path MTU Discovery.
The last line summarizes information about all the paths to the destination. It shows detected Path MTU, amount of hops to the destination and our guess about the number of hops from the destination to us, which can be different when the path is asymmetric.
traceroute(8), traceroute6(8), ping(8).
tracepath was written by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
No security issues.
This lapidary deserves to be elaborated.  tracepath is not a privileged program, unlike traceroute, ping and other beasts of their kind. tracepath may be executed by everyone who has enough access to the network to send UDP datagrams to the desired destination using the given port.
tracepath is part of iputils package.
KDECONNECT-CLI(1)            General Commands Manual           KDECONNECT-CLI(1)
kdeconnect-cli - KDE Connect CLI tool
kdeconnect-cli [Qt-options] [KDE-options] [options]
KDE Connect CLI tool
-l, --list-devices List all devices
--share <path> Share a file to a said device
--pair Request pairing to a said device
--unpair Stop pairing to a said device
--ping Sends a ping to said device
--device <dev> Device ID
KDE Development Platform: 4.13.1 kdeconnect-cli: 1.0
FASTBOOT(1)                     fastboot Manuals                     FASTBOOT(1)
fastboot - Android flashing and booting utility
fastboot [-w] [-u] [-s device] [-p product] [-c cmdline] [-i vendorId] [-b baseAddr] [-n pageSize] [-S size[K|M|G]] command
fastboot is a command line tool for flashing an Android device, boot an Android device to fastboot mode, etc..
-w     Erase userdata and cache (and format if supported by partition type).
-u     Do not erase partition before formatting.
-s device Specify device serial number or path to device port.
-l     With devices command, list device paths.
-p product Specify product name.
-c cmdline Override kernel commandline.
-i vendorId Specify a custom USB vendor ID.
-b|--base baseAddr Specify a custom kernel base address (default: 0x10000000).
--kernel-offset Specify a custom kernel offset (default: 0x00008000).
--ramdisk-offset Specify a custom ramdisk offset (default: 0x01000000).
--tags-offset offset Specify a custom tags offset (default: 0x00000100).
-n|--page-size pageSize Specify the nand page size (default: 2048).
-S size[K|M|G] Automatically sparse files greater than 'size'.  0 to disable.
--slot suffix Specify slot suffix to be used if the device supports slots.  This will be added to all partition names that use slots.  all can be given to refer to all slots.  other can be given to refer to a non-current slot.  If this flag is not used, slotted partitions will default to the current active slot.
-a, --set-active[=] Sets the active slot.  If no suffix is provided, this will default to the value given by --slot.  If slots are not supported, this does nothing.  This will run after all non-reboot commands.
--wipe-and-use-fbe On devices which support it, erase userdata and cache, and enable file-based encryption.
--unbuffered Do not buffer input or output.
--version Display version.
-h|--help show this message.
fastboot update filename Reflash device from update.zip.
fastboot flashall Flash boot, system, vendor, and (if found) recovery.
fastboot flash partition [filename] Write a file to a flash partition.
fastboot flashing lock Locks the device.  Prevents flashing.
fastboot flashing unlock Unlocks the device.  Allows flashing any partition except bootloader-related partitions.
fastboot flashing lock_critical Prevents flashing bootloader-related partitions.
fastboot flashing unlock_critical Enables flashing bootloader-related partitions.
fastboot flashing get_unlock_ability Queries bootloader to see if the device is unlocked.
fastboot erase partition Erase a flash partition.
fastboot format[:[fs type][:[size]] partition Format a flash partition.  Can override the fs type and/or size the bootloader reports.
fastboot getvar variable Display a bootloader variable.
fastboot set_active suffix Sets the active slot.  If slots are not supported, this does nothing.
fastboot boot kernel [ramdisk [second]] Download and boot kernel.
fastboot flash:raw boot kernel [ramdisk [second]] Create bootimage and flash it.
fastboot devices [-l] List all connected devices (with device paths if -l is used).
fastboot continue Continue with autoboot.
fastboot reboot [bootloader] Reboot device [into bootloader].
fastboot reboot-bootloader Reboot device into bootloader.
fastboot help Show this help message.
CSVPY(1)                             csvkit                             CSVPY(1)
csvpy - csvpy Documentation
Loads a CSV file into a agate.csv.Reader object and then drops into a Python shell so the user can inspect the data however they see fit:
usage: csvpy [-h] [-d DELIMITER] [-t] [-q QUOTECHAR] [-u {0,1,2,3}] [-b] [-p ESCAPECHAR] [-z FIELD_SIZE_LIMIT] [-e ENCODING] [-L LOCALE] [-S] [--blanks] [--date-format DATE_FORMAT] [--datetime-format DATETIME_FORMAT] [-H] [-K SKIP_LINES] [-v] [-l] [--zero] [-V] [--dict] [--agate] [FILE]
Load a CSV file into a CSV reader and then drop into a Python shell.
optional arguments: -h, --help            show this help message and exit --dict                Load the CSV file into a DictReader. --agate               Load the CSV file into an agate table.
This tool will automatically use the IPython shell if it is installed, otherwise it will use the running Python shell.
NOTE: Due to platform limitations, csvpy does not accept file input on STDIN.
csvpy examples/dummy.csv Welcome! "examples/dummy.csv" has been loaded in a reader object named "reader". >>> reader.next() [u'a', u'b', u'c']
As a dictionary:
csvpy --dict examples/dummy.csv Welcome! "examples/dummy.csv" has been loaded in a DictReader object named "reader". >>> reader.next() {u'a': u'1', u'c': u'3', u'b': u'2'}
As an agate table:
csvpy --agate examples/dummy.csv Welcome! "examples/dummy.csv" has been loaded in a from_csv object named "reader". >>> reader.print_table() |    a | b | c | | ---- | - | - | | True | 2 | 3 |
FFE(1)                                                                    FFE(1)
ffe - flat file extractor
ffe [options]...
ffe is a program for extracting fields from flat file records and displaying them in different formats. ffe relies on the configuration file to control input file structure and the output format.
ffe accepts the following options:
-c, --configuration=file Read the configuration from file, default is ~/.fferc.
-s, --structure=STRUCTURE Input file is processed using the structure STRUCTURE.
-p, --print=FORMAT Use output format FORMAT for printing. All printing can be suppressed using format no. Original data is printed using format raw.
-o, --output=NAME Write output to NAME instead of standard output.
-f, --field-list=LIST Print only fields and constants specified in comma separated list LIST.
-e, --expression=EXPRESSION Print only those records for which the EXPRESSION evaluates to true.
-a, --and Expressions are combined with logical and, default is logical or.
-X, --casecmp Expressions are evaluated case insensitive.
-v, --invert-match Print only those records which don't match the expression.
-l, --loose An invalid input line does not cause program to abort.
-r, --replace=FIELD=VALUE Replace FIELDs contents with VALUE in output. VALUE can contain same directives as output option data.
-d, --debug All invalid input lines are written to file ffe_error_<pid>.log.
-I, --info Show the structure information in configuration file and exit.
-?, --help List all available options and their meanings and exit.
All remaining arguments are names of input files; if no input files are specified, then the standard input is read.
Expressions (option -e, --expression) Expression can be used to select specific records comparing field values.
If the value starts with string "file:" then the rest of the value is considered as a file name. Every line in the file is used as value in comparison. Record will be selected if one or more values evaluates true.
Expression notation:
field=value A record will be selected if the field field is equal to the value value.
field^value A record will be selected if the field field starts with the value value.
field~value A record will be selected if the field field contains the value value.
field!value A record will be selected if the field field is not equal to the value value.
field?value A record will be selected if the field field matches the regular expression in value.
ffe uses the configuration file for extracting fields from the input file and for formatting the fields for output. Every line or binary block of the input file is considered as a record. Default configuration file is ~/.fferc but another file can be given with '-c' option.
Configuration file for ffe is a text file. The file may contain empty lines. Commands are case-sensitive. Comments  begin  with  the #-character and end at the end of the line. The string and char definitions can be enclosed in double quotation '"' characters. char is a single character. string and char can contain following escape codes: '\a','\b','\t','\n','\v','\f', '\r', '\"' and '\#'. Character '\' can be escaped as '\\'.
Command Substitution allows the output of a command to replace parts of the configuration file. Syntax for command substitution is: `command` The command is executed and the `command` is substituted with the standard output of the command, with any trailing newlines deleted. Command substitutions may not be nested.
Before executing the command ffe sets few environment variables:
FFE_STRUCTURE The name of the structure given using -s,--structure.
FFE_OUIPUT The name of the output file given using -o,--output.
FFE_FORMAT The name of the output format given using -p,--print.
FFE_FIRST_FILE The name of the first input file.
FFE_FILES A list of all input files.
If variable is already set it will not be replaced.
Input file structure Input file structures are specified with keyword structure:
structure name {options...}
Options must be ended with newline, options are:
type fixed|binary|separated [char] [*] Fields in the input are fixed length text fields, fixed length binary fields or text fields separated by char. If * is given, multiple sequential separators are considered as one. Default separator is comma.
quoted [char] Fields may be quoted with char, default quotation mark is double quotation mark '"'.  A quotation mark is assumed to be escaped as \char or doubling the mark as charchar in input. Non escaped quotation marks are not preserved in output.
header first|all|no Controls the occurrence of the header line. Default is no. If set as first or all, the first line of the first input file is considered as header line containing the names of the fields. First means that only the first file has a header, all means that all files have a header, although the names are still taken from the header of the first file. Header line is handled according the record definition, meaning that the name positions, separators etc. are the same as for the fields.
output name All records belonging this structure are printed according output format name. Default is to use output named as 'default'.
record name {options...} Defines one record for a structure. A structure can contain several record types.
Record options: id position string
rid position regexp Identifies a record in the input file. Records are identified by the string or by the regular expression in regexp in input record position position. For fixed length and binary input the position is the byte position of the input record and for separated input the position means the position'th field of the input record. Positions start from one.
Id's are required only if input structure contains several record types with equal lengths or field counts. Non printable characters can be escaped as \xnn where nn is the hexadecimal value of the character.
A record definition can contain several id's, then all id'd must match the input line (id's are combined with logical and).
In a multi-record binary structure every record must have at least one id.
field name|FILLER|* [length]|* [lookup]|* [output] Specifies one field in a text input structure. length is mandatory for fixed length input structure except for the last field. If the last field of a fixed length input structure has a * in place of length then the last field can have arbitrary length.
Length is also used for printing fields in fixed length format using the %D or %D directive. The order of fields in configuration file is essential, it specifies the field order in a record.
If '*' is given instead of the name,  then the 'name' will be the ordinal number of the field, or if the 'header' option has value 'first' or 'all', then the name of the field will taken from the header line (first line of the input).
If lookup is given then the fields contents is used to  make a lookup in lookup table lookup. If length is not needed (separated format) but lookup is needed, use asterisk (*) in place of length definition.
If output is given field is printed using output output. Use asterisk in place of lookup if lookup is not needed.
Naming the field as FILLER causes field not to be printed in output.
field name|FILLER|* [length]|type [lookup]|* [output] Specifies one field in a binary input structure. All other features are same as for the text structure except the type parameter.  type specifies field data type and length and can have the following values:
char Printable character.
short Short integer having current system length and byte order.
int Integer having current system length and byte order.
long Long integer having current system length and byte order.
llong Long long integer having current system length and byte order.
ushort Unsigned short integer having current system length and byte order.
uint Unsigned integer having current system length and byte order.
ulong Unsigned long integer having current system length and byte order.
ullong Unsigned long long integer having current system length and byte order.
int8 8 bit integer.
int16_be Big endian 16 bit integer.
int32_be Big endian 32 bit integer.
int64_be Big endian 64 bit integer.
int16_le Little endian 16 bit integer.
int32_le Little endian 32 bit integer.
int64_le Little endian 64 bit integer.
uint8 Unsigned 8 bit integer.
uint16_be Unsigned big endian 16 bit integer.
uint32_be Unsigned big endian 32 bit integer.
uint64_be Unsigned big endian 64 bit integer.
uint16_le Unsigned little endian 16 bit integer.
uint32_le Unsigned little endian 32 bit integer.
uint64_le Unsigned little endian 64 bit integer.
float Float having current system length and byte order.
float_be Float having current system length and big endian byte order.
float_le Float having current system length and little endian byte order.
double Double having current system length and byte order.
double_be Double having current system length and big endian byte order.
double_le Double having current system length and little endian byte order.
bcd_be_len Bcd number having length len and nybbles in big endian order.
bcd_le_len Bcd number having length len and nybbles in little endian order.
hex_be_len Hexadecimal data in big endian order having length len.
hex_le_len Hexadecimal data in little endian order having length len.
If length is given instead of the type, then the field is assumed to be a printable string having length length. String is printed until length characters are printed or NULL character is found.
Bcd number (bcd_be_len and bcd_le_len) is printed until len bytes are read or a nybble having hexadecimal value f is found. Bcd number having big endian order is printed in order: most significant nybble first and least significant nybble second and bcd number having little endian order is printed in order: least significant nybble first and most significant nybble second. Bytes are always read in big endian order.
Hexadecimal data (hex_be_len and hex_le_len) is printed as hexadecimal values. Big endian data is printed starting from the lower address and little endian data starting from the upper address.
field-count number Same effect as having field * number times. Because length is not specified, this works only with separated structure.
fields-from record Fields for this record are the same as for record record.
output name This record is printed according output format name. Default is to use output format specified in the structure.
level number [element_name|*] [group_name] Level can be used if the contents of a file should be printed as hierarchical multi-level nested form document. Use * instead of the element name if it is not needed. number is the level of the record, starting from number one (highest level), element_name is the name for the record, group_name is used to group records in the same and lower levels. Only number is mandatory parameter.
record-length strict|minimum
strict Input record length and field count must match the record definition in order to get it processed. This is default value.
minimum Input record length and field count can be the same or longer as defined for the record. The rest of the input line is ignored.
Output definitions There can be several output definitions in the configuration file. Format can be selected with '-p' option. Default format is named as 'default'.
output name|default {options...} Defines one output format. Output named as 'default' will be used if none is given for structure or record, or none is given with option '-p'.
There is two predefined output formats no and raw. no suppresses all printing and raw prints the original input data.
Output options Pictures in output definition can contain printf-style %-directives:
%f     Name of the input file.
%s     Name of the current structure.
%r     Name of the current record.
%o     Input record number in current file.
%O     Input record number starting from the first file.
%i     Byte offset of the current record in the current file. Starts from zero.
%I     Byte offset of the current record starting from the first file. Starts from zero.
%n     Field name.
%t     Field contents, without leading and trailing whitespaces.
%d     Field contents. Binary integer is printed as a decimal value. Floating point number is printed in the style [-]ddd.ddd, where the number of digits after the decimal-point character is 6. Bcd number is printed as a decimal number and hexadecimal data as consecutive hexadecimal values.
%D     Field contents, right padded to the field length (requires length definition for the field).
%C     Field contents, right padded to the field length (requires length definition for the field). Output field is cut if input field is longer that field length.
%x     Unsigned hexadecimal value of a binary integer. Other fields are printed using directive %d.
%l     Value from lookup.
%L     Value from lookup, right padded to the field length (requires length definition for the field).
%e     Does not print anything, causes still the "field empty" check to be performed. Can be used when only the names of non-empty fields should be printed.
%p     Fields start position in a record. For fixed structure this is field's byte position in the input line and for separated structure this is the ordinal number of the field. Starts from one.
%h     Hexadecimal dump of a field. Byte values are printed as consecutive xnn values, where the nn is the hexadecimal value of a byte. Data is printed before any endian conversion.
%g     Group name given by the keyword group_name in record definition.
%m     Element name given by the keyword element_name in record definition.
%%     Percent sign.
file_header picture Picture is printed once before file contents.
file_trailer picture Picture is printed once after file contents.
header picture If specified, then the header line describing the field names is printed before records. Every field  name is printed according the picture using the same separator and fields length as defined for the fields. Picture can contain only %n directive.
data picture Field contents is printed according picture.
lookup picture If field is mapped to lookup table, this picture will be used instead of picture from data option. If not given, then picture from data will be used.
separator string All fields are terminated by string, except the last field of the record. Default is not to print separator.
record_header picture picture is printed before the record content. Default is not to print header.
record_trailer picture picture is printed after the record content. Default is newline.
justify left|right|char Fields are left or right justified. char justifies output according the first occurrence of char in the data picture. Default is left.
indent string Record contents is intended by string. Field contents is intended by two times the string. Default is not to indent.
field-list name1,name2,... Only fields or constants named as name1,name2,... are printed, same effect as has '-f' option. Default is to print all the fields. Fields are also printed in the same order as they are listed.
no-data-print yes|no When set as no and field-list is given, suppresses printing of record_header and record_trailer in case where current record contains none of the fields specified in field-list.
field-empty-print yes|no When set as no, nothing is printed for fields which consist entirely of characters from empty-chars. If none of the fields of a record are printed then the printing of record_trailer is also suppressed. Default is yes.
empty-chars string string specifies a set of characters which define an "empty" field. Default is " \f\n\r\t\v" (space, form-feed, newline, carriage return, horizontal tab and vertical tab).
output-file file Output is written to file instead of the default output. If - is given the standard output is used.
group_header string If a record has a level and group name defined, string is printed before the first record in the same group or if the group name has changed in the same level
group_trailer string If a record has a level and group name defined, string is printed after the records in lower levels or if the group name has changed in the same level or if a higher level record is found.
element_header string If record has a level and header name defined, string is printed before the records contents.
element_header string If record has a level and header name defined, string is printed after the records contents.
hex-caps yes|no Print hexadecimal numbers in capital letters. Default is no.
Lookup definitions lookup name {options...} Defines one lookup table.
Lookup options: search exact|longest The search type for lookup table.
default-value value value is printed if the lookup is not successful.
pair key value One key/value pair for the lookup table.
file name [separator] Key/value pairs are read from file name. Every line is considered as a key/value pair separated by separator. Default separator is semicolon.
Constants Additional to input fields constants values can be printed using option -f,--field-list or output option field-list. Constant will be printed using data output option.
Constants are specified as
const name value when the name appears in a field list, value will be printed for every record as the name were one of the input fields.
Input Preprocessor It is possible to define an input preprosessor for ffe. An input preprocessor is simply an executable program which writes the contents of the input file to standard output which will be read by ffe. If the input preprosessor does not write any characters on its standard output, then ffe uses the original file.
To set up an input preprocessor, set the FFEOPEN environment variable to a command line which will invoke your input preprocessor. This command line should include one occurrence of the string %s, which will be replaced by the input filename when the input preprocessor command is invoked.
The input preprocessor is not used if ffe is reading standard input.
Example of fixed length flat file containing fields 'FirstName','LastName' and 'Age':
John     Ripper       23 Scott    Tiger        45 Mary     Moore        41
This file can be printed in XML with the following configuration:
structure personnel { type fixed output XML record person { field FirstName 9 field LastName  13 field Age 2 } }
output XML { file_header "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" data "<%n>%d</%n>\n" record_header "<%r>\n" record_trailer "</%r>\n" indent " " }
More examples in Texinfo manual. If the info and ffe are properly installed, the command
info ffe
should give more information.
Timo Savinen <tjsa@iki.fi >
PDFTK(1)                     General Commands Manual                    PDFTK(1)
pdftk - A handy tool for manipulating PDF
pdftk <input PDF files | - | PROMPT> [ input_pw <input PDF owner passwords | PROMPT> ] [ <operation> <operation arguments> ] [ output <output filename | - | PROMPT> ] [ encrypt_40bit | encrypt_128bit | encrypt_aes128 ] [ allow <permissions> ] [ owner_pw <owner password | PROMPT> ] [ user_pw <user password | PROMPT> ] [ flatten ] [ need_appearances ] [ compress | uncompress ] [ keep_first_id | keep_final_id ] [ drop_xfa ] [ drop_xmp ] [ replacement_font <font name> ] [ verbose ] [ dont_ask | do_ask ] Where: <operation> may be empty, or: [ cat | shuffle | burst | rotate | generate_fdf | fill_form | background | multibackground | stamp | multistamp | dump_data | dump_data_utf8 | dump_data_fields | dump_data_fields_utf8 | dump_data_annots | update_info | update_info_utf8 | attach_files | unpack_files ]
For Complete Help: pdftk --help
If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses.  Pdftk is a simple tool for doing everyday things with PDF documents.  Use it to:
* Merge PDF Documents or Collate PDF Page Scans * Split PDF Pages into a New Document * Rotate PDF Documents or Pages * Decrypt Input as Necessary (Password Required) * Encrypt Output as Desired * Fill PDF Forms with X/FDF Data and/or Flatten Forms * Generate FDF Data Stencils from PDF Forms * Apply a Background Watermark or a Foreground Stamp * Report PDF Metrics, Bookmarks and Metadata * Add/Update PDF Metrics, Bookmarks or Metadata * Attach Files to PDF Pages or the PDF Document * Unpack PDF Attachments * Burst a PDF Document into Single Pages * Uncompress and Re-Compress Page Streams * Repair Corrupted PDF (Where Possible)
--help, -h Show this summary of options.
<input PDF files | - | PROMPT> A list of the input PDF files. If you plan to combine these PDFs (without using handles) then list files in the order you want them combined.  Use - to pass a single PDF into pdftk via stdin.  Input files can be associated with handles, where a handle is one or more upper-case letters:
<input PDF handle>=<input PDF filename>
Handles are often omitted.  They are useful when specifying PDF passwords or page ranges, later.
For example: A=input1.pdf QT=input2.pdf M=input3.pdf
[input_pw <input PDF owner passwords | PROMPT>] Input PDF owner passwords, if necessary, are associated with files by using their handles:
<input PDF handle>=<input PDF file owner password>
If handles are not given, then passwords are associated with input files by order.
Most pdftk features require that encrypted input PDF are accompanied by the ~owner~ password. If the input PDF has no owner password, then the user password must be given, instead.  If the input PDF has no passwords, then no password should be given.
When running in do_ask mode, pdftk will prompt you for a password if the supplied password is incorrect or none was given.
[<operation> <operation arguments>] Available operations are: cat, shuffle, burst, rotate, generate_fdf, fill_form, background, multibackground, stamp, multistamp, dump_data, dump_data_utf8, dump_data_fields, dump_data_fields_utf8, dump_data_annots, update_info, update_info_utf8, attach_files, unpack_files. Some operations takes additional arguments, described below.
If this optional argument is omitted, then pdftk runs in 'filter' mode.  Filter mode takes only one PDF input and creates a new PDF after applying all of the output options, like encryption and compression.
cat [<page ranges>] Assembles (catenates) pages from input PDFs to create a new PDF. Use cat to merge PDF pages or to split PDF pages from documents. You can also use it to rotate PDF pages. Page order in the new PDF is specified by the order of the given page ranges. Page ranges are described like this:
<input PDF handle>[<begin page number>[-<end page number>[<qualifier>]]][<page rotation>]
Where the handle identifies one of the input PDF files, and the beginning and ending page numbers are one-based references to pages in the PDF file.  The qualifier can be even, odd, or ~, and the page rotation can be north, south, east, west, left, right, or down.
If a PDF handle is given but no pages are specified, then the entire PDF is used. If no pages are specified for any of the input PDFs, then the input PDFs' bookmarks are also merged and included in the output.
If the handle is omitted from the page range, then the pages are taken from the first input PDF.
The even qualifier causes pdftk to use only the even-numbered PDF pages, so 1-6even yields pages 2, 4 and 6 in that order. 6-1even yields pages 6, 4 and 2 in that order.
The odd qualifier works similarly to the even.
Pages can be subtracted from a page range using the ~ qualifier followed by a page range. For instance, 1-20~5-6 and 1-20~5~6 are equivalent to 1-4 7-20, and ~5 yields all pages except page 5. Depending on your shell, you may need to quote this argument because of the ~ at the beginning.
The page rotation setting can cause pdftk to rotate pages and documents.  Each option sets the page rotation as follows (in degrees): north: 0, east: 90, south: 180, west: 270, left: -90, right: +90, down: +180. left, right, and down make relative adjustments to a page's rotation.
If no arguments are passed to cat, then pdftk combines all input PDFs in the order they were given to create the output.
NOTES: * <end page number> may be less than <begin page number>. * The keyword end may be used to reference the final page of a document instead of a page number. * Reference a single page by omitting the ending page number. * The handle may be used alone to represent the entire PDF document, e.g., B1-end is the same as B. * You can reference page numbers in reverse order by prefixing them with the letter r. For example, page r1 is the last page of the document, r2 is the next-to-last page of the document, and rend is the first page of the document. You can use this prefix in ranges, too, for example r3-r1 is the last three pages of a PDF.
Page Range Examples without Handles: 1\-endeast – rotate entire document 90 degrees 5 11 20 – take single pages from input PDF 5-25oddwest – take odd pages in range, rotate 90 degrees 6-1 – reverse pages in range from input PDF
Page Range Examples Using Handles: Say A=in1.pdf B=in2.pdf, then: A1-21 – take range from in1.pdf Bend-1odd – take all odd pages from in2.pdf in reverse order A72 – take a single page from in1.pdf A1-21 Beven A72 – assemble pages from both in1.pdf and in2.pdf Awest – rotate entire in1.pdf document 90 degrees B – use all of in2.pdf A2-30evenleft – take the even pages from the range, remove 90 degrees from each page's rotation A A – catenate in1.pdf with in1.pdf Aevenwest Aoddeast – apply rotations to even pages, odd pages from in1.pdf Awest Bwest Bdown – catenate rotated documents
shuffle [<page ranges>] Collates pages from input PDFs to create a new PDF.  Works like the cat operation except that it takes one page at a time from each page range to assemble the output PDF.  If one range runs out of pages, it continues with the remaining ranges.  Ranges can use all of the features described above for cat, like reverse page ranges, multiple ranges from a single PDF, and page rotation.  This feature was designed to help collate PDF pages after scanning paper documents.
burst  Splits a single input PDF document into individual pages. Also creates a report named doc_data.txt which is the same as the output from dump_data.  The output section can contain a printf-styled format string to name these pages.  For example, if you want pages named page_01.pdf, page_02.pdf, etc., pass output page_%02d.pdf to pdftk. If the pattern is omitted, then a default pattern g_%04d.pdf is appended and produces pages named pg_0001.pdf, pg_0002.pdf, etc.  Encryption can be applied to the output by appending output options such as owner_pw, e.g.:
pdftk in.pdf burst owner_pw foopass
rotate [<page ranges>] Takes a single input PDF and rotates just the specified pages. All other pages remain unchanged.  The page order remains unchanged.  Specify the pages to rotate using the same notation as you would with cat, except you omit the pages that you aren't rotating:
[<begin page number>[-<end page number>[<qualifier>]]][<page rotation>]
The qualifier can be even or odd, and the page rotation can be north, south, east, west, left, right, or down.
Each option sets the page rotation as follows (in degrees): north: 0, east: 90, south: 180, west: 270, left: -90, right: +90, down: +180. left, right, and down make relative adjustments to a page's rotation.
The given order of the pages doesn't change the page order in the output.
generate_fdf Reads a single input PDF file and generates an FDF file suitable for fill_form out of it to the given output filename or (if no output is given) to stdout.  Does not create a new PDF.
fill_form <FDF data filename | XFDF data filename | - | PROMPT> Fills the single input PDF's form fields with the data from an FDF file, XFDF file or stdin. Enter the data filename after fill_form, or use - to pass the data via stdin, like so:
pdftk form.pdf fill_form data.fdf output form.filled.pdf
If the input FDF file includes Rich Text formatted data in addition to plain text, then the Rich Text data is packed into the form fields as well as the plain text.  Pdftk also sets a flag that cues Reader/Acrobat to generate new field appearances based on the Rich Text data.  So when the user opens the PDF, the viewer will create the Rich Text appearance on the spot. If the user's PDF viewer does not support Rich Text, then the user will see the plain text data instead.  If you flatten this form before Acrobat has a chance to create (and save) new field appearances, then the plain text field data is what you'll see.
Also see the flatten, need_appearances, and replacement_font options.
background <background PDF filename | - | PROMPT> Applies a PDF watermark to the background of a single input PDF.  Pass the background PDF's filename after background like so:
pdftk in.pdf background back.pdf output out.pdf
Pdftk uses only the first page from the background PDF and applies it to every page of the input PDF.  This page is scaled and rotated as needed to fit the input page.  You can use - to pass a background PDF into pdftk via stdin.
If the input PDF does not have a transparent background (such as a PDF created from page scans) then the resulting background won't be visible – use the stamp operation instead.
multibackground <background PDF filename | - | PROMPT> Same as the background operation, but applies each page of the background PDF to the corresponding page of the input PDF.  If the input PDF has more pages than the stamp PDF, then the final stamp page is repeated across these remaining pages in the input PDF.
stamp <stamp PDF filename | - | PROMPT> This behaves just like the background operation except it overlays the stamp PDF page on top of the input PDF document's pages.  This works best if the stamp PDF page has a transparent background.
multistamp <stamp PDF filename | - | PROMPT> Same as the stamp operation, but applies each page of the background PDF to the corresponding page of the input PDF.  If the input PDF has more pages than the stamp PDF, then the final stamp page is repeated across these remaining pages in the input PDF.
dump_data Reads a single input PDF file and reports its metadata, bookmarks (a/k/a outlines), page metrics (media, rotation and labels), data embedded by STAMPtk (see STAMPtk's embed option) and other data to the given output filename or (if no output is given) to stdout.  Non-ASCII characters are encoded as XML numerical entities.  Does not create a new PDF.
dump_data_utf8 Same as dump_data except that the output is encoded as UTF-8.
dump_data_fields Reads a single input PDF file and reports form field statistics to the given output filename or (if no output is given) to stdout. Non-ASCII characters are encoded as XML numerical entities. Does not create a new PDF.
dump_data_fields_utf8 Same as dump_data_fields except that the output is encoded as UTF-8.
dump_data_annots This operation currently reports only link annotations.  Reads a single input PDF file and reports annotation information to the given output filename or (if no output is given) to stdout. Non-ASCII characters are encoded as XML numerical entities. Does not create a new PDF.
update_info <info data filename | - | PROMPT> Changes the bookmarks, page labels, page sizes, page rotations, and metadata in a single PDF's Info dictionary to match the input data file. The input data file uses the same syntax as the output from dump_data. Non-ASCII characters should be encoded as XML numerical entities.
This operation does not change the metadata stored in the PDF's XMP stream, if it has one. (For this reason you should include a ModDate entry in your updated info with a current date/timestamp, format: D:YYYYMMDDHHmmSS, e.g. D:201307241346 – omitted data after YYYY revert to default values.)
pdftk in.pdf update_info in.info output out.pdf
update_info_utf8 <info data filename | - | PROMPT> Same as update_info except that the input is encoded as UTF-8.
attach_files <attachment filenames | PROMPT> [to_page <page number | PROMPT> | relation <relationship>] Packs arbitrary files into a PDF using PDF's file attachment features. More than one attachment may be listed after attach_files. Attachments are added at the document level unless the optional to_page option is given, in which case the files are attached to the given page number (the first page is 1, the final page is end). Attachments at the document level may be tagged with a relationship among Source, Data, Alternative, Supplement, and Unspecified (default).
pdftk in.pdf attach_files table1.html table2.html to_page 6 output out.pdf
pdftk in.pdf attach_files in.tex relation Source output out.pdf
unpack_files Copies all of the attachments from the input PDF into the current folder or to an output directory given after output. For example:
pdftk report.pdf unpack_files output ~/atts/
or, interactively:
pdftk report.pdf unpack_files output PROMPT
[output <output filename | - | PROMPT>] The output PDF filename may not be set to the name of an input filename. Use - to output to stdout.  When using the dump_data operation, use output to set the name of the output data file. When using the unpack_files operation, use output to set the name of an output directory.  When using the burst operation, you can use output to control the resulting PDF page filenames (described above).
[encrypt_40bit | encrypt_128bit | encrypt_aes128] If an output PDF user or owner password is given, the output PDF encryption algorithm defaults to AES-128. The weaker RC4 40-bit and RC4 128-bit algorithms can be chosen by specifying encrypt_40bit or encrypt_128bit (discouraged).
[allow <permissions>] Permissions are applied to the output PDF only if an encryption strength is specified or an owner or user password is given.  If permissions are not specified, they default to 'none,' which means all of the following features are disabled.
The permissions section may include one or more of the following features:
Printing Top Quality Printing
DegradedPrinting Lower Quality Printing
ModifyContents Also allows Assembly
CopyContents Also allows ScreenReaders
ScreenReaders
ModifyAnnotations Also allows FillIn
FillIn
AllFeatures Allows the user to perform all of the above, and top quality printing.
[owner_pw <owner password | PROMPT>]
[user_pw <user password | PROMPT>] If an encryption strength is given but no passwords are supplied, then the owner and user passwords remain empty, which means that the resulting PDF may be opened and its security parameters altered by anybody.
[compress | uncompress] These are only useful when you want to edit PDF code in a text editor like vim or emacs.  Remove PDF page stream compression by applying the uncompress filter. Use the compress filter to restore compression.
[flatten] Use this option to merge an input PDF's interactive form fields (and their data) with the PDF's pages. Only one input PDF may be given. Sometimes used with the fill_form operation.
[need_appearances] Sets a flag that cues Reader/Acrobat to generate new field appearances based on the form field values.  Use this when filling a form with non-ASCII text to ensure the best presentation in Adobe Reader or Acrobat.  It won't work when combined with the flatten option.
[replacement_font <font name>] Use the specified font to display text in form fields. This option is useful when filling a form with non-ASCII text that is not supported by the fonts included in the input PDF. font name may be either the file name or the family name of a font, but using a file name is more reliable. Currently only TrueType fonts with Unicode text are supported.
[keep_first_id | keep_final_id] When combining pages from multiple PDFs, use one of these options to copy the document ID from either the first or final input document into the new output PDF. Otherwise pdftk creates a new document ID for the output PDF. When no operation is given, pdftk always uses the ID from the (single) input PDF.
[drop_xfa] If your input PDF is a form created using Acrobat 7 or Adobe Designer, then it probably has XFA data.  Filling such a form using pdftk yields a PDF with data that fails to display in Acrobat 7 (and 6?).  The workaround solution is to remove the form's XFA data, either before you fill the form using pdftk or at the time you fill the form. Using this option causes pdftk to omit the XFA data from the output PDF form.
This option is only useful when running pdftk on a single input PDF.  When assembling a PDF from multiple inputs using pdftk, any XFA data in the input is automatically omitted.
[drop_xmp] Many PDFs store document metadata using both an Info dictionary (old school) and an XMP stream (new school).  Pdftk's update_info operation can update the Info dictionary, but not the XMP stream. The proper remedy for this is to include a ModDate entry in your updated info with a current date/timestamp. The date/timestamp format is: D:YYYYMMDDHHmmSS, e.g. D:201307241346 – omitted data after YYYY revert to default values. This newer ModDate should cue PDF viewers that the Info metadata is more current than the XMP data.
Alternatively, you might prefer to remove the XMP stream from the PDF altogether – that's what this option does.  Note that objects inside the PDF might have their own, separate XMP metadata streams, and that drop_xmp does not remove those.  It only removes the PDF's document-level XMP stream.
[verbose] By default, pdftk runs quietly. Append verbose to the end and it will speak up.
[dont_ask | do_ask] Depending on the compile-time settings (see ASK_ABOUT_WARNINGS), pdftk might prompt you for further input when it encounters a problem, such as a bad password. Override this default behavior by adding dont_ask (so pdftk won't ask you what to do) or do_ask (so pdftk will ask you what to do).
When running in dont_ask mode, pdftk will over-write files with its output without notice.
Collate scanned pages pdftk A=even.pdf B=odd.pdf shuffle A B output collated.pdf or if odd.pdf is in reverse order: pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdf
The following examples use actual passwords as command line parameters, which is discouraged (see the SECURITY CONSIDERATIONS section).
Decrypt a PDF pdftk secured.pdf input_pw foopass output unsecured.pdf
Encrypt a PDF using AES-128 (the default), withhold all permissions (the default) pdftk 1.pdf output 1.128.pdf owner_pw foopass
Same as above, except password 'baz' must also be used to open output PDF pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz
Same as above, except printing is allowed (once the PDF is open) pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printing
Apply RCA 40-bit encryption to output, revoking all permissions (the default). Set the owner PW to 'foopass'. pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass
Join two files, one of which requires the password 'foopass'. The output is not encrypted. pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf
Join in1.pdf and in2.pdf into a new PDF, out1.pdf pdftk in1.pdf in2.pdf cat output out1.pdf or (using handles): pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf or (using wildcards): pdftk *.pdf cat output combined.pdf
Remove page 13 from in1.pdf to create out1.pdf pdftk in.pdf cat 1-12 14-end output out1.pdf or: pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf