command
stringlengths
1
42
description
stringlengths
29
182k
name
stringlengths
7
64.9k
synopsis
stringlengths
4
85.3k
options
stringclasses
593 values
examples
stringclasses
455 values
ocspcheck
null
null
null
null
null
mkbom
The mkbom command creates a bill-of-materials (bom(5)). You must specify either a source as a directory, or a text file containing a file listing as outputted by lsbom(8). mkbom will generate bill-of-materials information based on that information. Any existing bomfile will be overwritten by the new bomfile. Options: -h print full usage -s create a simplified bom containing only file paths -i filelist use the information in filelist, one entry per line, to construct the bom file. The format of the file should match lsbom(8) output with no formatting options (the default). If -s is given to mkbom, the input filelist should contain only pathnames, as with lsbom -s. SEE ALSO bom(5), ditto(8), mkbom(8) HISTORY The mkbom command appeared in NeXTSTEP as a tool to create bom files used during installation. Mac OS X September 26, 2006 Mac OS X
mkbom – create a bill-of-materials file
mkbom [-s] directory bom mkbom [-s] -i filelist bom mkbom -h | --help
null
null
ldapurl
ldapurl is a command that allows to either compose or decompose LDAP URIs. When invoked with the -H option, ldapurl extracts the components of the ldapuri option argument, unescaping hex-escaped chars as required. It basically acts as a frontend to the ldap_url_parse(3) call. Otherwise, it builds an LDAP URI based on the components passed with the appropriate options, performing the inverse operation. Option -H is incompatible with options -a, -b, -E, -f, -H, -h, -p, -S, and -s.
ldapurl - LDAP URL formatting tool
ldapurl [-a attrs] [-b_searchbase] [-e [!]ext[=extparam]] [-E [!]ext[=extparam]] [-f_filter] [-H_ldapuri] [-h_ldaphost] [-p_ldapport] [-s {base|one|sub|children}] [-S_scheme]
-a_attrs Set a comma-separated list of attribute selectors. -b_searchbase Set the searchbase. -e [!]ext[=extparam] -E [!]ext[=extparam] Specify general extensions with -e and search extensions with -E. ´!´ indicates criticality. General extensions: [!]assert=<filter> (an RFC 4515 Filter) [!]authzid=<authzid> ("dn:<dn>" or "u:<user>") [!]manageDSAit [!]noop ppolicy [!]postread[=<attrs>] (a comma-separated attribute list) [!]preread[=<attrs>] (a comma-separated attribute list) abandon, cancel (SIGINT sends abandon/cancel; not really controls) Search extensions: [!]domainScope (domain scope) [!]mv=<filter> (matched values filter) [!]pr=<size>[/prompt|noprompt] (paged results/prompt) [!]sss=[-]<attr[:OID]>[/[-]<attr[:OID]>...] (server side sorting) [!]subentries[=true|false] (subentries) [!]sync=ro[/<cookie>] (LDAP Sync refreshOnly) rp[/<cookie>][/<slimit>] (LDAP Sync refreshAndPersist) -f_filter Set the URL filter. No particular check on conformity with RFC 4515 LDAP filters is performed, but the value is hex-escaped as required. -H_ldapuri Specify URI to be exploded. -h_ldaphost Set the host. -p_ldapport Set the TCP port. -S_scheme Set the URL scheme. Defaults for other fields, like ldapport, may depend on the value of scheme. -s {base|one|sub|children} Specify the scope of the search to be one of base, one, sub, or children to specify a base object, one-level, subtree, or children search. The default is sub. Note: children scope requires LDAPv3 subordinate feature extension. OUTPUT FORMAT If the -H option is used, the ldapuri supplied is exploded in its components, which are printed to standard output in an LDIF-like form. Otherwise, the URI built using the values passed with the other options is printed to standard output. EXAMPLE The following command: ldapuri -h ldap.example.com -b dc=example,dc=com -s sub -f "(cn=Some One)" returns ldap://ldap.example.com:389/dc=example,dc=com??sub?(cn=Some%20One) The command: ldapuri -H ldap://ldap.example.com:389/dc=example,dc=com??sub?(cn=Some%20One) returns scheme: ldap host: ldap.example.com port: 389 dn: dc=example,dc=com scope: sub filter: (cn=Some One) DIAGNOSTICS Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error. SEE ALSO ldap(3), ldap_url_parse(3), AUTHOR The OpenLDAP Project <http://www.openldap.org/> ACKNOWLEDGEMENTS OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from University of Michigan LDAP 3.3 Release. OpenLDAP 2.4.28 2011/11/24 LDAPURL(1)
null
json_xs
json_xs converts between some input and output formats (one of them is JSON). The default input format is "json" and the default output format is "json-pretty".
json_xs - JSON::XS commandline utility
json_xs [-v] [-f inputformat] [-t outputformat]
-v Be slightly more verbose. -f fromformat Read a file in the given format from STDIN. "fromformat" can be one of: json - a json text encoded, either utf-8, utf16-be/le, utf32-be/le cbor - CBOR (RFC 7049, CBOR::XS), a kind of binary JSON storable - a Storable frozen value storable-file - a Storable file (Storable has two incompatible formats) bencode - use Convert::Bencode, if available (used by torrent files, among others) clzf - Compress::LZF format (requires that module to be installed) eval - evaluate the given code as (non-utf-8) Perl, basically the reverse of "-t dump" yaml - YAML format (requires that module to be installed) string - do not attempt to decode the file data none - nothing is read, creates an "undef" scalar - mainly useful with "-e" -t toformat Write the file in the given format to STDOUT. "toformat" can be one of: json, json-utf-8 - json, utf-8 encoded json-pretty - as above, but pretty-printed json-utf-16le, json-utf-16be - little endian/big endian utf-16 json-utf-32le, json-utf-32be - little endian/big endian utf-32 cbor - CBOR (RFC 7049, CBOR::XS), a kind of binary JSON cbor-packed - CBOR using extensions to make it smaller storable - a Storable frozen value in network format storable-file - a Storable file in network format (Storable has two incompatible formats) bencode - use Convert::Bencode, if available (used by torrent files, among others) clzf - Compress::LZF format yaml - YAML::XS format dump - Data::Dump dumper - Data::Dumper string - writes the data out as if it were a string none - nothing gets written, mainly useful together with "-e" Note that Data::Dumper doesn't handle self-referential data structures correctly - use "dump" instead. -e code Evaluate perl code after reading the data and before writing it out again - can be used to filter, create or extract data. The data that has been written is in $_, and whatever is in there is written out afterwards.
json_xs -t none <isitreally.json "JSON Lint" - tries to parse the file isitreally.json as JSON - if it is valid JSON, the command outputs nothing, otherwise it will print an error message and exit with non-zero exit status. <src.json json_xs >pretty.json Prettify the JSON file src.json to dst.json. json_xs -f storable-file <file Read the serialised Storable file file and print a human-readable JSON version of it to STDOUT. json_xs -f storable-file -t yaml <file Same as above, but write YAML instead (not using JSON at all :) json_xs -f none -e '$_ = [1, 2, 3]' Dump the perl array as UTF-8 encoded JSON text. <torrentfile json_xs -f bencode -e '$_ = join "\n", map @$_, @{$_->{"announce-list"}}' -t string Print the tracker list inside a torrent file. lwp-request http://cpantesters.perl.org/show/JSON-XS.json | json_xs Fetch the cpan-testers result summary "JSON::XS" and pretty-print it. AUTHOR Copyright (C) 2008 Marc Lehmann <json@schmorp.de> perl v5.34.0 2018-11-15 JSON_XS(1)
pkgbuild
A “component package” contains payload to be installed by the OS X Installer. Although a component package can be installed on its own, it is typically incorporated into a product archive, along with a “distribution” and localized resources, using productbuild(1). To create a product archive for submission to the Mac App Store, do not use pkgbuild. Instead, use productbuild(1) directly. pkgbuild has three different modes, as shown in the SYNOPSIS above: 1. Package a complete destination root. When you use xcodebuild(1) with the install action, the result is a destination root, either under /tmp, or in whatever location you specify with the Xcode DSTROOT setting. Use the --root option to specify that destination root directory to pkgbuild, and the entire contents of the directory tree will be included in the output package. 2. Create a template component property list (analyze mode). You point pkgbuild to a destination root as above, but instead of outputting a package, pkgbuild outputs a component property list (see COMPONENT PROPERTY LIST). By editing this property list and specifying it with --component-plist when you subsequently build the package, you can control bundle-specific Installer behavior. 3. Package one or more individual bundles. If you don't have a destination root, you can use the --component option to specify one or more bundles that should be incorporated into the package. Note that only bundles can be specified with --component. ARGUMENTS AND OPTIONS --root root-path Package the entire contents of the directory tree at root-path, typically a destination root created by xcodebuild(1). --component component-path The bundle at component-path is added to the package. Valid only if you don't use --root. --component-plist plist-path If you specify --root, you can use --component-plist to identity the bundles within that destination root, and control how the OS X Installer handles those bundles. See more at COMPONENT PROPERTY LIST. If you add bundles and need to update your component property list, you can specify the old version with --component-plist when running pkgbuild with --analyze, and the old settings will be propagated to the output for still-extant bundles. --scripts scripts-path Archive the entire contents of scripts-path as the package scripts. If this directory contains scripts named preinstall and/or postinstall, these will be run as the top-level scripts of the package. If you want to run scripts for specific bundles, you must specify those in a component property list; see more at COMPONENT PROPERTY LIST. Any other files under scripts-path will be used only if the top-level or component-specific scripts invoke them. --nopayload Indicates that the package will contain only scripts, with no payload. --identifier pkg-identifier Specify a unique identifier for this package. The OS X Installer recognizes a package as being an upgrade to an already-installed package only if the package identifiers match, so it is advisable to set a meaningful, consistent identifier when you build the package. pkgbuild will infer an identifier when building a package from a single component, but will fail otherwise if the identifier has not been set. --version pkg-version Specify a version for the package. Packages with the same identifier are compared using this version, to determine if the package is an upgrade or downgrade. If you don't specify a version, a default of zero is assumed, but this may prevent proper upgrade/downgrade checking. --install-location install-path Specify the default install location for the contents of the package. For example, if you specify a single application component, you might specify an install-path of /Applications. pkgbuild attempts to infer a sensible install path if this option is not used, but it may not choose correctly. Note that whether or not the default install location is actually used by the OS X Installer depends on the distribution file you deploy with the package. --analyze Instead of creating a package, create a template component property list from the destination root given with --root. See COMPONENT PROPERTY LIST. --prior pkg-path In addition to the options above, you can also set the package identifier, version and install location by pointing to a prior version of the same package. pkgbuild will read the package at pkg-path and use the same package identifier and install location contained therein. The version number in the prior package will be converted to an integer and incremented, and the result used for the new package. Note that pkgbuild makes no attempt to verify that the prior package is in any way equivalent to the one being built, so you must make sure you point it to a logically equivalent package. --filter filter-expression By default, --root will include the entire contents of the given root-path in the package payload, except for any .svn or CVS directories, and any .DS_Store files. You can override these default filters by specifying one or more --filter options. Each filter-expression is an re_format(7) “extended” expression: any path in the root which matches any of the given expressions will be excluded from the package payload. (Note that specifying even one --filter inhibits the default filters, so you must respecify the default filters if you still want them to be used.) --ownership (recommended | preserve | preserve-other) By default, when the payload is archived into the package, the recommended UID and GID will be applied to all files. (Generally, this will be root:wheel, which ensures that files installed in the system domain are root-owned, while files installed in the user home directory will be owned by that user.) If you have special ownership requirements, you should use chmod(1) to adjust the ownership of the source files, and use --ownership preserve so that pkgbuild archives the exact ownership of the on-disk files. Alternatively, if you have just a few files to adjust, --ownership preserve-other will apply the recommended UID and GID to those files that are owned by the user running pkgbuild, but leave other files unchanged. Note that pkgbuild never changes the ownership of the actual on-disk files, only the ownership that is archived into the package. --large-payload By default, packages that are created have a per-file size limit associated with them. This method instructs pkgbuild to construct a package where the included payload format supports large files. A large file is defined as any file that is 8 GiB or larger. Warning: The --large-payload option generates packages that are only compatible with macOS 12.0 and above. Packages using this feature will fail to install or extract on previous releases. Specifying this option requires the user to pass [--min-os-version 12.0] or later to acknowledge this requirement. --compression compression-mode Allows control over the compression used for the package. This option does not affect the compression used for plugins or scripts. Not specifying this option will leave the chosen compression algorithm up to the operating system. Two compression-mode arguments are supported: • legacy forces a 10.5-compatible compression algorithm for the package. • latest enables pkgbuild to automatically select newer, more efficient compression algorithms based on what is provided to [--min-os-version <version>]. --min-os-version os-version Specifying a minimum OS version allows the system to create a package with the latest supported features. Some features can have major benefits such as a better compression ratio. However, specifying a minimum version will make the package require that version when presented to productbuild(1). Some of the options in this tool require this argument to be provided. --sign identity-name Adds a digital signature to the resulting package. See SIGNED PACKAGES --keychain keychain-path Specify a specific keychain to search for the signing identity. See SIGNED PACKAGES --cert certificate-name Specify an intermediate certificate to be embedded in the package. See SIGNED_PACKAGES --timestamp Include a trusted timestamp with the signature. See SIGNED_PACKAGES --timestamp=none Disable trusted timestamp, regardless of identity. See SIGNED_PACKAGES --quiet Inhibits status messages on stdout. Any error messages are still sent to stderr. package-output-path The path to which the package will be written. plist-output-path When --analyze is used, the path to which the template component property list will be written. COMPONENT PROPERTY LIST When you package a destination root, you can use a component property list to specify how bundles in that root should be handled by the OS X Installer. This property list should be an array of dictionaries, where each dictionary specifies a single bundle. The dictionary keys are as follows: Key Description RootRelativeBundlePath Path to bundle relative to the destination root (string) BundleIsRelocatable Install bundle over previous version if moved by user? (bool) BundleIsVersionChecked Don't install bundle if newer version on disk? (bool) BundleHasStrictIdentifier Require identical bundle identifiers at install path? (bool) BundleOverwriteAction How to treat existing on-disk version of bundle (string) BundlePreInstallScriptPath Relative path to bundle-specific preinstall script BundlePostInstallScriptPath Relative path to bundle-specific postinstall script ChildBundles Bundles under this bundle (array of dictionaries) The easiest way to create a component property list is to use the --analyze option and point pkgbuild at your current destination root. The output will be a component property list with default attributes, which you can then edit as needed. You can also specify a previous version of your component property list when using --analyze, which will cause the attributes of previously existing bundles to be propagated forward. BundleOverwriteAction specifies how an existing version of the bundle on disk should be handled if the version in the package is installed. Despite the name, both upgrade and update do no version checking. Conditionally installing based on version is controlled entirely by BundleIsVersionChecked. If you specify upgrade, the bundle in the package atomically replaces any version on disk; this has the effect of deleting old paths that no longer exist in the new version of the bundle. If you specify update, the bundle in the package overwrites the version on disk, and any files not contained in the package will be left intact; this is appropriate when you are delivering an update-only package. Another effect of update is that the package bundle will not be installed at all if there is not already a version on disk; this allows a package to deliver an update for an app that the user might have deleted. BundlePreInstallScriptPath and BundlePostInstallScriptPath are meaningful only if --scripts was used to specify a scripts directory. The paths given by these keys must be relative to the scripts directory. ChildBundles can be used to represent nesting of bundles, but it does not change the meaning of RootRelativeBundlePath within lower-level dictionaries (i.e. it is always relative to the destination root). If you write a component property list manually, you do not need to use ChildBundles at all; you can simply put all bundle dictionaries in the top-level array. SIGNED PACKAGES When creating a package, you can optionally add a digital signature to the package. You will need to have a certificate and corresponding private key -- together called an “identity” -- in one of your accessible keychains. To add a signature, specify the name of the identity using the --sign option. The identity's name is the same as the “Common Name” of the certificate. If you want to search for the identity in a specific keychain, specify the path to the keychain file using the --keychain option. Otherwise, the default keychain search path is used. pkgbuild will embed the signing certificate in the product archive, as well as any intermediate certificates that are found in the keychain. If you need to embed additional certificates to form a chain of trust between the signing certificate and a trusted root certificate on the system, use the --cert option to give the Common Name of the intermediate certificate. Multiple --cert options may be used to embed multiple intermediate certificates. The signature can optionally include a trusted timestamp. This is enabled by default when signing with a Developer ID identity, but it can be enabled explicitly using the --timestamp option. A timestamp server must be contacted to embed a trusted timestamp. If you aren't connected to the Internet, you can use --timestamp=none to disable timestamps, even for a Developer ID identity. Note that if you are going to create a signed product with the resulting package, using productbuild(1), there is no reason to sign the individual package.
pkgbuild – Build a macOS Installer component package from on-disk files
pkgbuild [options] --root root-path [--component-plist plist-path] package-output-path pkgbuild --analyze --root root-path plist-output-path pkgbuild [options] {--component component-path} package-output-path
null
pkgbuild --identifier com.sample.pkg.app --root /tmp/Sample.dst Sample.pkg Build the package Sample.pkg using the entire contents of the destination root /tmp/Sample.dst. pkgbuild --analyze --root /tmp/Sample.dst components.plist Analyze the destination root /tmp/Sample.dst, and write a template component property list to components.plist. pkgbuild --identifier com.sample.pkg.app --root /tmp/Sample.dst --component-plist components-edited.plist Sample.pkg Build the package Sample.pkg using the destination root /tmp/Sample.dst, using the bundle-specific behaviors indicated in components-edited.plist. pkgbuild --identifier com.sample.pkg.app --root /tmp/Sample.dst --sign sample-identity Sample.pkg Build the package Sample.pkg using the destination root /tmp/Sample.dst, and sign the resulting package using the identity sample-identity. You will be prompted to allow pkgbuild to access the keychain item, unless Always Allow was chosen previously. SEE ALSO productbuild(1), xcodebuild(1) macOS July 1, 2021 macOS
yamlpp-events
null
null
null
null
null
cpuwalk.d
This program is for multi-CPU servers, and can help identify if a process is running on multiple CPUs concurrently or not. A duration may be specified in seconds. Since this uses DTrace, only users with root privileges can run this command.
cpuwalk.d - Measure which CPUs a process runs on. Uses DTrace.
cpuwalk.d [duration]
null
this runs until Ctrl-C is hit, # cpuwalk.d run for 5 seconds, # cpuwalk.d 5 FIELDS PID process ID CMD process name value CPU id count number of samples (sample at 100 hz) DOCUMENTATION See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with verbose descriptions explaining the output. EXIT cpuwalk.d will run until Ctrl-C is hit, or the duration specified is reached. SEE ALSO threaded.d(1M), dtrace(1M) version 0.90 September 22, 2005 cpuwalk.d(1m)
cvmkfile
cvmkfile can be used to pre-allocate a file on the Xsan volume. This is useful and preferable when preparing a file for use in a real-time or streaming environment as the entire file is represented in only one file system extent. Additionally, a file can be placed onto a specific storage pool by specifying the key value, which is used as the affinity locator. See snfs_config(5) for more details about affinities. WARNING: This will destroy all existing data for the specified file unless the -e option is used.
cvmkfile - Create a pre-allocated file
cvmkfile [-eprswz] [-k key] size[k|m|g|t] filename
-e The -e option tells cvmkfile not to clobber an existing file, just expand or verify the requested space. The default behavior is to unlink and re-create an existing file (see WARNING above). -k key The -k key optionally tells the file system where to place the data file. If an Affinity Key is specified, the file is placed on storage pools that are specified to support this key. If there is no storage pool with the key specified, then the file is placed in non-exclusive data pools. If there are no non- exclusive data pools, then ENOSPC (no space) is returned. -p The -p option forces the allocation and any subsequent expansions to be fitted "perfectly" as multiples of the PerfectFitSize configuration parameter. The allocation extent will always line up on and be a perfect multiple of the number of blocks specified in PerfectFitSize. -r The -r option causes the file to be written with pseudo-random data. This can take a significant amount of time. -s The -s option forces the allocation to line up on the beginning block modulus of the storage pool. This can help performance in situations where the I/O size perfectly spans the width of the storage pool's disks. -w The -w option sets the file size to be equal to size. Without this option the blocks are allocated but the size is set to zero. NOTE: Unless the -z option is used, the new file will contain undefined data. Using the -w option is not recommended unless absolutely needed, and beware that it could cause some write operations to become read-modify-write operations. -z The -z option causes the file to be physically zeroed out. This can take a significant amount of time. size[k|m|g|t] The size argument specifies the number of bytes, kilobytes(k), megabytes(m), gigabytes(g), terabytes(t) to allocate for the file. Multiple extents will be allocated if there is insufficient contiguous available space to satisfy the requested amount. In the event that there is not enough space to satisfy the request, the file size will still reflect the requested size value if the -w option is specified. filename The file to be created.
Make a file of one gigabyte with zero length. Allocate it on a storage pool that has specified the affinity key 6100_n8. rock # cvmkfile -k 6100_n8 1g foobar SEE ALSO snfs_config(5), cvmkdir(1) Xsan File System December 2019 CVMKFILE(1)
update_dyld_shared_cache
null
null
null
null
null
ldapmodrdn
ldapmodrdn is a shell-accessible interface to the ldap_rename(3) library call. ldapmodrdn opens a connection to an LDAP server, binds, and modifies the RDN of entries. The entry information is read from standard input, from file through the use of the -f option, or from the command-line pair dn and rdn.
ldapmodrdn - LDAP rename entry tool
ldapmodrdn [-r] [-s_newsup] [-n] [-v] [-c] [-M[M]] [-d_debuglevel] [-D_binddn] [-W] [-w_passwd] [-y_passwdfile] [-H_ldapuri] [-h_ldaphost] [-p_ldapport] [-P {2|3}] [-e [!]ext[=extparam]] [-E [!]ext[=extparam]] [-O_security-properties] [-I] [-Q] [-U_authcid] [-R_realm] [-x] [-X_authzid] [-Y_mech] [-Z[Z]] [-f_file] [dn rdn]
-r Remove old RDN values from the entry. Default is to keep old values. -s_newsup Specify a new superior entry. (I.e., move the target entry and make it a child of the new superior.) This option is not supported in LDAPv2. -n Show what would be done, but don't actually change entries. Useful for debugging in conjunction with -v. -v Use verbose mode, with many diagnostics written to standard output. -c Continuous operation mode. Errors are reported, but ldapmodrdn will continue with modifications. The default is to exit after reporting an error. -M[M] Enable manage DSA IT control. -MM makes control critical. -d_debuglevel Set the LDAP debugging level to debuglevel. ldapmodrdn must be compiled with LDAP_DEBUG defined for this option to have any effect. -f_file Read the entry modification information from file instead of from standard input or the command-line. -x Use simple authentication instead of SASL. -D_binddn Use the Distinguished Name binddn to bind to the LDAP directory. For SASL binds, the server is expected to ignore this value. -W Prompt for simple authentication. This is used instead of specifying the password on the command line. -w_passwd Use passwd as the password for simple authentication. -y_passwdfile Use complete contents of passwdfile as the password for simple authentication. -H_ldapuri Specify URI(s) referring to the ldap server(s); only the protocol/host/port fields are allowed; a list of URI, separated by whitespace or commas is expected. -h_ldaphost Specify an alternate host on which the ldap server is running. Deprecated in favor of -H. -p_ldapport Specify an alternate TCP port where the ldap server is listening. Deprecated in favor of -H. -P {2|3} Specify the LDAP protocol version to use. -O_security-properties Specify SASL security properties. -e [!]ext[=extparam] -E [!]ext[=extparam] Specify general extensions with -e and search extensions with -E. ´!´ indicates criticality. General extensions: [!]assert=<filter> (an RFC 4515 Filter) [!]authzid=<authzid> ("dn:<dn>" or "u:<user>") [!]manageDSAit [!]noop ppolicy [!]postread[=<attrs>] (a comma-separated attribute list) [!]preread[=<attrs>] (a comma-separated attribute list) abandon, cancel (SIGINT sends abandon/cancel; not really controls) Search extensions: [!]domainScope (domain scope) [!]mv=<filter> (matched values filter) [!]pr=<size>[/prompt|noprompt] (paged results/prompt) [!]sss=[-]<attr[:OID]>[/[-]<attr[:OID]>...] (server side sorting) [!]subentries[=true|false] (subentries) [!]sync=ro[/<cookie>] (LDAP Sync refreshOnly) rp[/<cookie>][/<slimit>] (LDAP Sync refreshAndPersist) -I Enable SASL Interactive mode. Always prompt. Default is to prompt only as needed. -Q Enable SASL Quiet mode. Never prompt. -U_authcid Specify the authentication ID for SASL bind. The form of the ID depends on the actual SASL mechanism used. -R_realm Specify the realm of authentication ID for SASL bind. The form of the realm depends on the actual SASL mechanism used. -X_authzid Specify the requested authorization ID for SASL bind. authzid must be one of the following formats: dn:<distinguished name> or u:<username> -Y_mech Specify the SASL mechanism to be used for authentication. If it's not specified, the program will choose the best mechanism the server knows. -Z[Z] Issue StartTLS (Transport Layer Security) extended operation. If you use -ZZ, the command will require the operation to be successful. INPUT FORMAT If the command-line arguments dn and rdn are given, rdn will replace the RDN of the entry specified by the DN, dn. Otherwise, the contents of file (or standard input if no -f flag is given) should consist of one or more entries. Distinguished Name (DN) Relative Distinguished Name (RDN) One or more blank lines may be used to separate each DN/RDN pair. EXAMPLE Assuming that the file /tmp/entrymods exists and has the contents: cn=Modify Me,dc=example,dc=com cn=The New Me the command: ldapmodrdn -r -f /tmp/entrymods will change the RDN of the "Modify Me" entry from "Modify Me" to "The New Me" and the old cn, "Modify Me" will be removed. DIAGNOSTICS Exit status is 0 if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error. SEE ALSO ldapadd(1), ldapdelete(1), ldapmodify(1), ldapsearch(1), ldap.conf(5), ldap(3), ldap_rename(3) AUTHOR The OpenLDAP Project <http://www.openldap.org/> ACKNOWLEDGEMENTS OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from University of Michigan LDAP 3.3 Release. OpenLDAP 2.4.28 2011/11/24 LDAPMODRDN(1)
null
systemextensionsctl
The systemextensionsctl program can be used to list and control System Extensions installed on this machine. Darwin February 7, 2019 Darwin
systemextensionsctl – System Extensions control
null
null
null
file
This manual page documents version 5.04 of the file command. file tests each argument in an attempt to classify it. There are three sets of tests, performed in this order: filesystem tests, magic tests, and language tests. The first test that succeeds causes the file type to be printed. The type printed will usually contain one of the words text (the file contains only printing characters and a few common control characters and is probably safe to read on an ASCII terminal), executable (the file contains the result of compiling a program in a form understandable to some UNIX kernel or another), or data meaning anything else (data is usually “binary” or non-printable). Exceptions are well-known file formats (core files, tar archives) that are known to contain binary data. When modifying magic files or the program itself, make sure to preserve these keywords. Users depend on knowing that all the readable files in a directory have the word “text” printed. Don't do as Berkeley did and change “shell commands text” to “shell script”. The filesystem tests are based on examining the return from a stat(2) system call. The program checks to see if the file is empty, or if it's some sort of special file. Any known file types appropriate to the system you are running on (sockets, symbolic links, or named pipes (FIFOs) on those systems that implement them) are intuited if they are defined in the system header file <sys/stat.h>. The magic tests are used to check for files with data in particular fixed formats. The canonical example of this is a binary executable (compiled program) a.out file, whose format is defined in <elf.h>, <a.out.h> and possibly <exec.h> in the standard include directory. These files have a “magic number” stored in a particular place near the beginning of the file that tells the UNIX operating system that the file is a binary executable, and which of several types thereof. The concept of a “magic number” has been applied by extension to data files. Any file with some invariant identifier at a small fixed offset into the file can usually be described in this way. The information identifying these files is read from the compiled magic file /usr/share/file/magic.mgc, or the files in the directory /usr/share/file/magic if the compiled file does not exist. If a file does not match any of the entries in the magic file, it is examined to see if it seems to be a text file. ASCII, ISO-8859-x, non- ISO 8-bit extended-ASCII character sets (such as those used on Macintosh and IBM PC systems), UTF-8-encoded Unicode, UTF-16-encoded Unicode, and EBCDIC character sets can be distinguished by the different ranges and sequences of bytes that constitute printable text in each set. If a file passes any of these tests, its character set is reported. ASCII, ISO-8859-x, UTF-8, and extended-ASCII files are identified as “text” because they will be mostly readable on nearly any terminal; UTF-16 and EBCDIC are only “character data” because, while they contain text, it is text that will require translation before it can be read. In addition, file will attempt to determine other characteristics of text-type files. If the lines of a file are terminated by CR, CRLF, or NEL, instead of the Unix-standard LF, this will be reported. Files that contain embedded escape sequences or overstriking will also be identified. Once file has determined the character set used in a text-type file, it will attempt to determine in what language the file is written. The language tests look for particular strings (cf. <names.h>) that can appear anywhere in the first few blocks of a file. For example, the keyword .br indicates that the file is most likely a troff(1) input file, just as the keyword struct indicates a C program. These tests are less reliable than the previous two groups, so they are performed last. The language test routines also test for some miscellany (such as tar(1) archives, JSON files). Any file that cannot be identified as having been written in any of the character sets listed above is simply said to be “data”.
file – determine file type
file [-bcdDhiIkLnNprsvz] [--exclude-quiet] [--extension] [--mime-encoding] [--mime-type] [-f namefile] [-m magicfiles] [-P name=value] [-M magicfiles] file file -C [-m magicfiles] file [--help]
-b, --brief Do not prepend filenames to output lines (brief mode). -C, --compile Write a magic.mgc output file that contains a pre-parsed version of the magic file or directory. -c, --checking-printout Cause a checking printout of the parsed form of the magic file. This is usually used in conjunction with the -m option to debug a new magic file before installing it. -d Apply the default system tests; this is the default behavior unless -M is specified. -D Print debugging messages. -E On filesystem errors (file not found etc), instead of handling the error as regular output as POSIX mandates and keep going, issue an error message and exit. -e, --exclude testname Exclude the test named in testname from the list of tests made to determine the file type. Valid test names are: apptype EMX application type (only on EMX). ascii Various types of text files (this test will try to guess the text encoding, irrespective of the setting of the ‘encoding’ option). encoding Different text encodings for soft magic tests. tokens Ignored for backwards compatibility. cdf Prints details of Compound Document Files. compress Checks for, and looks inside, compressed files. csv Checks Comma Separated Value files. elf Prints ELF file details, provided soft magic tests are enabled and the elf magic is found. json Examines JSON (RFC-7159) files by parsing them for compliance. soft Consults magic files. tar Examines tar files. --exclude-quiet Like --exclude but ignore tests that file does not know about. This is intended for compatibility with older versions of file. --extension Print a slash-separated list of valid extensions for the file type found. -F, --separator separator Use the specified string as the separator between the filename and the file result returned. Defaults to ‘:’. -f, --files-from namefile Read the names of the files to be examined from namefile (one per line) before the argument list. Either namefile or at least one filename argument must be present; to test the standard input, use ‘-’ as a filename argument. Please note that namefile is unwrapped and the enclosed filenames are processed when this option is encountered and before any further options processing is done. This allows one to process multiple lists of files with different command line arguments on the same file invocation. Thus if you want to set the delimiter, you need to do it before you specify the list of files, like: “-F @ -f namefile”, instead of: “-f namefile -F @”. -h, --no-dereference This option causes symlinks not to be followed (on systems that support symbolic links). -i If the file is a regular file, do not classify its contents. -I, --mime Causes the file command to output mime type strings rather than the more traditional human readable ones. Thus it may say ‘text/plain; charset=us-ascii’ rather than “ASCII text”. --mime-type, --mime-encoding Like -I, but print only the specified element(s). -k, --keep-going Don't stop at the first match, keep going. Subsequent matches will be have the string ‘\012- ’ prepended. (If you want a newline, see the -r option.) The magic pattern with the highest strength (see the -l option) comes first. -l, --list Shows a list of patterns and their strength sorted descending by magic(5) strength which is used for the matching (see also the -k option). -L, --dereference This option causes symlinks to be followed, as the like-named option in ls(1) (on systems that support symbolic links). This is the default behavior. -m, --magic-file magicfiles Specify an alternate list of files and directories containing magic. This can be a single item, or a colon-separated list. If a compiled magic file is found alongside a file or directory, it will be used instead. -M magicfiles Like -m, except that the default rules are not applied unless -d is specified. -n, --no-buffer Force stdout to be flushed after checking each file. This is only useful if checking a list of files. It is intended to be used by programs that want filetype output from a pipe. -p, --preserve-date On systems that support utime(3) or utimes(2), attempt to preserve the access time of files analyzed, to pretend that file never read them. -P, --parameter name=value Set various parameter limits. Name Default Explanation bytes 1048576 max number of bytes to read from file elf_notes 256 max ELF notes processed elf_phnum 2048 max ELF program sections processed elf_shnum 32768 max ELF sections processed encoding 65536 max number of bytes to scan for encoding evaluation indir 50 recursion limit for indirect magic name 60 use count limit for name/use magic regex 8192 length limit for regex searches -r, --raw No operation, included for historical compatibility. -s, --special-files Normally, file only attempts to read and determine the type of argument files which stat(2) reports are ordinary files. This prevents problems, because reading special files may have peculiar consequences. Specifying the -s option causes file to also read argument files which are block or character special files. This is useful for determining the filesystem types of the data in raw disk partitions, which are block special files. This option also causes file to disregard the file size as reported by stat(2) since on some systems it reports a zero size for raw disk partitions. -v, --version Print the version of the program and exit. -z, --uncompress Try to look inside compressed files. -Z, --uncompress-noreport Try to look inside compressed files, but report information about the contents only not the compression. -0, --print0 Output a null character ‘\0’ after the end of the filename. Nice to cut(1) the output. This does not affect the separator, which is still printed. --help Print a help message and exit. FILES /usr/share/file/magic.mgc Default compiled list of magic. /usr/share/file/magic Directory containing default magic files. ENVIRONMENT The environment variable MAGIC can be used to set the default magic file name. file adds “.mgc” to the value of this variable as appropriate. However, file has to exist in order for file.mime to be considered. LEGACY DESCRIPTION In legacy mode, the -D, -I, and -M options do not exist. The -d, -i, and -r options behave differently. The -d option provides debugging information (same as -D in conformance mode). The -i option displays mime type information (same as -I in conformance mode). The -r option will disable the translation of unprintable characters (by default, this translation is already disabled in conformance mode). Furthermore, the -h option becomes the default symlink behavior (don't follow symlinks) unless POSIXLY_CORRECT is set. For more information about legacy mode, see compat(5). SEE ALSO hexdump(1), od(1), strings(1), magic(5), otool(1), compat(5) STANDARDS CONFORMANCE This program conforms to Version 3 of the Single UNIX Specification (“SUSv3”). Its behavior is mostly compatible with the System V program of the same name. This version knows more magic, however, so it will produce different (albeit more accurate) output in many cases. The one significant difference between this version and System V is that this version treats any white space as a delimiter, so that spaces in pattern strings must be escaped. For example, >10 string language impress (imPRESS data) in an existing magic file would have to be changed to >10 string language\ impress (imPRESS data) In addition, in this version, if a pattern string contains a backslash, it must be escaped. For example 0 string \begindata Andrew Toolkit document in an existing magic file would have to be changed to 0 string \\begindata Andrew Toolkit document SunOS releases 3.2 and later from Sun Microsystems include a file command derived from the System V one, but with some extensions. This version differs from Sun's only in minor ways. It includes the extension of the ‘&’ operator, used as, for example, >16 long&0x7fffffff >0 not stripped MAGIC DIRECTORY The magic file entries have been collected from various sources, mainly USENET, and contributed by various authors. Christos Zoulas (address below) will collect additional or corrected magic file entries. A consolidation of magic file entries will be distributed periodically. The order of entries in the magic file is significant. Depending on what system you are using, the order that they are put together may be incorrect. If your old file command uses a magic file, keep the old magic file around for comparison purposes (rename it to /usr/share/file/magic.orig).
$ file file.c file /dev/{wd0a,hda} file.c: C program text file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped /dev/wd0a: block special (0/0) /dev/hda: block special (3/0) $ file -s /dev/wd0{b,d} /dev/wd0b: data /dev/wd0d: x86 boot sector $ file -s /dev/hda{,1,2,3,4,5,6,7,8,9,10} /dev/hda: x86 boot sector /dev/hda1: Linux/i386 ext2 filesystem /dev/hda2: x86 boot sector /dev/hda3: x86 boot sector, extended partition table /dev/hda4: Linux/i386 ext2 filesystem /dev/hda5: Linux/i386 swap file /dev/hda6: Linux/i386 swap file /dev/hda7: Linux/i386 swap file /dev/hda8: Linux/i386 swap file /dev/hda9: empty /dev/hda10: empty $ file -i file.c file /dev/{wd0a,hda} file.c: text/x-c file: application/x-executable /dev/hda: application/x-not-regular-file /dev/wd0a: application/x-not-regular-file HISTORY There has been a file command in every UNIX since at least Research Version 4 (man page dated November, 1973). The System V version introduced one significant major change: the external list of magic types. This slowed the program down slightly but made it a lot more flexible. This program, based on the System V version, was written by Ian Darwin ⟨ian@darwinsys.com⟩ without looking at anybody else's source code. John Gilmore revised the code extensively, making it better than the first version. Geoff Collyer found several inadequacies and provided some magic file entries. Contributions of the ‘&’ operator by Rob McMahon, ⟨cudcv@warwick.ac.uk⟩, 1989. Guy Harris, ⟨guy@netapp.com⟩, made many changes from 1993 to the present. Primary development and maintenance from 1990 to the present by Christos Zoulas ⟨christos@astron.com⟩. Altered by Chris Lowth ⟨chris@lowth.com⟩, 2000: handle the -I option to output mime type strings, using an alternative magic file and internal logic. Altered by Eric Fischer ⟨enf@pobox.com⟩, July, 2000, to identify character codes and attempt to identify the languages of non-ASCII files. Altered by Reuben Thomas ⟨rrt@sc3d.org⟩, 2007-2011, to improve MIME support, merge MIME and non-MIME magic, support directories as well as files of magic, apply many bug fixes, update and fix a lot of magic, improve the build system, improve the documentation, and rewrite the Python bindings in pure Python. The list of contributors to the ‘magic’ directory (magic files) is too long to include here. You know who you are; thank you. Many contributors are listed in the source files. LEGAL NOTICE Copyright (c) Ian F. Darwin, Toronto, Canada, 1986-1999. Covered by the standard Berkeley Software Distribution copyright; see the file COPYING in the source distribution. The files tar.h and is_tar.c were written by John Gilmore from his public-domain tar(1) program, and are not covered by the above license. RETURN CODE file returns 0 on success, and non-zero on error. BUGS Please report bugs and send patches to the bug tracker at https://bugs.astron.com/ or the mailing list at ⟨file@astron.com⟩ (visit https://mailman.astron.com/mailman/listinfo/file first to subscribe). TODO Fix output so that tests for MIME and APPLE flags are not needed all over the place, and actual output is only done in one place. This needs a design. Suggestion: push possible outputs on to a list, then pick the last-pushed (most specific, one hopes) value at the end, or use a default if the list is empty. This should not slow down evaluation. The handling of MAGIC_CONTINUE and printing \012- between entries is clumsy and complicated; refactor and centralize. Some of the encoding logic is hard-coded in encoding.c and can be moved to the magic files if we had a !:charset annotation. Continue to squash all magic bugs. See Debian BTS for a good source. Store arbitrarily long strings, for example for %s patterns, so that they can be printed out. Fixes Debian bug #271672. This can be done by allocating strings in a string pool, storing the string pool at the end of the magic file and converting all the string pointers to relative offsets from the string pool. Add syntax for relative offsets after current level (Debian bug #466037). Make file -ki work, i.e. give multiple MIME types. Add a zip library so we can peek inside Office2007 documents to print more details about their contents. Add an option to print URLs for the sources of the file descriptions. Combine script searches and add a way to map executable names to MIME types (e.g. have a magic value for !:mime which causes the resulting string to be looked up in a table). This would avoid adding the same magic repeatedly for each new hash-bang interpreter. When a file descriptor is available, we can skip and adjust the buffer instead of the hacky buffer management we do now. Fix “name” and “use” to check for consistency at compile time (duplicate “name”, “use” pointing to undefined “name” ). Make “name” / “use” more efficient by keeping a sorted list of names. Special-case ^ to flip endianness in the parser so that it does not have to be escaped, and document it. If the offsets specified internally in the file exceed the buffer size ( HOWMANY variable in file.h), then we don't seek to that offset, but we give up. It would be better if buffer managements was done when the file descriptor is available so we can seek around the file. One must be careful though because this has performance and thus security considerations, because one can slow down things by repeateadly seeking. There is support now for keeping separate buffers and having offsets from the end of the file, but the internal buffer management still needs an overhaul. AVAILABILITY You can obtain the original author's latest version by anonymous FTP on ftp.astron.com in the directory /pub/file/file-X.YZ.tar.gz. macOS 14.5 February 5, 2021 macOS 14.5
db_printlog
The db_printlog utility is a debugging utility that dumps Berkeley DB log files in a human-readable format. The options are as follows: -h Specify a home directory for the database environment; by default, the current working directory is used. -N Do not acquire shared region mutexes while running. Other problems, such as potentially fatal errors in Berkeley DB, will be ignored as well. This option is intended only for debugging errors, and should not be used under any other circumstances. -P Specify an environment password. Although Berkeley DB utilities overwrite password strings as soon as possible, be aware there may be a window of vulnerability on systems where unprivileged users can see command-line arguments or where utilities are not able to overwrite the memory containing the command-line arguments. -r Read the log files in reverse order. -V Write the library version number to the standard output, and exit. For more information on the db_printlog output and using it to debug applications, see Reviewing Berkeley DB log files. The db_printlog utility uses a Berkeley DB environment (as described for the -h option, the environment variable DB_HOME, or because the utility was run in a directory containing a Berkeley DB environment). In order to avoid environment corruption when using a Berkeley DB environment, db_printlog should always be given the chance to detach from the environment and exit gracefully. To cause db_printlog to release all environment resources and exit cleanly, send it an interrupt signal (SIGINT). The db_printlog utility exits 0 on success, and >0 if an error occurs. ENVIRONMENT DB_HOME If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home, as described in DB_ENV->open. SEE ALSO db_archive(1), db_checkpoint(1), db_deadlock(1), db_dump(1), db_load(1), db_recover(1), db_stat(1), db_upgrade(1), db_verify(1) Darwin December 3, 2003 Darwin
db_printlog
db_printlog [-NrV] [-h home] [-P password]
null
null
sourcekit-lsp
null
null
null
null
null
debinhex5.30.pl
null
null
null
null
null
podchecker5.34
podchecker will read the given input files looking for POD syntax errors in the POD documentation and will print any errors it find to STDERR. At the end, it will print a status message indicating the number of errors found. Directories are ignored, an appropriate warning message is printed. podchecker invokes the podchecker() function exported by Pod::Checker Please see "podchecker()" in Pod::Checker for more details. RETURN VALUE podchecker returns a 0 (zero) exit status if all specified POD files are ok. ERRORS podchecker returns the exit status 1 if at least one of the given POD files has syntax errors. The status 2 indicates that at least one of the specified files does not contain any POD commands. Status 1 overrides status 2. If you want unambiguous results, call podchecker with one single argument only. SEE ALSO Pod::Simple and Pod::Checker AUTHORS Please report bugs using <http://rt.cpan.org>. Brad Appleton <bradapp@enteract.com>, Marek Rouchal <marekr@cpan.org> Based on code for Pod::Text::pod2text(1) written by Tom Christiansen <tchrist@mox.perl.com> perl v5.34.1 2024-04-13 PODCHECKER(1)
podchecker - check the syntax of POD format documentation files
podchecker [-help] [-man] [-(no)warnings] [file ...] OPTIONS AND ARGUMENTS -help Print a brief help message and exit. -man Print the manual page and exit. -warnings -nowarnings Turn on/off printing of warnings. Repeating -warnings increases the warning level, i.e. more warnings are printed. Currently increasing to level two causes flagging of unescaped "<,>" characters. file The pathname of a POD file to syntax-check (defaults to standard input).
null
null
hash
Shell builtin commands are commands that can be executed within the running shell's process. Note that, in the case of csh(1) builtin commands, the command is executed in a subshell if it occurs as any component of a pipeline except the last. If a command specified to the shell contains a slash ‘/’, the shell will not execute a builtin command, even if the last component of the specified command matches the name of a builtin command. Thus, while specifying “echo” causes a builtin command to be executed under shells that support the echo builtin command, specifying “/bin/echo” or “./echo” does not. While some builtin commands may exist in more than one shell, their operation may be different under each shell which supports them. Below is a table which lists shell builtin commands, the standard shells that support them and whether they exist as standalone utilities. Only builtin commands for the csh(1) and sh(1) shells are listed here. Consult a shell's manual page for details on the operation of its builtin commands. Beware that the sh(1) manual page, at least, calls some of these commands “built-in commands” and some of them “reserved words”. Users of other shells may need to consult an info(1) page or other sources of documentation. Commands marked “No**” under External do exist externally, but are implemented as scripts using a builtin command of the same name. Command External csh(1) sh(1) ! No No Yes % No Yes No . No No Yes : No Yes Yes @ No Yes Yes [ Yes No Yes { No No Yes } No No Yes alias No** Yes Yes alloc No Yes No bg No** Yes Yes bind No No Yes bindkey No Yes No break No Yes Yes breaksw No Yes No builtin No No Yes builtins No Yes No case No Yes Yes cd No** Yes Yes chdir No Yes Yes command No** No Yes complete No Yes No continue No Yes Yes default No Yes No dirs No Yes No do No No Yes done No No Yes echo Yes Yes Yes echotc No Yes No elif No No Yes else No Yes Yes end No Yes No endif No Yes No endsw No Yes No esac No No Yes eval No Yes Yes exec No Yes Yes exit No Yes Yes export No No Yes false Yes No Yes fc No** No Yes fg No** Yes Yes filetest No Yes No fi No No Yes for No No Yes foreach No Yes No getopts No** No Yes glob No Yes No goto No Yes No hash No** No Yes hashstat No Yes No history No Yes No hup No Yes No if No Yes Yes jobid No No Yes jobs No** Yes Yes kill Yes Yes Yes limit No Yes No local No No Yes log No Yes No login Yes Yes No logout No Yes No ls-F No Yes No nice Yes Yes No nohup Yes Yes No notify No Yes No onintr No Yes No popd No Yes No printenv Yes Yes No printf Yes No Yes pushd No Yes No pwd Yes No Yes read No** No Yes readonly No No Yes rehash No Yes No repeat No Yes No return No No Yes sched No Yes No set No Yes Yes setenv No Yes No settc No Yes No setty No Yes No setvar No No Yes shift No Yes Yes source No Yes No stop No Yes No suspend No Yes No switch No Yes No telltc No Yes No test Yes No Yes then No No Yes time Yes Yes No times No No Yes trap No No Yes true Yes No Yes type No** No Yes ulimit No** No Yes umask No** Yes Yes unalias No** Yes Yes uncomplete No Yes No unhash No Yes No unlimit No Yes No unset No Yes Yes unsetenv No Yes No until No No Yes wait No** Yes Yes where No Yes No which Yes Yes No while No Yes Yes SEE ALSO csh(1), dash(1), echo(1), false(1), info(1), kill(1), login(1), nice(1), nohup(1), printenv(1), printf(1), pwd(1), sh(1), test(1), time(1), true(1), which(1), zsh(1) HISTORY The builtin manual page first appeared in FreeBSD 3.4. AUTHORS This manual page was written by Sheldon Hearn <sheldonh@FreeBSD.org>. macOS 14.5 December 21, 2010 macOS 14.5
builtin, !, %, ., :, @, [, {, }, alias, alloc, bg, bind, bindkey, break, breaksw, builtins, case, cd, chdir, command, complete, continue, default, dirs, do, done, echo, echotc, elif, else, end, endif, endsw, esac, eval, exec, exit, export, false, fc, fg, filetest, fi, for, foreach, getopts, glob, goto, hash, hashstat, history, hup, if, jobid, jobs, kill, limit, local, log, login, logout, ls-F, nice, nohup, notify, onintr, popd, printenv, printf, pushd, pwd, read, readonly, rehash, repeat, return, sched, set, setenv, settc, setty, setvar, shift, source, stop, suspend, switch, telltc, test, then, time, times, trap, true, type, ulimit, umask, unalias, uncomplete, unhash, unlimit, unset, unsetenv, until, wait, where, which, while – shell built-in commands
See the built-in command description in the appropriate shell manual page.
null
null
bc
bc(1) is an interactive processor for a language first standardized in 1991 by POSIX. (See the STANDARDS section.) The language provides unlimited precision decimal arithmetic and is somewhat C-like, but there are differences. Such differences will be noted in this document. After parsing and handling options, this bc(1) reads any files given on the command line and executes them before reading from stdin. This bc(1) is a drop-in replacement for any bc(1), including (and especially) the GNU bc(1). It also has many extensions and extra features beyond other implementations. Note: If running this bc(1) on any script meant for another bc(1) gives a parse error, it is probably because a word this bc(1) reserves as a keyword is used as the name of a function, variable, or array. To fix that, use the command-line option -r keyword, where keyword is the keyword that is used as a name in the script. For more information, see the OPTIONS section. If parsing scripts meant for other bc(1) implementations still does not work, that is a bug and should be reported. See the BUGS section.
bc - arbitrary-precision decimal arithmetic language and calculator
bc [-cCghilPqRsvVw] [--digit-clamp] [--no-digit-clamp] [--global- stacks] [--help] [--interactive] [--mathlib] [--no-prompt] [--no-read- prompt] [--quiet] [--standard] [--warn] [--version] [-e expr] [--expression=expr...] [-f file...] [--file=file...] [file...] [-I ibase] [--ibase=ibase] [-O obase] [--obase=obase] [-S scale] [--scale=scale] [-E seed] [--seed=seed]
The following are the options that bc(1) accepts. -C, --no-digit-clamp Disables clamping of digits greater than or equal to the current ibase when parsing numbers. This means that the value added to a number from a digit is always that digit’s value multiplied by the value of ibase raised to the power of the digit’s position, which starts from 0 at the least significant digit. If this and/or the -c or --digit-clamp options are given multiple times, the last one given is used. This option overrides the BC_DIGIT_CLAMP environment variable (see the ENVIRONMENT VARIABLES section) and the default, which can be queried with the -h or --help options. This is a non-portable extension. -c, --digit-clamp Enables clamping of digits greater than or equal to the current ibase when parsing numbers. This means that digits that the value added to a number from a digit that is greater than or equal to the ibase is the value of ibase minus 1 all multiplied by the value of ibase raised to the power of the digit’s position, which starts from 0 at the least significant digit. If this and/or the -C or --no-digit-clamp options are given multiple times, the last one given is used. This option overrides the BC_DIGIT_CLAMP environment variable (see the ENVIRONMENT VARIABLES section) and the default, which can be queried with the -h or --help options. This is a non-portable extension. -E seed, --seed=seed Sets the builtin variable seed to the value seed assuming that seed is in base 10. It is a fatal error if seed is not a valid number. If multiple instances of this option are given, the last is used. This is a non-portable extension. -e expr, --expression=expr Evaluates expr. If multiple expressions are given, they are evaluated in order. If files are given as well (see the -f and --file options), the expressions and files are evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. If this option is given on the command-line (i.e., not in BC_ENV_ARGS, see the ENVIRONMENT VARIABLES section), then after processing all expressions and files, bc(1) will exit, unless - (stdin) was given as an argument at least once to -f or --file, whether on the command-line or in BC_ENV_ARGS. However, if any other -e, --expression, -f, or --file arguments are given after -f- or equivalent is given, bc(1) will give a fatal error and exit. This is a non-portable extension. -f file, --file=file Reads in file and evaluates it, line by line, as though it were read through stdin. If expressions are also given (see the -e and --expression options), the expressions are evaluated in the order given. If this option is given on the command-line (i.e., not in BC_ENV_ARGS, see the ENVIRONMENT VARIABLES section), then after processing all expressions and files, bc(1) will exit, unless - (stdin) was given as an argument at least once to -f or --file. However, if any other -e, --expression, -f, or --file arguments are given after -f- or equivalent is given, bc(1) will give a fatal error and exit. This is a non-portable extension. -g, --global-stacks Turns the globals ibase, obase, scale, and seed into stacks. This has the effect that a copy of the current value of all four are pushed onto a stack for every function call, as well as popped when every function returns. This means that functions can assign to any and all of those globals without worrying that the change will affect other functions. Thus, a hypothetical function named output(x,b) that simply printed x in base b could be written like this: define void output(x, b) { obase=b x } instead of like this: define void output(x, b) { auto c c=obase obase=b x obase=c } This makes writing functions much easier. (Note: the function output(x,b) exists in the extended math library. See the LIBRARY section.) However, since using this flag means that functions cannot set ibase, obase, scale, or seed globally, functions that are made to do so cannot work anymore. There are two possible use cases for that, and each has a solution. First, if a function is called on startup to turn bc(1) into a number converter, it is possible to replace that capability with various shell aliases. Examples: alias d2o="bc -e ibase=A -e obase=8" alias h2b="bc -e ibase=G -e obase=2" Second, if the purpose of a function is to set ibase, obase, scale, or seed globally for any other purpose, it could be split into one to four functions (based on how many globals it sets) and each of those functions could return the desired value for a global. For functions that set seed, the value assigned to seed is not propagated to parent functions. This means that the sequence of pseudo-random numbers that they see will not be the same sequence of pseudo-random numbers that any parent sees. This is only the case once seed has been set. If a function desires to not affect the sequence of pseudo- random numbers of its parents, but wants to use the same seed, it can use the following line: seed = seed If the behavior of this option is desired for every run of bc(1), then users could make sure to define BC_ENV_ARGS and include this option (see the ENVIRONMENT VARIABLES section for more details). If -s, -w, or any equivalents are used, this option is ignored. This is a non-portable extension. -h, --help Prints a usage message and exits. -I ibase, --ibase=ibase Sets the builtin variable ibase to the value ibase assuming that ibase is in base 10. It is a fatal error if ibase is not a valid number. If multiple instances of this option are given, the last is used. This is a non-portable extension. -i, --interactive Forces interactive mode. (See the INTERACTIVE MODE section.) This is a non-portable extension. -L, --no-line-length Disables line length checking and prints numbers without backslashes and newlines. In other words, this option sets BC_LINE_LENGTH to 0 (see the ENVIRONMENT VARIABLES section). This is a non-portable extension. -l, --mathlib Sets scale (see the SYNTAX section) to 20 and loads the included math library and the extended math library before running any code, including any expressions or files specified on the command line. To learn what is in the libraries, see the LIBRARY section. -O obase, --obase=obase Sets the builtin variable obase to the value obase assuming that obase is in base 10. It is a fatal error if obase is not a valid number. If multiple instances of this option are given, the last is used. This is a non-portable extension. -P, --no-prompt Disables the prompt in TTY mode. (The prompt is only enabled in TTY mode. See the TTY MODE section.) This is mostly for those users that do not want a prompt or are not used to having them in bc(1). Most of those users would want to put this option in BC_ENV_ARGS (see the ENVIRONMENT VARIABLES section). These options override the BC_PROMPT and BC_TTY_MODE environment variables (see the ENVIRONMENT VARIABLES section). This is a non-portable extension. -q, --quiet This option is for compatibility with the GNU bc(1) (https://www.gnu.org/software/bc/); it is a no-op. Without this option, GNU bc(1) prints a copyright header. This bc(1) only prints the copyright header if one or more of the -v, -V, or --version options are given unless the BC_BANNER environment variable is set and contains a non-zero integer or if this bc(1) was built with the header displayed by default. If any of that is the case, then this option does prevent bc(1) from printing the header. This is a non-portable extension. -R, --no-read-prompt Disables the read prompt in TTY mode. (The read prompt is only enabled in TTY mode. See the TTY MODE section.) This is mostly for those users that do not want a read prompt or are not used to having them in bc(1). Most of those users would want to put this option in BC_ENV_ARGS (see the ENVIRONMENT VARIABLES section). This option is also useful in hash bang lines of bc(1) scripts that prompt for user input. This option does not disable the regular prompt because the read prompt is only used when the read() built-in function is called. These options do override the BC_PROMPT and BC_TTY_MODE environment variables (see the ENVIRONMENT VARIABLES section), but only for the read prompt. This is a non-portable extension. -r keyword, --redefine=keyword Redefines keyword in order to allow it to be used as a function, variable, or array name. This is useful when this bc(1) gives parse errors when parsing scripts meant for other bc(1) implementations. The keywords this bc(1) allows to be redefined are: • abs • asciify • continue • divmod • else • halt • irand • last • limits • maxibase • maxobase • maxrand • maxscale • modexp • print • rand • read • seed • stream If any of those keywords are used as a function, variable, or array name in a script, use this option with the keyword as the argument. If multiple are used, use this option for all of them; it can be used multiple times. Keywords are not redefined when parsing the builtin math library (see the LIBRARY section). It is a fatal error to redefine keywords mandated by the POSIX standard (see the STANDARDS section). It is a fatal error to attempt to redefine words that this bc(1) does not reserve as keywords. -S scale, --scale=scale Sets the builtin variable scale to the value scale assuming that scale is in base 10. It is a fatal error if scale is not a valid number. If multiple instances of this option are given, the last is used. This is a non-portable extension. -s, --standard Process exactly the language defined by the standard (see the STANDARDS section) and error if any extensions are used. This is a non-portable extension. -v, -V, --version Print the version information (copyright header) and exits. This is a non-portable extension. -w, --warn Like -s and --standard, except that warnings (and not errors) are printed for non-standard extensions and execution continues normally. This is a non-portable extension. -z, --leading-zeroes Makes bc(1) print all numbers greater than -1 and less than 1, and not equal to 0, with a leading zero. This can be set for individual numbers with the plz(x), plznl(x), pnlz(x), and pnlznl(x) functions in the extended math library (see the LIBRARY section). This is a non-portable extension. All long options are non-portable extensions. STDIN If no files or expressions are given by the -f, --file, -e, or --expression options, then bc(1) reads from stdin. However, there are a few caveats to this. First, stdin is evaluated a line at a time. The only exception to this is if the parse cannot complete. That means that starting a string without ending it or starting a function, if statement, or loop without ending it will also cause bc(1) to not execute. Second, after an if statement, bc(1) doesn’t know if an else statement will follow, so it will not execute until it knows there will not be an else statement. STDOUT Any non-error output is written to stdout. In addition, if history (see the HISTORY section) and the prompt (see the TTY MODE section) are enabled, both are output to stdout. Note: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the EXIT STATUS section) if it cannot write to stdout, so if stdout is closed, as in bc >&-, it will quit with an error. This is done so that bc(1) can report problems when stdout is redirected to a file. If there are scripts that depend on the behavior of other bc(1) implementations, it is recommended that those scripts be changed to redirect stdout to /dev/null. STDERR Any error output is written to stderr. Note: Unlike other bc(1) implementations, this bc(1) will issue a fatal error (see the EXIT STATUS section) if it cannot write to stderr, so if stderr is closed, as in bc 2>&-, it will quit with an error. This is done so that bc(1) can exit with an error code when stderr is redirected to a file. If there are scripts that depend on the behavior of other bc(1) implementations, it is recommended that those scripts be changed to redirect stderr to /dev/null. SYNTAX The syntax for bc(1) programs is mostly C-like, with some differences. This bc(1) follows the POSIX standard (see the STANDARDS section), which is a much more thorough resource for the language this bc(1) accepts. This section is meant to be a summary and a listing of all the extensions to the standard. In the sections below, E means expression, S means statement, and I means identifier. Identifiers (I) start with a lowercase letter and can be followed by any number (up to BC_NAME_MAX-1) of lowercase letters (a-z), digits (0-9), and underscores (_). The regex is [a-z][a-z0-9_]*. Identifiers with more than one character (letter) are a non-portable extension. ibase is a global variable determining how to interpret constant numbers. It is the “input” base, or the number base used for interpreting input numbers. ibase is initially 10. If the -s (--standard) and -w (--warn) flags were not given on the command line, the max allowable value for ibase is 36. Otherwise, it is 16. The min allowable value for ibase is 2. The max allowable value for ibase can be queried in bc(1) programs with the maxibase() built-in function. obase is a global variable determining how to output results. It is the “output” base, or the number base used for outputting numbers. obase is initially 10. The max allowable value for obase is BC_BASE_MAX and can be queried in bc(1) programs with the maxobase() built-in function. The min allowable value for obase is 0. If obase is 0, values are output in scientific notation, and if obase is 1, values are output in engineering notation. Otherwise, values are output in the specified base. Outputting in scientific and engineering notations are non-portable extensions. The scale of an expression is the number of digits in the result of the expression right of the decimal point, and scale is a global variable that sets the precision of any operations, with exceptions. scale is initially 0. scale cannot be negative. The max allowable value for scale is BC_SCALE_MAX and can be queried in bc(1) programs with the maxscale() built-in function. bc(1) has both global variables and local variables. All local variables are local to the function; they are parameters or are introduced in the auto list of a function (see the FUNCTIONS section). If a variable is accessed which is not a parameter or in the auto list, it is assumed to be global. If a parent function has a local variable version of a variable that a child function considers global, the value of that global variable in the child function is the value of the variable in the parent function, not the value of the actual global variable. All of the above applies to arrays as well. The value of a statement that is an expression (i.e., any of the named expressions or operands) is printed unless the lowest precedence operator is an assignment operator and the expression is notsurrounded by parentheses. The value that is printed is also assigned to the special variable last. A single dot (.) may also be used as a synonym for last. These are non-portable extensions. Either semicolons or newlines may separate statements. Comments There are two kinds of comments: 1. Block comments are enclosed in /* and */. 2. Line comments go from # until, and not including, the next newline. This is a non-portable extension. Named Expressions The following are named expressions in bc(1): 1. Variables: I 2. Array Elements: I[E] 3. ibase 4. obase 5. scale 6. seed 7. last or a single dot (.) Numbers 6 and 7 are non-portable extensions. The meaning of seed is dependent on the current pseudo-random number generator but is guaranteed to not change except for new major versions. The scale and sign of the value may be significant. If a previously used seed value is assigned to seed and used again, the pseudo-random number generator is guaranteed to produce the same sequence of pseudo-random numbers as it did when the seed value was previously used. The exact value assigned to seed is not guaranteed to be returned if seed is queried again immediately. However, if seed does return a different value, both values, when assigned to seed, are guaranteed to produce the same sequence of pseudo-random numbers. This means that certain values assigned to seed will not produce unique sequences of pseudo-random numbers. The value of seed will change after any use of the rand() and irand(E) operands (see the Operands subsection below), except if the parameter passed to irand(E) is 0, 1, or negative. There is no limit to the length (number of significant decimal digits) or scale of the value that can be assigned to seed. Variables and arrays do not interfere; users can have arrays named the same as variables. This also applies to functions (see the FUNCTIONS section), so a user can have a variable, array, and function that all have the same name, and they will not shadow each other, whether inside of functions or not. Named expressions are required as the operand of increment/decrement operators and as the left side of assignment operators (see the Operators subsection). Operands The following are valid operands in bc(1): 1. Numbers (see the Numbers subsection below). 2. Array indices (I[E]). 3. (E): The value of E (used to change precedence). 4. sqrt(E): The square root of E. E must be non-negative. 5. length(E): The number of significant decimal digits in E. Returns 1 for 0 with no decimal places. If given a string, the length of the string is returned. Passing a string to length(E) is a non- portable extension. 6. length(I[]): The number of elements in the array I. This is a non- portable extension. 7. scale(E): The scale of E. 8. abs(E): The absolute value of E. This is a non-portable extension. 9. is_number(E): 1 if the given argument is a number, 0 if it is a string. This is a non-portable extension. 10. is_string(E): 1 if the given argument is a string, 0 if it is a number. This is a non-portable extension. 11. modexp(E, E, E): Modular exponentiation, where the first expression is the base, the second is the exponent, and the third is the modulus. All three values must be integers. The second argument must be non-negative. The third argument must be non-zero. This is a non-portable extension. 12. divmod(E, E, I[]): Division and modulus in one operation. This is for optimization. The first expression is the dividend, and the second is the divisor, which must be non-zero. The return value is the quotient, and the modulus is stored in index 0 of the provided array (the last argument). This is a non-portable extension. 13. asciify(E): If E is a string, returns a string that is the first letter of its argument. If it is a number, calculates the number mod 256 and returns that number as a one-character string. This is a non-portable extension. 14. asciify(I[]): A string that is made up of the characters that would result from running asciify(E) on each element of the array identified by the argument. This allows creating multi-character strings and storing them. This is a non-portable extension. 15. I(), I(E), I(E, E), and so on, where I is an identifier for a non-void function (see the Void Functions subsection of the FUNCTIONS section). The E argument(s) may also be arrays of the form I[], which will automatically be turned into array references (see the Array References subsection of the FUNCTIONS section) if the corresponding parameter in the function definition is an array reference. 16. read(): Reads a line from stdin and uses that as an expression. The result of that expression is the result of the read() operand. This is a non-portable extension. 17. maxibase(): The max allowable ibase. This is a non-portable extension. 18. maxobase(): The max allowable obase. This is a non-portable extension. 19. maxscale(): The max allowable scale. This is a non-portable extension. 20. line_length(): The line length set with BC_LINE_LENGTH (see the ENVIRONMENT VARIABLES section). This is a non-portable extension. 21. global_stacks(): 0 if global stacks are not enabled with the -g or --global-stacks options, non-zero otherwise. See the OPTIONS section. This is a non-portable extension. 22. leading_zero(): 0 if leading zeroes are not enabled with the -z or –leading-zeroes options, non-zero otherwise. See the OPTIONS section. This is a non-portable extension. 23. rand(): A pseudo-random integer between 0 (inclusive) and BC_RAND_MAX (inclusive). Using this operand will change the value of seed. This is a non-portable extension. 24. irand(E): A pseudo-random integer between 0 (inclusive) and the value of E (exclusive). If E is negative or is a non-integer (E’s scale is not 0), an error is raised, and bc(1) resets (see the RESET section) while seed remains unchanged. If E is larger than BC_RAND_MAX, the higher bound is honored by generating several pseudo-random integers, multiplying them by appropriate powers of BC_RAND_MAX+1, and adding them together. Thus, the size of integer that can be generated with this operand is unbounded. Using this operand will change the value of seed, unless the value of E is 0 or 1. In that case, 0 is returned, and seed is not changed. This is a non-portable extension. 25. maxrand(): The max integer returned by rand(). This is a non- portable extension. The integers generated by rand() and irand(E) are guaranteed to be as unbiased as possible, subject to the limitations of the pseudo-random number generator. Note: The values returned by the pseudo-random number generator with rand() and irand(E) are guaranteed to NOT be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, they are guaranteed to be reproducible with identical seed values. This means that the pseudo-random values from bc(1) should only be used where a reproducible stream of pseudo-random numbers is ESSENTIAL. In any other case, use a non-seeded pseudo-random number generator. Numbers Numbers are strings made up of digits, uppercase letters, and at most 1 period for a radix. Numbers can have up to BC_NUM_MAX digits. Uppercase letters are equal to 9 plus their position in the alphabet, starting from 1 (i.e., A equals 10, or 9+1). If a digit or letter makes no sense with the current value of ibase (i.e., they are greater than or equal to the current value of ibase), then the behavior depends on the existence of the -c/--digit-clamp or -C/--no-digit-clamp options (see the OPTIONS section), the existence and setting of the BC_DIGIT_CLAMP environment variable (see the ENVIRONMENT VARIABLES section), or the default, which can be queried with the -h/--help option. If clamping is off, then digits or letters that are greater than or equal to the current value of ibase are not changed. Instead, their given value is multiplied by the appropriate power of ibase and added into the number. This means that, with an ibase of 3, the number AB is equal to 3^1*A+3^0*B, which is 3 times 10 plus 11, or 41. If clamping is on, then digits or letters that are greater than or equal to the current value of ibase are set to the value of the highest valid digit in ibase before being multiplied by the appropriate power of ibase and added into the number. This means that, with an ibase of 3, the number AB is equal to 3^1*2+3^0*2, which is 3 times 2 plus 2, or 8. There is one exception to clamping: single-character numbers (i.e., A alone). Such numbers are never clamped and always take the value they would have in the highest possible ibase. This means that A alone always equals decimal 10 and Z alone always equals decimal 35. This behavior is mandated by the standard (see the STANDARDS section) and is meant to provide an easy way to set the current ibase (with the i command) regardless of the current value of ibase. If clamping is on, and the clamped value of a character is needed, use a leading zero, i.e., for A, use 0A. In addition, bc(1) accepts numbers in scientific notation. These have the form <number>e<integer>. The exponent (the portion after the e) must be an integer. An example is 1.89237e9, which is equal to 1892370000. Negative exponents are also allowed, so 4.2890e-3 is equal to 0.0042890. Using scientific notation is an error or warning if the -s or -w, respectively, command-line options (or equivalents) are given. WARNING: Both the number and the exponent in scientific notation are interpreted according to the current ibase, but the number is still multiplied by 10^exponent regardless of the current ibase. For example, if ibase is 16 and bc(1) is given the number string FFeA, the resulting decimal number will be 2550000000000, and if bc(1) is given the number string 10e-4, the resulting decimal number will be 0.0016. Accepting input as scientific notation is a non-portable extension. Operators The following arithmetic and logical operators can be used. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. ++ -- Type: Prefix and Postfix Associativity: None Description: increment, decrement - ! Type: Prefix Associativity: None Description: negation, boolean not $ Type: Postfix Associativity: None Description: truncation @ Type: Binary Associativity: Right Description: set precision ^ Type: Binary Associativity: Right Description: power * / % Type: Binary Associativity: Left Description: multiply, divide, modulus + - Type: Binary Associativity: Left Description: add, subtract << >> Type: Binary Associativity: Left Description: shift left, shift right = <<= >>= += -= *= /= %= ^= @= Type: Binary Associativity: Right Description: assignment == <= >= != < > Type: Binary Associativity: Left Description: relational && Type: Binary Associativity: Left Description: boolean and || Type: Binary Associativity: Left Description: boolean or The operators will be described in more detail below. ++ -- The prefix and postfix increment and decrement operators behave exactly like they would in C. They require a named expression (see the Named Expressions subsection) as an operand. The prefix versions of these operators are more efficient; use them where possible. - The negation operator returns 0 if a user attempts to negate any expression with the value 0. Otherwise, a copy of the expression with its sign flipped is returned. ! The boolean not operator returns 1 if the expression is 0, or 0 otherwise. This is a non-portable extension. $ The truncation operator returns a copy of the given expression with all of its scale removed. This is a non-portable extension. @ The set precision operator takes two expressions and returns a copy of the first with its scale equal to the value of the second expression. That could either mean that the number is returned without change (if the scale of the first expression matches the value of the second expression), extended (if it is less), or truncated (if it is more). The second expression must be an integer (no scale) and non- negative. This is a non-portable extension. ^ The power operator (not the exclusive or operator, as it would be in C) takes two expressions and raises the first to the power of the value of the second. The scale of the result is equal to scale. The second expression must be an integer (no scale), and if it is negative, the first value must be non-zero. * The multiply operator takes two expressions, multiplies them, and returns the product. If a is the scale of the first expression and b is the scale of the second expression, the scale of the result is equal to min(a+b,max(scale,a,b)) where min() and max() return the obvious values. / The divide operator takes two expressions, divides them, and returns the quotient. The scale of the result shall be the value of scale. The second expression must be non-zero. % The modulus operator takes two expressions, a and b, and evaluates them by 1) Computing a/b to current scale and 2) Using the result of step 1 to calculate a-(a/b)*b to scale max(scale+scale(b),scale(a)). The second expression must be non-zero. + The add operator takes two expressions, a and b, and returns the sum, with a scale equal to the max of the scales of a and b. - The subtract operator takes two expressions, a and b, and returns the difference, with a scale equal to the max of the scales of a and b. << The left shift operator takes two expressions, a and b, and returns a copy of the value of a with its decimal point moved b places to the right. The second expression must be an integer (no scale) and non- negative. This is a non-portable extension. >> The right shift operator takes two expressions, a and b, and returns a copy of the value of a with its decimal point moved b places to the left. The second expression must be an integer (no scale) and non- negative. This is a non-portable extension. = <<= >>= += -= *= /= %= ^= @= The assignment operators take two expressions, a and b where a is a named expression (see the Named Expressions subsection). For =, b is copied and the result is assigned to a. For all others, a and b are applied as operands to the corresponding arithmetic operator and the result is assigned to a. The assignment operators that correspond to operators that are extensions are themselves non-portable extensions. == <= >= != < > The relational operators compare two expressions, a and b, and if the relation holds, according to C language semantics, the result is 1. Otherwise, it is 0. Note that unlike in C, these operators have a lower precedence than the assignment operators, which means that a=b>c is interpreted as (a=b)>c. Also, unlike the standard (see the STANDARDS section) requires, these operators can appear anywhere any other expressions can be used. This allowance is a non-portable extension. && The boolean and operator takes two expressions and returns 1 if both expressions are non-zero, 0 otherwise. This is not a short-circuit operator. This is a non-portable extension. || The boolean or operator takes two expressions and returns 1 if one of the expressions is non-zero, 0 otherwise. This is not a short-circuit operator. This is a non-portable extension. Statements The following items are statements: 1. E 2. { S ; ... ; S } 3. if ( E ) S 4. if ( E ) S else S 5. while ( E ) S 6. for ( E ; E ; E ) S 7. An empty statement 8. break 9. continue 10. quit 11. halt 12. limits 13. A string of characters, enclosed in double quotes 14. print E , ... , E 15. stream E , ... , E 16. I(), I(E), I(E, E), and so on, where I is an identifier for a void function (see the Void Functions subsection of the FUNCTIONS section). The E argument(s) may also be arrays of the form I[], which will automatically be turned into array references (see the Array References subsection of the FUNCTIONS section) if the corresponding parameter in the function definition is an array reference. Numbers 4, 9, 11, 12, 14, 15, and 16 are non-portable extensions. Also, as a non-portable extension, any or all of the expressions in the header of a for loop may be omitted. If the condition (second expression) is omitted, it is assumed to be a constant 1. The break statement causes a loop to stop iterating and resume execution immediately following a loop. This is only allowed in loops. The continue statement causes a loop iteration to stop early and returns to the start of the loop, including testing the loop condition. This is only allowed in loops. The if else statement does the same thing as in C. The quit statement causes bc(1) to quit, even if it is on a branch that will not be executed (it is a compile-time command). Warning: The behavior of this bc(1) on quit is slightly different from other bc(1) implementations. Other bc(1) implementations will exit as soon as they finish parsing the line that a quit command is on. This bc(1) will execute any completed and executable statements that occur before the quit statement before exiting. In other words, for the bc(1) code below: for (i = 0; i < 3; ++i) i; quit Other bc(1) implementations will print nothing, and this bc(1) will print 0, 1, and 2 on successive lines before exiting. The halt statement causes bc(1) to quit, if it is executed. (Unlike quit if it is on a branch of an if statement that is not executed, bc(1) does not quit.) The limits statement prints the limits that this bc(1) is subject to. This is like the quit statement in that it is a compile-time command. An expression by itself is evaluated and printed, followed by a newline. Both scientific notation and engineering notation are available for printing the results of expressions. Scientific notation is activated by assigning 0 to obase, and engineering notation is activated by assigning 1 to obase. To deactivate them, just assign a different value to obase. Scientific notation and engineering notation are disabled if bc(1) is run with either the -s or -w command-line options (or equivalents). Printing numbers in scientific notation and/or engineering notation is a non-portable extension. Strings If strings appear as a statement by themselves, they are printed without a trailing newline. In addition to appearing as a lone statement by themselves, strings can be assigned to variables and array elements. They can also be passed to functions in variable parameters. If any statement that expects a string is given a variable that had a string assigned to it, the statement acts as though it had received a string. If any math operation is attempted on a string or a variable or array element that has been assigned a string, an error is raised, and bc(1) resets (see the RESET section). Assigning strings to variables and array elements and passing them to functions are non-portable extensions. Print Statement The “expressions” in a print statement may also be strings. If they are, there are backslash escape sequences that are interpreted specially. What those sequences are, and what they cause to be printed, are shown below: \a: \a \b: \b \\: \ \e: \ \f: \f \n: \n \q: “ \r: \r \t: \t Any other character following a backslash causes the backslash and character to be printed as-is. Any non-string expression in a print statement shall be assigned to last, like any other expression that is printed. Stream Statement The “expressions in a stream statement may also be strings. If a stream statement is given a string, it prints the string as though the string had appeared as its own statement. In other words, the stream statement prints strings normally, without a newline. If a stream statement is given a number, a copy of it is truncated and its absolute value is calculated. The result is then printed as though obase is 256 and each digit is interpreted as an 8-bit ASCII character, making it a byte stream. Order of Evaluation All expressions in a statment are evaluated left to right, except as necessary to maintain order of operations. This means, for example, assuming that i is equal to 0, in the expression a[i++] = i++ the first (or 0th) element of a is set to 1, and i is equal to 2 at the end of the expression. This includes function arguments. Thus, assuming i is equal to 0, this means that in the expression x(i++, i++) the first argument passed to x() is 0, and the second argument is 1, while i is equal to 2 before the function starts executing. FUNCTIONS Function definitions are as follows: define I(I,...,I){ auto I,...,I S;...;S return(E) } Any I in the parameter list or auto list may be replaced with I[] to make a parameter or auto var an array, and any I in the parameter list may be replaced with *I[] to make a parameter an array reference. Callers of functions that take array references should not put an asterisk in the call; they must be called with just I[] like normal array parameters and will be automatically converted into references. As a non-portable extension, the opening brace of a define statement may appear on the next line. As a non-portable extension, the return statement may also be in one of the following forms: 1. return 2. return ( ) 3. return E The first two, or not specifying a return statement, is equivalent to return (0), unless the function is a void function (see the Void Functions subsection below). Void Functions Functions can also be void functions, defined as follows: define void I(I,...,I){ auto I,...,I S;...;S return } They can only be used as standalone expressions, where such an expression would be printed alone, except in a print statement. Void functions can only use the first two return statements listed above. They can also omit the return statement entirely. The word “void” is not treated as a keyword; it is still possible to have variables, arrays, and functions named void. The word “void” is only treated specially right after the define keyword. This is a non-portable extension. Array References For any array in the parameter list, if the array is declared in the form *I[] it is a reference. Any changes to the array in the function are reflected, when the function returns, to the array that was passed in. Other than this, all function arguments are passed by value. This is a non-portable extension. LIBRARY All of the functions below, including the functions in the extended math library (see the Extended Library subsection below), are available when the -l or --mathlib command-line flags are given, except that the extended math library is not available when the -s option, the -w option, or equivalents are given. Standard Library The standard (see the STANDARDS section) defines the following functions for the math library: s(x) Returns the sine of x, which is assumed to be in radians. This is a transcendental function (see the Transcendental Functions subsection below). c(x) Returns the cosine of x, which is assumed to be in radians. This is a transcendental function (see the Transcendental Functions subsection below). a(x) Returns the arctangent of x, in radians. This is a transcendental function (see the Transcendental Functions subsection below). l(x) Returns the natural logarithm of x. This is a transcendental function (see the Transcendental Functions subsection below). e(x) Returns the mathematical constant e raised to the power of x. This is a transcendental function (see the Transcendental Functions subsection below). j(x, n) Returns the bessel integer order n (truncated) of x. This is a transcendental function (see the Transcendental Functions subsection below). Extended Library The extended library is not loaded when the -s/--standard or -w/--warn options are given since they are not part of the library defined by the standard (see the STANDARDS section). The extended library is a non-portable extension. p(x, y) Calculates x to the power of y, even if y is not an integer, and returns the result to the current scale. It is an error if y is negative and x is 0. This is a transcendental function (see the Transcendental Functions subsection below). r(x, p) Returns x rounded to p decimal places according to the rounding mode round half away from 0 (https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero). ceil(x, p) Returns x rounded to p decimal places according to the rounding mode round away from 0 (https://en.wikipedia.org/wiki/Rounding#Rounding_away_from_zero). f(x) Returns the factorial of the truncated absolute value of x. perm(n, k) Returns the permutation of the truncated absolute value of n of the truncated absolute value of k, if k <= n. If not, it returns 0. comb(n, k) Returns the combination of the truncated absolute value of n of the truncated absolute value of k, if k <= n. If not, it returns 0. l2(x) Returns the logarithm base 2 of x. This is a transcendental function (see the Transcendental Functions subsection below). l10(x) Returns the logarithm base 10 of x. This is a transcendental function (see the Transcendental Functions subsection below). log(x, b) Returns the logarithm base b of x. This is a transcendental function (see the Transcendental Functions subsection below). cbrt(x) Returns the cube root of x. root(x, n) Calculates the truncated value of n, r, and returns the rth root of x to the current scale. If r is 0 or negative, this raises an error and causes bc(1) to reset (see the RESET section). It also raises an error and causes bc(1) to reset if r is even and x is negative. gcd(a, b) Returns the greatest common divisor (factor) of the truncated absolute value of a and the truncated absolute value of b. lcm(a, b) Returns the least common multiple of the truncated absolute value of a and the truncated absolute value of b. pi(p) Returns pi to p decimal places. This is a transcendental function (see the Transcendental Functions subsection below). t(x) Returns the tangent of x, which is assumed to be in radians. This is a transcendental function (see the Transcendental Functions subsection below). a2(y, x) Returns the arctangent of y/x, in radians. If both y and x are equal to 0, it raises an error and causes bc(1) to reset (see the RESET section). Otherwise, if x is greater than 0, it returns a(y/x). If x is less than 0, and y is greater than or equal to 0, it returns a(y/x)+pi. If x is less than 0, and y is less than 0, it returns a(y/x)-pi. If x is equal to 0, and y is greater than 0, it returns pi/2. If x is equal to 0, and y is less than 0, it returns -pi/2. This function is the same as the atan2() function in many programming languages. This is a transcendental function (see the Transcendental Functions subsection below). sin(x) Returns the sine of x, which is assumed to be in radians. This is an alias of s(x). This is a transcendental function (see the Transcendental Functions subsection below). cos(x) Returns the cosine of x, which is assumed to be in radians. This is an alias of c(x). This is a transcendental function (see the Transcendental Functions subsection below). tan(x) Returns the tangent of x, which is assumed to be in radians. If x is equal to 1 or -1, this raises an error and causes bc(1) to reset (see the RESET section). This is an alias of t(x). This is a transcendental function (see the Transcendental Functions subsection below). atan(x) Returns the arctangent of x, in radians. This is an alias of a(x). This is a transcendental function (see the Transcendental Functions subsection below). atan2(y, x) Returns the arctangent of y/x, in radians. If both y and x are equal to 0, it raises an error and causes bc(1) to reset (see the RESET section). Otherwise, if x is greater than 0, it returns a(y/x). If x is less than 0, and y is greater than or equal to 0, it returns a(y/x)+pi. If x is less than 0, and y is less than 0, it returns a(y/x)-pi. If x is equal to 0, and y is greater than 0, it returns pi/2. If x is equal to 0, and y is less than 0, it returns -pi/2. This function is the same as the atan2() function in many programming languages. This is an alias of a2(y, x). This is a transcendental function (see the Transcendental Functions subsection below). r2d(x) Converts x from radians to degrees and returns the result. This is a transcendental function (see the Transcendental Functions subsection below). d2r(x) Converts x from degrees to radians and returns the result. This is a transcendental function (see the Transcendental Functions subsection below). frand(p) Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of p. If p is not 0, then calling this function will change the value of seed. If p is 0, then 0 is returned, and seed is not changed. ifrand(i, p) Generates a pseudo-random number that is between 0 (inclusive) and the truncated absolute value of i (exclusive) with the number of decimal digits after the decimal point equal to the truncated absolute value of p. If the absolute value of i is greater than or equal to 2, and p is not 0, then calling this function will change the value of seed; otherwise, 0 is returned and seed is not changed. srand(x) Returns x with its sign flipped with probability 0.5. In other words, it randomizes the sign of x. brand() Returns a random boolean value (either 0 or 1). band(a, b) Takes the truncated absolute value of both a and b and calculates and returns the result of the bitwise and operation between them. If you want to use signed two’s complement arguments, use s2u(x) to convert. bor(a, b) Takes the truncated absolute value of both a and b and calculates and returns the result of the bitwise or operation between them. If you want to use signed two’s complement arguments, use s2u(x) to convert. bxor(a, b) Takes the truncated absolute value of both a and b and calculates and returns the result of the bitwise xor operation between them. If you want to use signed two’s complement arguments, use s2u(x) to convert. bshl(a, b) Takes the truncated absolute value of both a and b and calculates and returns the result of a bit-shifted left by b places. If you want to use signed two’s complement arguments, use s2u(x) to convert. bshr(a, b) Takes the truncated absolute value of both a and b and calculates and returns the truncated result of a bit-shifted right by b places. If you want to use signed two’s complement arguments, use s2u(x) to convert. bnotn(x, n) Takes the truncated absolute value of x and does a bitwise not as though it has the same number of bytes as the truncated absolute value of n. If you want to a use signed two’s complement argument, use s2u(x) to convert. bnot8(x) Does a bitwise not of the truncated absolute value of x as though it has 8 binary digits (1 unsigned byte). If you want to a use signed two’s complement argument, use s2u(x) to convert. bnot16(x) Does a bitwise not of the truncated absolute value of x as though it has 16 binary digits (2 unsigned bytes). If you want to a use signed two’s complement argument, use s2u(x) to convert. bnot32(x) Does a bitwise not of the truncated absolute value of x as though it has 32 binary digits (4 unsigned bytes). If you want to a use signed two’s complement argument, use s2u(x) to convert. bnot64(x) Does a bitwise not of the truncated absolute value of x as though it has 64 binary digits (8 unsigned bytes). If you want to a use signed two’s complement argument, use s2u(x) to convert. bnot(x) Does a bitwise not of the truncated absolute value of x as though it has the minimum number of power of two unsigned bytes. If you want to a use signed two’s complement argument, use s2u(x) to convert. brevn(x, n) Runs a bit reversal on the truncated absolute value of x as though it has the same number of 8-bit bytes as the truncated absolute value of n. If you want to a use signed two’s complement argument, use s2u(x) to convert. brev8(x) Runs a bit reversal on the truncated absolute value of x as though it has 8 binary digits (1 unsigned byte). If you want to a use signed two’s complement argument, use s2u(x) to convert. brev16(x) Runs a bit reversal on the truncated absolute value of x as though it has 16 binary digits (2 unsigned bytes). If you want to a use signed two’s complement argument, use s2u(x) to convert. brev32(x) Runs a bit reversal on the truncated absolute value of x as though it has 32 binary digits (4 unsigned bytes). If you want to a use signed two’s complement argument, use s2u(x) to convert. brev64(x) Runs a bit reversal on the truncated absolute value of x as though it has 64 binary digits (8 unsigned bytes). If you want to a use signed two’s complement argument, use s2u(x) to convert. brev(x) Runs a bit reversal on the truncated absolute value of x as though it has the minimum number of power of two unsigned bytes. If you want to a use signed two’s complement argument, use s2u(x) to convert. broln(x, p, n) Does a left bitwise rotatation of the truncated absolute value of x, as though it has the same number of unsigned 8-bit bytes as the truncated absolute value of n, by the number of places equal to the truncated absolute value of p modded by the 2 to the power of the number of binary digits in n 8-bit bytes. If you want to a use signed two’s complement argument, use s2u(x) to convert. brol8(x, p) Does a left bitwise rotatation of the truncated absolute value of x, as though it has 8 binary digits (1 unsigned byte), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 8. If you want to a use signed two’s complement argument, use s2u(x) to convert. brol16(x, p) Does a left bitwise rotatation of the truncated absolute value of x, as though it has 16 binary digits (2 unsigned bytes), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 16. If you want to a use signed two’s complement argument, use s2u(x) to convert. brol32(x, p) Does a left bitwise rotatation of the truncated absolute value of x, as though it has 32 binary digits (2 unsigned bytes), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 32. If you want to a use signed two’s complement argument, use s2u(x) to convert. brol64(x, p) Does a left bitwise rotatation of the truncated absolute value of x, as though it has 64 binary digits (2 unsigned bytes), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 64. If you want to a use signed two’s complement argument, use s2u(x) to convert. brol(x, p) Does a left bitwise rotatation of the truncated absolute value of x, as though it has the minimum number of power of two unsigned 8-bit bytes, by the number of places equal to the truncated absolute value of p modded by 2 to the power of the number of binary digits in the minimum number of 8-bit bytes. If you want to a use signed two’s complement argument, use s2u(x) to convert. brorn(x, p, n) Does a right bitwise rotatation of the truncated absolute value of x, as though it has the same number of unsigned 8-bit bytes as the truncated absolute value of n, by the number of places equal to the truncated absolute value of p modded by the 2 to the power of the number of binary digits in n 8-bit bytes. If you want to a use signed two’s complement argument, use s2u(x) to convert. bror8(x, p) Does a right bitwise rotatation of the truncated absolute value of x, as though it has 8 binary digits (1 unsigned byte), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 8. If you want to a use signed two’s complement argument, use s2u(x) to convert. bror16(x, p) Does a right bitwise rotatation of the truncated absolute value of x, as though it has 16 binary digits (2 unsigned bytes), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 16. If you want to a use signed two’s complement argument, use s2u(x) to convert. bror32(x, p) Does a right bitwise rotatation of the truncated absolute value of x, as though it has 32 binary digits (2 unsigned bytes), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 32. If you want to a use signed two’s complement argument, use s2u(x) to convert. bror64(x, p) Does a right bitwise rotatation of the truncated absolute value of x, as though it has 64 binary digits (2 unsigned bytes), by the number of places equal to the truncated absolute value of p modded by 2 to the power of 64. If you want to a use signed two’s complement argument, use s2u(x) to convert. bror(x, p) Does a right bitwise rotatation of the truncated absolute value of x, as though it has the minimum number of power of two unsigned 8-bit bytes, by the number of places equal to the truncated absolute value of p modded by 2 to the power of the number of binary digits in the minimum number of 8-bit bytes. If you want to a use signed two’s complement argument, use s2u(x) to convert. bmodn(x, n) Returns the modulus of the truncated absolute value of x by 2 to the power of the multiplication of the truncated absolute value of n and 8. If you want to a use signed two’s complement argument, use s2u(x) to convert. bmod8(x, n) Returns the modulus of the truncated absolute value of x by 2 to the power of 8. If you want to a use signed two’s complement argument, use s2u(x) to convert. bmod16(x, n) Returns the modulus of the truncated absolute value of x by 2 to the power of 16. If you want to a use signed two’s complement argument, use s2u(x) to convert. bmod32(x, n) Returns the modulus of the truncated absolute value of x by 2 to the power of 32. If you want to a use signed two’s complement argument, use s2u(x) to convert. bmod64(x, n) Returns the modulus of the truncated absolute value of x by 2 to the power of 64. If you want to a use signed two’s complement argument, use s2u(x) to convert. bunrev(t) Assumes t is a bitwise-reversed number with an extra set bit one place more significant than the real most significant bit (which was the least significant bit in the original number). This number is reversed and returned without the extra set bit. This function is used to implement other bitwise functions; it is not meant to be used by users, but it can be. plz(x) If x is not equal to 0 and greater that -1 and less than 1, it is printed with a leading zero, regardless of the use of the -z option (see the OPTIONS section) and without a trailing newline. Otherwise, x is printed normally, without a trailing newline. plznl(x) If x is not equal to 0 and greater that -1 and less than 1, it is printed with a leading zero, regardless of the use of the -z option (see the OPTIONS section) and with a trailing newline. Otherwise, x is printed normally, with a trailing newline. pnlz(x) If x is not equal to 0 and greater that -1 and less than 1, it is printed without a leading zero, regardless of the use of the -z option (see the OPTIONS section) and without a trailing newline. Otherwise, x is printed normally, without a trailing newline. pnlznl(x) If x is not equal to 0 and greater that -1 and less than 1, it is printed without a leading zero, regardless of the use of the -z option (see the OPTIONS section) and with a trailing newline. Otherwise, x is printed normally, with a trailing newline. ubytes(x) Returns the numbers of unsigned integer bytes required to hold the truncated absolute value of x. sbytes(x) Returns the numbers of signed, two’s-complement integer bytes required to hold the truncated value of x. s2u(x) Returns x if it is non-negative. If it is negative, then it calculates what x would be as a 2’s-complement signed integer and returns the non-negative integer that would have the same representation in binary. s2un(x,n) Returns x if it is non-negative. If it is negative, then it calculates what x would be as a 2’s-complement signed integer with n bytes and returns the non-negative integer that would have the same representation in binary. If x cannot fit into n 2’s-complement signed bytes, it is truncated to fit. hex(x) Outputs the hexadecimal (base 16) representation of x. This is a void function (see the Void Functions subsection of the FUNCTIONS section). binary(x) Outputs the binary (base 2) representation of x. This is a void function (see the Void Functions subsection of the FUNCTIONS section). output(x, b) Outputs the base b representation of x. This is a void function (see the Void Functions subsection of the FUNCTIONS section). uint(x) Outputs the representation, in binary and hexadecimal, of x as an unsigned integer in as few power of two bytes as possible. Both outputs are split into bytes separated by spaces. If x is not an integer or is negative, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). int(x) Outputs the representation, in binary and hexadecimal, of x as a signed, two’s-complement integer in as few power of two bytes as possible. Both outputs are split into bytes separated by spaces. If x is not an integer, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). uintn(x, n) Outputs the representation, in binary and hexadecimal, of x as an unsigned integer in n bytes. Both outputs are split into bytes separated by spaces. If x is not an integer, is negative, or cannot fit into n bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). intn(x, n) Outputs the representation, in binary and hexadecimal, of x as a signed, two’s-complement integer in n bytes. Both outputs are split into bytes separated by spaces. If x is not an integer or cannot fit into n bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). uint8(x) Outputs the representation, in binary and hexadecimal, of x as an unsigned integer in 1 byte. Both outputs are split into bytes separated by spaces. If x is not an integer, is negative, or cannot fit into 1 byte, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). int8(x) Outputs the representation, in binary and hexadecimal, of x as a signed, two’s-complement integer in 1 byte. Both outputs are split into bytes separated by spaces. If x is not an integer or cannot fit into 1 byte, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). uint16(x) Outputs the representation, in binary and hexadecimal, of x as an unsigned integer in 2 bytes. Both outputs are split into bytes separated by spaces. If x is not an integer, is negative, or cannot fit into 2 bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). int16(x) Outputs the representation, in binary and hexadecimal, of x as a signed, two’s-complement integer in 2 bytes. Both outputs are split into bytes separated by spaces. If x is not an integer or cannot fit into 2 bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). uint32(x) Outputs the representation, in binary and hexadecimal, of x as an unsigned integer in 4 bytes. Both outputs are split into bytes separated by spaces. If x is not an integer, is negative, or cannot fit into 4 bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). int32(x) Outputs the representation, in binary and hexadecimal, of x as a signed, two’s-complement integer in 4 bytes. Both outputs are split into bytes separated by spaces. If x is not an integer or cannot fit into 4 bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). uint64(x) Outputs the representation, in binary and hexadecimal, of x as an unsigned integer in 8 bytes. Both outputs are split into bytes separated by spaces. If x is not an integer, is negative, or cannot fit into 8 bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). int64(x) Outputs the representation, in binary and hexadecimal, of x as a signed, two’s-complement integer in 8 bytes. Both outputs are split into bytes separated by spaces. If x is not an integer or cannot fit into 8 bytes, an error message is printed instead, but bc(1) is not reset (see the RESET section). This is a void function (see the Void Functions subsection of the FUNCTIONS section). hex_uint(x, n) Outputs the representation of the truncated absolute value of x as an unsigned integer in hexadecimal using n bytes. Not all of the value will be output if n is too small. This is a void function (see the Void Functions subsection of the FUNCTIONS section). binary_uint(x, n) Outputs the representation of the truncated absolute value of x as an unsigned integer in binary using n bytes. Not all of the value will be output if n is too small. This is a void function (see the Void Functions subsection of the FUNCTIONS section). output_uint(x, n) Outputs the representation of the truncated absolute value of x as an unsigned integer in the current obase (see the SYNTAX section) using n bytes. Not all of the value will be output if n is too small. This is a void function (see the Void Functions subsection of the FUNCTIONS section). output_byte(x, i) Outputs byte i of the truncated absolute value of x, where 0 is the least significant byte and number_of_bytes - 1 is the most significant byte. This is a void function (see the Void Functions subsection of the FUNCTIONS section). Transcendental Functions All transcendental functions can return slightly inaccurate results, up to 1 ULP (https://en.wikipedia.org/wiki/Unit_in_the_last_place). This is unavoidable, and the article at https://people.eecs.berkeley.edu/~wkahan/LOG10HAF.TXT explains why it is impossible and unnecessary to calculate exact results for the transcendental functions. Because of the possible inaccuracy, I recommend that users call those functions with the precision (scale) set to at least 1 higher than is necessary. If exact results are absolutely required, users can double the precision (scale) and then truncate. The transcendental functions in the standard math library are: • s(x) • c(x) • a(x) • l(x) • e(x) • j(x, n) The transcendental functions in the extended math library are: • l2(x) • l10(x) • log(x, b) • pi(p) • t(x) • a2(y, x) • sin(x) • cos(x) • tan(x) • atan(x) • atan2(y, x) • r2d(x) • d2r(x) RESET When bc(1) encounters an error or a signal that it has a non-default handler for, it resets. This means that several things happen. First, any functions that are executing are stopped and popped off the stack. The behavior is not unlike that of exceptions in programming languages. Then the execution point is set so that any code waiting to execute (after all functions returned) is skipped. Thus, when bc(1) resets, it skips any remaining code waiting to be executed. Then, if it is interactive mode, and the error was not a fatal error (see the EXIT STATUS section), it asks for more input; otherwise, it exits with the appropriate return code. Note that this reset behavior is different from the GNU bc(1), which attempts to start executing the statement right after the one that caused an error. PERFORMANCE Most bc(1) implementations use char types to calculate the value of 1 decimal digit at a time, but that can be slow. This bc(1) does something different. It uses large integers to calculate more than 1 decimal digit at a time. If built in a environment where BC_LONG_BIT (see the LIMITS section) is 64, then each integer has 9 decimal digits. If built in an environment where BC_LONG_BIT is 32 then each integer has 4 decimal digits. This value (the number of decimal digits per large integer) is called BC_BASE_DIGS. The actual values of BC_LONG_BIT and BC_BASE_DIGS can be queried with the limits statement. In addition, this bc(1) uses an even larger integer for overflow checking. This integer type depends on the value of BC_LONG_BIT, but is always at least twice as large as the integer type used to store digits. LIMITS The following are the limits on bc(1): BC_LONG_BIT The number of bits in the long type in the environment where bc(1) was built. This determines how many decimal digits can be stored in a single large integer (see the PERFORMANCE section). BC_BASE_DIGS The number of decimal digits per large integer (see the PERFORMANCE section). Depends on BC_LONG_BIT. BC_BASE_POW The max decimal number that each large integer can store (see BC_BASE_DIGS) plus 1. Depends on BC_BASE_DIGS. BC_OVERFLOW_MAX The max number that the overflow type (see the PERFORMANCE section) can hold. Depends on BC_LONG_BIT. BC_BASE_MAX The maximum output base. Set at BC_BASE_POW. BC_DIM_MAX The maximum size of arrays. Set at SIZE_MAX-1. BC_SCALE_MAX The maximum scale. Set at BC_OVERFLOW_MAX-1. BC_STRING_MAX The maximum length of strings. Set at BC_OVERFLOW_MAX-1. BC_NAME_MAX The maximum length of identifiers. Set at BC_OVERFLOW_MAX-1. BC_NUM_MAX The maximum length of a number (in decimal digits), which includes digits after the decimal point. Set at BC_OVERFLOW_MAX-1. BC_RAND_MAX The maximum integer (inclusive) returned by the rand() operand. Set at 2^BC_LONG_BIT-1. Exponent The maximum allowable exponent (positive or negative). Set at BC_OVERFLOW_MAX. Number of vars The maximum number of vars/arrays. Set at SIZE_MAX-1. The actual values can be queried with the limits statement. These limits are meant to be effectively non-existent; the limits are so large (at least on 64-bit machines) that there should not be any point at which they become a problem. In fact, memory should be exhausted before these limits should be hit. ENVIRONMENT VARIABLES As non-portable extensions, bc(1) recognizes the following environment variables: POSIXLY_CORRECT If this variable exists (no matter the contents), bc(1) behaves as if the -s option was given. BC_ENV_ARGS This is another way to give command-line arguments to bc(1). They should be in the same format as all other command-line arguments. These are always processed first, so any files given in BC_ENV_ARGS will be processed before arguments and files given on the command-line. This gives the user the ability to set up “standard” options and files to be used at every invocation. The most useful thing for such files to contain would be useful functions that the user might want every time bc(1) runs. The code that parses BC_ENV_ARGS will correctly handle quoted arguments, but it does not understand escape sequences. For example, the string “/home/gavin/some bc file.bc” will be correctly parsed, but the string “/home/gavin/some "bc" file.bc” will include the backslashes. The quote parsing will handle either kind of quotes, ’ or “. Thus, if you have a file with any number of single quotes in the name, you can use double quotes as the outside quotes, as in “some `bc' file.bc”, and vice versa if you have a file with double quotes. However, handling a file with both kinds of quotes in BC_ENV_ARGS is not supported due to the complexity of the parsing, though such files are still supported on the command-line where the parsing is done by the shell. BC_LINE_LENGTH If this environment variable exists and contains an integer that is greater than 1 and is less than UINT16_MAX (2^16-1), bc(1) will output lines to that length, including the backslash (\). The default line length is 70. The special value of 0 will disable line length checking and print numbers without regard to line length and without backslashes and newlines. BC_BANNER If this environment variable exists and contains an integer, then a non-zero value activates the copyright banner when bc(1) is in interactive mode, while zero deactivates it. If bc(1) is not in interactive mode (see the INTERACTIVE MODE section), then this environment variable has no effect because bc(1) does not print the banner when not in interactive mode. This environment variable overrides the default, which can be queried with the -h or --help options. BC_SIGINT_RESET If bc(1) is not in interactive mode (see the INTERACTIVE MODE section), then this environment variable has no effect because bc(1) exits on SIGINT when not in interactive mode. However, when bc(1) is in interactive mode, then if this environment variable exists and contains an integer, a non-zero value makes bc(1) reset on SIGINT, rather than exit, and zero makes bc(1) exit. If this environment variable exists and is not an integer, then bc(1) will exit on SIGINT. This environment variable overrides the default, which can be queried with the -h or --help options. BC_TTY_MODE If TTY mode is not available (see the TTY MODE section), then this environment variable has no effect. However, when TTY mode is available, then if this environment variable exists and contains an integer, then a non-zero value makes bc(1) use TTY mode, and zero makes bc(1) not use TTY mode. This environment variable overrides the default, which can be queried with the -h or --help options. BC_PROMPT If TTY mode is not available (see the TTY MODE section), then this environment variable has no effect. However, when TTY mode is available, then if this environment variable exists and contains an integer, a non-zero value makes bc(1) use a prompt, and zero or a non-integer makes bc(1) not use a prompt. If this environment variable does not exist and BC_TTY_MODE does, then the value of the BC_TTY_MODE environment variable is used. This environment variable and the BC_TTY_MODE environment variable override the default, which can be queried with the -h or --help options. BC_EXPR_EXIT If any expressions or expression files are given on the command- line with -e, --expression, -f, or --file, then if this environment variable exists and contains an integer, a non-zero value makes bc(1) exit after executing the expressions and expression files, and a zero value makes bc(1) not exit. This environment variable overrides the default, which can be queried with the -h or --help options. BC_DIGIT_CLAMP When parsing numbers and if this environment variable exists and contains an integer, a non-zero value makes bc(1) clamp digits that are greater than or equal to the current ibase so that all such digits are considered equal to the ibase minus 1, and a zero value disables such clamping so that those digits are always equal to their value, which is multiplied by the power of the ibase. This never applies to single-digit numbers, as per the standard (see the STANDARDS section). This environment variable overrides the default, which can be queried with the -h or --help options. EXIT STATUS bc(1) returns the following exit statuses: 0 No error. 1 A math error occurred. This follows standard practice of using 1 for expected errors, since math errors will happen in the process of normal execution. Math errors include divide by 0, taking the square root of a negative number, using a negative number as a bound for the pseudo-random number generator, attempting to convert a negative number to a hardware integer, overflow when converting a number to a hardware integer, overflow when calculating the size of a number, and attempting to use a non-integer where an integer is required. Converting to a hardware integer happens for the second operand of the power (^), places (@), left shift (<<), and right shift (>>) operators and their corresponding assignment operators. 2 A parse error occurred. Parse errors include unexpected EOF, using an invalid character, failing to find the end of a string or comment, using a token where it is invalid, giving an invalid expression, giving an invalid print statement, giving an invalid function definition, attempting to assign to an expression that is not a named expression (see the Named Expressions subsection of the SYNTAX section), giving an invalid auto list, having a duplicate auto/function parameter, failing to find the end of a code block, attempting to return a value from a void function, attempting to use a variable as a reference, and using any extensions when the option -s or any equivalents were given. 3 A runtime error occurred. Runtime errors include assigning an invalid number to any global (ibase, obase, or scale), giving a bad expression to a read() call, calling read() inside of a read() call, type errors, passing the wrong number of arguments to functions, attempting to call an undefined function, and attempting to use a void function call as a value in an expression. 4 A fatal error occurred. Fatal errors include memory allocation errors, I/O errors, failing to open files, attempting to use files that do not have only ASCII characters (bc(1) only accepts ASCII characters), attempting to open a directory as a file, and giving invalid command-line options. The exit status 4 is special; when a fatal error occurs, bc(1) always exits and returns 4, no matter what mode bc(1) is in. The other statuses will only be returned when bc(1) is not in interactive mode (see the INTERACTIVE MODE section), since bc(1) resets its state (see the RESET section) and accepts more input when one of those errors occurs in interactive mode. This is also the case when interactive mode is forced by the -i flag or --interactive option. These exit statuses allow bc(1) to be used in shell scripting with error checking, and its normal behavior can be forced by using the -i flag or --interactive option. INTERACTIVE MODE Per the standard (see the STANDARDS section), bc(1) has an interactive mode and a non-interactive mode. Interactive mode is turned on automatically when both stdin and stdout are hooked to a terminal, but the -i flag and --interactive option can turn it on in other situations. In interactive mode, bc(1) attempts to recover from errors (see the RESET section), and in normal execution, flushes stdout as soon as execution is done for the current input. bc(1) may also reset on SIGINT instead of exit, depending on the contents of, or default for, the BC_SIGINT_RESET environment variable (see the ENVIRONMENT VARIABLES section). TTY MODE If stdin, stdout, and stderr are all connected to a TTY, then “TTY mode” is considered to be available, and thus, bc(1) can turn on TTY mode, subject to some settings. If there is the environment variable BC_TTY_MODE in the environment (see the ENVIRONMENT VARIABLES section), then if that environment variable contains a non-zero integer, bc(1) will turn on TTY mode when stdin, stdout, and stderr are all connected to a TTY. If the BC_TTY_MODE environment variable exists but is not a non-zero integer, then bc(1) will not turn TTY mode on. If the environment variable BC_TTY_MODE does not exist, the default setting is used. The default setting can be queried with the -h or --help options. TTY mode is different from interactive mode because interactive mode is required in the bc(1) standard (see the STANDARDS section), and interactive mode requires only stdin and stdout to be connected to a terminal. Command-Line History Command-line history is only enabled if TTY mode is, i.e., that stdin, stdout, and stderr are connected to a TTY and the BC_TTY_MODE environment variable (see the ENVIRONMENT VARIABLES section) and its default do not disable TTY mode. See the COMMAND LINE HISTORY section for more information. Prompt If TTY mode is available, then a prompt can be enabled. Like TTY mode itself, it can be turned on or off with an environment variable: BC_PROMPT (see the ENVIRONMENT VARIABLES section). If the environment variable BC_PROMPT exists and is a non-zero integer, then the prompt is turned on when stdin, stdout, and stderr are connected to a TTY and the -P and --no-prompt options were not used. The read prompt will be turned on under the same conditions, except that the -R and --no-read-prompt options must also not be used. However, if BC_PROMPT does not exist, the prompt can be enabled or disabled with the BC_TTY_MODE environment variable, the -P and --no- prompt options, and the -R and --no-read-prompt options. See the ENVIRONMENT VARIABLES and OPTIONS sections for more details. SIGNAL HANDLING Sending a SIGINT will cause bc(1) to do one of two things. If bc(1) is not in interactive mode (see the INTERACTIVE MODE section), or the BC_SIGINT_RESET environment variable (see the ENVIRONMENT VARIABLES section), or its default, is either not an integer or it is zero, bc(1) will exit. However, if bc(1) is in interactive mode, and the BC_SIGINT_RESET or its default is an integer and non-zero, then bc(1) will stop executing the current input and reset (see the RESET section) upon receiving a SIGINT. Note that “current input” can mean one of two things. If bc(1) is processing input from stdin in interactive mode, it will ask for more input. If bc(1) is processing input from a file in interactive mode, it will stop processing the file and start processing the next file, if one exists, or ask for input from stdin if no other file exists. This means that if a SIGINT is sent to bc(1) as it is executing a file, it can seem as though bc(1) did not respond to the signal since it will immediately start executing the next file. This is by design; most files that users execute when interacting with bc(1) have function definitions, which are quick to parse. If a file takes a long time to execute, there may be a bug in that file. The rest of the files could still be executed without problem, allowing the user to continue. SIGTERM and SIGQUIT cause bc(1) to clean up and exit, and it uses the default handler for all other signals. The one exception is SIGHUP; in that case, and only when bc(1) is in TTY mode (see the TTY MODE section), a SIGHUP will cause bc(1) to clean up and exit. COMMAND LINE HISTORY bc(1) supports interactive command-line editing. If bc(1) can be in TTY mode (see the TTY MODE section), history can be enabled. This means that command-line history can only be enabled when stdin, stdout, and stderr are all connected to a TTY. Like TTY mode itself, it can be turned on or off with the environment variable BC_TTY_MODE (see the ENVIRONMENT VARIABLES section). If history is enabled, previous lines can be recalled and edited with the arrow keys. Note: tabs are converted to 8 spaces. LOCALES This bc(1) ships with support for adding error messages for different locales and thus, supports LC_MESSAGES. SEE ALSO dc(1) STANDARDS bc(1) is compliant with the IEEE Std 1003.1-2017 (“POSIX.1-2017”) specification at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The flags -efghiqsvVw, all long options, and the extensions noted above are extensions to that specification. In addition, the behavior of the quit implements an interpretation of that specification that is different from all known implementations. For more information see the Statements subsection of the SYNTAX section. Note that the specification explicitly says that bc(1) only accepts numbers that use a period (.) as a radix point, regardless of the value of LC_NUMERIC. This bc(1) supports error messages for different locales, and thus, it supports LC_MESSAGES. BUGS Before version 6.1.0, this bc(1) had incorrect behavior for the quit statement. No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc . AUTHORS Gavin D. Howard <gavin@gavinhoward.com> and contributors. Gavin D. Howard February 2023 BC(1)
null
fontrestore
fontrestore detects fonts in /Library/Fonts, /System/Library/Fonts, and ~/Library/Fonts which are not part of the system install and moves them to /Library/Fonts (Removed), /System/Library/Fonts (Removed), and ~/Library/Fonts/Fonts (Removed) directories. Critical fonts required for operation of the user interface are also restored. The [-n] option performs the same operation without touching the disk, describing what would be done without actually doing it. SEE ALSO fontd(8) HISTORY The fontrestore tool first appeared in MacOS X 10.7. Mac OS X 2010-02-03 Mac OS X
fontrestore – Restore the available system fonts to a pristine state, if possible.
fontrestore default [-n]
null
null
mg
mg is intended to be a small, fast, and portable editor for people who can't (or don't want to) run emacs for one reason or another, or are not familiar with the vi(1) editor. It is compatible with emacs because there shouldn't be any reason to learn more editor types than emacs or vi(1). The options are as follows: +number Go to the line specified by number (do not insert a space between the ‘+’ sign and the number). If a negative number is specified, the line number counts backwards from the end of the file i.e. +-1 will be the last line of the file, +-2 will be second last, and so on. -b file Turn on batch mode and execute the mg commands found in the specified file and then terminate. -f mode Run the mode command for all buffers created from arguments on the command line, including the scratch buffer and all files. -n Turn off backup file generation. -R Files specified on the command line will be opened read-only. -u file Use file as the startup file, instead of the default ~/.mg. WINDOWS AND BUFFERS When a file is loaded into mg, it is stored in a buffer. This buffer may be displayed on the screen in more than one window. At present, windows may only be split horizontally, so each window is delineated by a modeline at the bottom. If changes are made to a buffer, it will be reflected in all open windows. If a file is changed outside mg and its buffer is about to be changed, mg prompts if the change should go ahead (y), not go ahead (n) or if the buffer should be reverted (r) to the latest file on disk. If a buffer name begins and ends with an asterisk, the buffer is considered throwaway; i.e. the user will not be prompted to save changes when the buffer is killed. POINT AND MARK The current cursor location in mg is called the point (or dot). It is possible to define a window-specific region of text by setting a second location, called the mark. The region is the text between point and mark inclusive. Deleting the character at the mark position leaves the mark at the point of deletion. Note: The point and mark are window-specific in mg, not buffer-specific, as in other emacs flavours. BACKUP FILES Backup files have a ‘~’ character appended to the file name and are created in the current working directory by default. Whether to create backup files or not can be toggled with the make-backup-files command. The backup file location can either be in the current working directory, or all backups can be moved to a ~/.mg.d directory where files retain their path name to retain uniqueness. Use the backup-to-home-directory command to alternate between these two locations. Further, if any application creates backup files in /tmp, these can be left with the leave-tmpdir-backups command. TAGS mg supports tag files created by ctags(1), allowing the user to quickly locate various object definitions. Note though that emacs uses etags, not ctags. CSCOPE mg supports navigating source code using cscope. However, mg requires cscope and cscope-indexer executables to be present in PATH for it to work. DEFAULT KEY BINDINGS Normal editing commands are very similar to GNU Emacs. In the following examples, C-x means Control-x, and M-x means Meta-x, where the Meta key may be either a special key on the keyboard or the ALT key; otherwise ESC followed by the key X works as well. C-SPC set-mark-command C-a beginning-of-line C-b backward-char C-c s c cscope-find-functions-calling-this-function C-c s d cscope-find-global-definition C-c s e cscope-find-egrep-pattern C-c s f cscope-find-this-file C-c s i cscope-find-files-including-file C-c s n cscope-next-symbol C-c s p cscope-prev-symbol C-c s s cscope-find-this-symbol C-c s t cscope-find-this-text-string C-d delete-char C-e end-of-line C-f forward-char C-g keyboard-quit C-h C-h help-help C-h a apropos C-h b describe-bindings C-h c describe-key-briefly C-j newline-and-indent C-k kill-line C-l recenter RET newline C-n next-line C-o open-line C-p previous-line C-q quoted-insert C-r isearch-backward C-s isearch-forward C-t transpose-chars C-u universal-argument C-v scroll-up C-w kill-region C-x C-b list-buffers C-x C-c save-buffers-kill-emacs C-x C-f find-file C-x C-j dired-jump C-x C-g keyboard-quit C-x C-l downcase-region C-x C-o delete-blank-lines C-x C-q toggle-read-only C-x C-r find-file-read-only C-x C-s save-buffer C-x C-u upcase-region C-x C-v find-alternate-file C-x C-w write-file C-x C-x exchange-point-and-mark C-x ( start-kbd-macro C-x ) end-kbd-macro C-x 0 delete-window C-x 1 delete-other-windows C-x 2 split-window-vertically C-x 4 C-f find-file-other-window C-x 4 C-g keyboard-quit C-x 4 b switch-to-buffer-other-window C-x 4 f find-file-other-window C-x = what-cursor-position C-x ^ enlarge-window C-x ` next-error C-x b switch-to-buffer C-x d dired C-x e call-last-kbd-macro C-x f set-fill-column C-x g goto-line C-x h mark-whole-buffer C-x i insert-file C-x k kill-buffer C-x n other-window C-x o other-window C-x p previous-window C-x s save-some-buffers C-x u undo C-y yank C-z suspend-emacs M-C-v scroll-other-window M-SPC just-one-space M-! shell-command M-. find-tag M-* pop-tag-mark M-% query-replace M-< beginning-of-buffer M-> end-of-buffer M-\ delete-horizontal-space M-^ join-line M-b backward-word M-c capitalize-word M-d kill-word M-f forward-word M-h mark-paragraph M-l downcase-word M-m back-to-indentation M-q fill-paragraph M-r search-backward M-s search-forward M-t transpose-words M-u upcase-word M-v scroll-down M-w copy-region-as-kill M-x execute-extended-command M-z zap-to-char M-{ backward-paragraph M-| shell-command-on-region M-} forward-paragraph M-~ not-modified M-DEL backward-kill-word C-_ undo ) blink-and-insert DEL delete-backward-char For a complete description of mg commands, see MG COMMANDS. To see the active keybindings at any time, type “M-x describe-bindings”. MG COMMANDS Commands are invoked by “M-x”, or by binding to a key. Many commands take an optional numerical parameter, n. This parameter is set either by M-<n> (where n is the numerical argument) before the command, or by one or more invocations of the universal argument, usually bound to C-u. When invoked in this manner, the value of the numeric parameter to be passed is displayed in the minibuffer before the M-x. One common use of the parameter is in mode toggles (e.g. make-backup-files). If no parameter is supplied, the mode is toggled to its alternate state. If a positive parameter is supplied, the mode is forced to on. Otherwise, it is forced to off. apropos Help Apropos. Prompt the user for a string, open the *help* buffer, and list all mg commands that contain that string. audible-bell Toggle the audible system bell. auto-execute Register an auto-execute hook; that is, specify a filename pattern (conforming to the shell's filename globbing rules) and an associated function to execute when a file matching the specified pattern is read into a buffer. auto-fill-mode Toggle auto-fill mode (sometimes called mail-mode) in the current buffer, where text inserted past the fill column is automatically wrapped to a new line. Can be set globally with set-default-mode. auto-indent-mode Toggle indent mode in the current buffer, where indentation is preserved after a newline. Can be set globally with set-default-mode. back-to-indentation Move the dot to the first non-whitespace character on the current line. backup-to-home-directory Save backup copies to a ~/.mg.d directory instead of working directory. Requires make-backup-files to be on. backward-char Move cursor backwards one character. backward-kill-word Kill text backwards by n words. backward-paragraph Move cursor backwards n paragraphs. Paragraphs are delimited by <NL><NL> or <NL><TAB> or <NL><SPACE>. backward-word Move cursor backwards by the specified number of words. beginning-of-buffer Move cursor to the top of the buffer. If set, keep mark's position, otherwise set at current position. A numeric argument n will move n/10th of the way from the top. beginning-of-line Move cursor to the beginning of the line. blink-and-insert Self-insert a character, then search backwards and blink its matching delimiter. For delimiters other than parenthesis, brackets, and braces, the character itself is used as its own match. Can be used in the startup file with the global-set-key command. bsmap-mode Toggle bsmap mode, where DEL and C-h are swapped. c-mode Toggle a KNF-compliant mode for editing C program files. call-last-kbd-macro Invoke the keyboard macro. capitalize-word Capitalize n words; i.e. convert the first character of the word to upper case, and subsequent letters to lower case. cd Change the global working directory. See also global-wd-mode. column-number-mode Toggle whether the column number is displayed in the modeline. copy-region-as-kill Copy all of the characters in the region to the kill buffer, clearing the mark afterwards. This is a bit like a kill-region followed by a yank. count-matches Count the number of lines matching the supplied regular expression. count-non-matches Count the number of lines not matching the supplied regular expression. cscope-find-this-symbol List the matches for the given symbol. cscope-find-global-definition List global definitions for the given literal. cscope-find-called-functions List functions called from the given function. cscope-find-functions-calling-this-function List functions calling the given function. cscope-find-this-text-string List locations matching the given text string. cscope-find-egrep-pattern List locations matching the given extended regular expression pattern. cscope-find-this-file List filenames matching the given filename. cscope-find-files-including-file List files that #include the given filename. cscope-next-symbol Navigate to the next match. cscope-prev-symbol Navigate to the previous match. cscope-next-file Navigate to the next file. cscope-prev-file Navigate to the previous file. cscope-create-list-of-files-to-index Create cscope's List and Index in the given directory. define-key Prompts the user for a named keymap (mode), a key, and an mg command, then creates a keybinding in the appropriate map. delete-backward-char Delete backwards n characters. Like delete-char, this actually does a kill if presented with an argument. delete-blank-lines Delete blank lines around dot. If dot is sitting on a blank line, this command deletes all the blank lines above and below the current line. Otherwise, it deletes all of the blank lines after the current line. delete-char Delete n characters forward. If any argument is present, it kills rather than deletes, saving the result in the kill buffer. delete-horizontal-space Delete any whitespace around the dot. delete-leading-space Delete leading whitespace on the current line. delete-trailing-space Delete trailing whitespace on the current line. delete-matching-lines Delete all lines after dot that contain a string matching the supplied regular expression. delete-non-matching-lines Delete all lines after dot that don't contain a string matching the supplied regular expression. delete-other-windows Make the current window the only window visible on the screen. delete-window Delete current window. describe-bindings List all global and local keybindings, putting the result in the *help* buffer. describe-key-briefly Read a key from the keyboard, and look it up in the keymap. Display the name of the function currently bound to the key. diff-buffer-with-file View the differences between buffer and its associated file. digit-argument Process a numerical argument for keyboard-invoked functions. dired-jump Open a dired buffer containing the current buffer's directory location. downcase-region Set all characters in the region to lower case. downcase-word Set characters to lower case, starting at the dot, and ending n words away. emacs-version Return an mg version string. end-kbd-macro Stop defining a keyboard macro. end-of-buffer Move cursor to the end of the buffer. If set, keep mark's position, otherwise set at current position. A numeric argument n will move n/10th of the way from the end. end-of-line Move cursor to the end of the line. enlarge-window Enlarge the current window by shrinking either the window above or below it. eval-current-buffer Evaluate the current buffer as a series of mg commands. Useful for testing mg startup files. eval-expression Get one line from the user, and run it. Useful for testing expressions in mg startup files. exchange-point-and-mark Swap the values of "dot" and "mark" in the current window. Return an error if no mark is set. execute-extended-command Invoke an extended command; i.e. M-x. Call the message line routine to read in the command name and apply autocompletion to it. When it comes back, look the name up in the symbol table and run the command if it is found, passing arguments as necessary. Print an error if there is anything wrong. fill-paragraph Justify a paragraph, wrapping text at the current fill column. find-file Select a file for editing. First check if the file can be found in another buffer; if it is there, just switch to that buffer. If the file cannot be found, create a new buffer, read in the file from disk, and switch to the new buffer. find-file-read-only Same as find-file, except the new buffer is set to read-only. find-alternate-file Replace the current file with an alternate one. Semantics for finding the replacement file are the same as find-file, except the current buffer is killed before the switch. If the kill fails, or is aborted, revert to the original file. find-file-other-window Opens the specified file in a second buffer. Splits the current window if necessary. find-tag Jump to definition of tag at dot. forward-char Move cursor forwards (or backwards, if n is negative) n characters. Returns an error if the end of buffer is reached. forward-paragraph Move forward n paragraphs. Paragraphs are delimited by <NL><NL> or <NL><TAB> or <NL><SPACE>. forward-word Move the cursor forward by the specified number of words. global-set-key Bind a key in the global (fundamental) key map. global-unset-key Unbind a key from the global (fundamental) key map; i.e. set it to 'rescan'. global-wd-mode Toggle global working-directory mode. When enabled, mg defaults to opening files (and executing commands like compile and grep) relative to the global working directory. When disabled, a working directory is set for each buffer. goto-line Go to a specific line. If an argument is present, then it is the line number, else prompt for a line number to use. help-help Prompts for one of (a)propos, (b)indings, des(c)ribe key briefly. insert Insert a string, mainly for use from macros. insert-buffer Insert the contents of another buffer at dot. insert-file Insert a file into the current buffer at dot. insert-with-wrap Insert the bound character with word wrap. Check to see if we're past the fill column, and if so, justify this line. isearch-backward Use incremental searching, initially in the reverse direction. isearch ignores any explicit arguments. If invoked during macro definition or evaluation, the non-incremental search-backward is invoked instead. isearch-forward Use incremental searching, initially in the forward direction. isearch ignores any explicit arguments. If invoked during macro definition or evaluation, the non-incremental search-forward is invoked instead. join-line Join the current line to the previous. If called with an argument, join the next line to the current one. just-one-space Delete any whitespace around dot, then insert a space. keyboard-quit Abort the current action. kill-buffer Dispose of a buffer, by name. If the buffer name does not start and end with an asterisk, prompt the user if the buffer has been changed. kill-line Kill line. If called without an argument, it kills from dot to the end of the line, unless it is at the end of the line, when it kills the newline. If called with an argument of 0, it kills from the start of the line to dot. If called with a positive argument, it kills from dot forward over that number of newlines. If called with a negative argument it kills any text before dot on the current line, then it kills back abs(n) lines. kill-paragraph Delete n paragraphs starting with the current one. kill-region Kill the currently defined region. kill-word Delete forward n words. leave-tmpdir-backups Modifies the behaviour of backup-to-home-directory. Backup files that would normally reside in /tmp are left there and not moved to the ~/.mg.d directory. line-number-mode Toggle whether the line number is displayed in the modeline. list-buffers Display the list of available buffers. The first column in the output indicates which buffer is active with a '>' character. The second column indicates which buffers are modified. The third column indicates which buffers are read-only. The remaining columns are self-explanatory. load Prompt the user for a filename, and then execute commands from that file. local-set-key Bind a key mapping in the local (topmost) mode. local-unset-key Unbind a key mapping in the local (topmost) mode. make-backup-files Toggle generation of backup files. Enabled by default. make-directory Prompt the user for a path or directory name which is then created. mark-paragraph Mark n paragraphs. mark-whole-buffer Marks whole buffer as a region by putting dot at the beginning and mark at the end of buffer. meta-key-mode When disabled, the meta key can be used to insert extended-ascii (8-bit) characters. When enabled, the meta key acts as usual. negative-argument Process a negative argument for keyboard-invoked functions. newline Insert a newline into the current buffer. newline-and-indent Insert a newline, then enough tabs and spaces to duplicate the indentation of the previous line, respecting no-tab-mode and the buffer tab width. next-line Move forward n lines. no-tab-mode Toggle notab mode. In this mode, spaces are inserted rather than tabs. not-modified Turn off the modified flag in the current buffer. open-line Open up some blank space. Essentially, insert n newlines, then back up over them. other-window The command to make the next (down the screen) window the current window. There are no real errors, although the command does nothing if there is only 1 window on the screen. overwrite-mode Toggle overwrite mode in the current buffer, where typing overwrites existing characters rather than inserting them. Can be set globally with set-default-mode. prefix-region Inserts a prefix string before each line of a region. The prefix string is settable by using set-prefix-string or by invoking this command with a prefix argument. previous-line Move backwards n lines. previous-window This command makes the previous (up the screen) window the current window. There are no errors, although the command does not do a lot if there is only 1 window. pop-tag-mark Return to position where find-tag was previously invoked. push-shell Suspend mg and switch to alternate screen, if available. pwd Display current (global) working directory in the status area. query-replace Query Replace. Search and replace strings selectively, prompting after each match. replace-regexp Replace regular expression globally without individual prompting. replace-string Replace string globally without individual prompting. query-replace-regexp Replace strings selectively. Does a search and replace operation using regular expressions for both patterns. quoted-insert Insert the next character verbatim into the current buffer; i.e. ignore any function bound to that key. re-search-again Perform a regular expression search again, using the same search string and direction as the last search command. re-search-backward Search backwards using a regular expression. Get a search string from the user, and search, starting at dot and proceeding toward the front of the buffer. If found, dot is left pointing at the first character of the pattern [the last character that was matched]. re-search-forward Search forward using a regular expression. Get a search string from the user and search for it starting at dot. If found, move dot to just after the matched characters. display does all the hard stuff. If not found, it just prints a message. recenter Reposition dot in the current window. By default, the dot is centered. If given a positive argument (n), the display is repositioned to line n. If n is negative, it is that line from the bottom. redraw-display Refresh the display. Recomputes all window sizes in case something has changed. revert-buffer Revert the current buffer to the latest file on disk. save-buffer Save the contents of the current buffer if it has been changed, optionally creating a backup copy. save-buffers-kill-emacs Offer to save modified buffers and quit mg. save-some-buffers Look through the list of buffers, offering to save any buffer that has been changed. Buffers that are not associated with files (such as *scratch*, *grep*, *compile*) are ignored. scroll-down Scroll backwards n pages. A two-line overlap between pages is assumed. If given a repeat argument, scrolls back lines, not pages. scroll-one-line-down Scroll the display down n lines without changing the cursor position. scroll-one-line-up Scroll the display n lines up without moving the cursor position. scroll-other-window Scroll the next window in the window list window forward n pages. scroll-up Scroll forward one page. A two-line overlap between pages is assumed. If given a repeat argument, scrolls back lines, not pages. search-again Search again, using the same search string and direction as the last search command. search-backward Reverse search. Get a search string from the user, and search, starting at dot and proceeding toward the front of the buffer. If found, dot is left pointing at the first character of the pattern (the last character that was matched). search-forward Search forward. Get a search string from the user, and search for it starting at dot. If found, dot gets moved to just after the matched characters, if not found, print a message. self-insert-command Insert a character. sentence-end-double-space Toggle double or single spaces for end of sentences. Double is the default. Currently only affects fill-paragraph. set-case-fold-search Set case-fold searching, causing case not to matter in regular expression searches. This is the default. set-case-replace Preserve the case of the replaced string. This is the default. set-default-mode Append the supplied mode to the list of default modes used by subsequent buffer creation. Built in modes include: fill, indent and overwrite. set-fill-column Prompt the user for a fill column. Used by auto-fill-mode. set-mark-command Sets the mark in the current window to the current dot location. set-prefix-string Sets the prefix string to be used by the prefix-region command. set-tab-width Set the tab width for the current buffer, or the default for new buffers if called with a prefix argument or from the startup file. shell-command Execute external command from mini-buffer. shell-command-on-region Provide the text in region to the shell command as input. shrink-window Shrink current window by one line. The window immediately below is expanded to pick up the slack. If only one window is present, this command has no effect. split-window-vertically Split the current window. A window smaller than 3 lines cannot be split. start-kbd-macro Start defining a keyboard macro. Macro definition is ended by invoking end-kbd-macro. suspend-emacs Suspend mg and switch back to alternate screen, if in use. switch-to-buffer Prompt and switch to a new buffer in the current window. switch-to-buffer-other-window Switch to buffer in another window. toggle-read-only Toggle the read-only flag on the current buffer. toggle-read-only-all Toggle the read-only flag on all non-ephemeral buffers. A simple toggle that switches a global read-only flag either on or off. transpose-chars Transpose the two characters in front of and under dot, then move forward one character. Treat newline characters the same as any other. transpose-paragraphs Transpose adjacent paragraphs. If multiple iterations are requested, the current paragraph will be moved n paragraphs forward. transpose-words Transpose adjacent words. undo Undo the most recent action. If invoked again without an intervening command, move the undo pointer to the previous action and undo it. undo-boundary Add an undo boundary. This is not usually done interactively. undo-boundary-toggle Toggle whether undo boundaries are generated. Undo boundaries are often disabled before operations that should be considered atomically undoable. undo-enable Toggle whether undo information is kept. undo-list Show the undo records for the current buffer in a new buffer. universal-argument Repeat the next command 4 times. Usually bound to C-u. This command may be stacked; e.g. C-u C-u C-f moves the cursor forward 16 characters. upcase-region Upper case region. Change all of the lower case characters in the region to upper case. upcase-word Move the cursor forward by the specified number of words. As it moves, convert any characters to upper case. visible-bell Toggle the visible bell. If this toggle is on, the modeline will flash. visit-tags-table Load tags file to be used for subsequent find-tag. what-cursor-position Display a bunch of useful information about the current location of dot. The character under the cursor (in octal), the current line, row, and column, and approximate position of the cursor in the file (as a percentage) is displayed. The column position assumes an infinite position display; it does not truncate just because the screen does. write-file Ask for a file name and write the contents of the current buffer to that file. Update the remembered file name and clear the buffer changed flag. yank Yank text from kill-buffer. Unlike emacs, the mg kill buffer consists only of the most recent kill. It is not a ring. zap-to-char Ask for a character and delete text from the current cursor position until the next instance of that character, including it. zap-up-to-char Like zap-to-char but doesn't delete the target character. MG DIRED KEY BINDINGS Specific key bindings are available in dired mode. DEL dired-unmark-backward RET, e, f and C-m dired-find-file SPC, n dired-next-line ! dired-shell-command + dired-create-directory a dired-find-alternate-file c dired-do-copy d and C-d dired-flag-file-deletion g dired-revert j dired-goto-file o dired-find-file-other-window p dired-previous-line q quit-window r dired-do-rename u dired-unmark x dired-do-flagged-delete C-v dired-scroll-down M-v dired-scroll-up MG DIRED COMMANDS The following are a list of the commands specific to dired mode: dired-create-directory Create a directory. dired-do-copy Copy the file listed on the current line of the dired buffer. dired-do-flagged-delete Delete the files that have been flagged for deletion. dired-do-rename Rename the file listed on the current line of the dired buffer. dired-find-alternate-file Replace the current dired buffer with an alternate one as specified by the position of the cursor in the dired buffer. dired-find-file Open the file on the current line of the dired buffer. If the cursor is on a directory, it will be opened in dired mode. dired-flag-file-deletion Flag the file listed on the current line for deletion. This is indicated in the buffer by putting a D at the left margin. No files are actually deleted until the function dired-do-flagged-delete is executed. dired-find-file-other-window Open the file on the current line of the dired buffer in a different window. dired-goto-file Move the cursor to a file name in the dired buffer. dired-next-line Move the cursor to the next line. dired-other-window This function works just like dired, except that it puts the dired buffer in another window. dired-previous-line Move the cursor to the previous line. dired-revert Refresh the dired buffer while retaining any flags. dired-scroll-down Scroll down the dired buffer. dired-scroll-up Scroll up the dired buffer. dired-shell-command Pipe the file under the current cursor position through a shell command. dired-unmark Remove the deletion flag for the file on the current line. dired-unmark-backward Remove the deletion flag from the file listed on the previous line of the dired buffer, then move up to that line. quit-window Close the current dired buffer. CONFIGURATION FILES There are two configuration files, .mg and .mg-TERM. Here, TERM represents the name of the terminal type; e.g. if the terminal type is set to “vt100”, mg will use .mg-vt100 as a startup file. The terminal type startup file is used first. The startup file format is a list of commands, one per line, as used for interactive evaluation. Strings that are normally entered by the user at any subsequent prompts may be specified after the command name; e.g.: global-set-key ")" self-insert-command global-set-key "\^x\^f" find-file global-set-key "\e[Z" backward-char set-default-mode fill set-fill-column 72 auto-execute *.c c-mode Comments can be added to the startup files by placing ‘;’ or ‘#’ as the first character of a line. FILES ~/.mg normal startup file ~/.mg-TERM terminal-specific startup file ~/.mg.d alternative backup file location /usr/share/doc/mg/tutorial concise tutorial SEE ALSO ctags(1), vi(1) CAVEATS Since it is written completely in C, there is currently no language in which extensions can be written; however, keys can be rebound and certain parameters can be changed in startup files. In order to use 8-bit characters (such as German umlauts), the Meta key needs to be disabled via the meta-key-mode command. Multi-byte character sets, such as UTF-8, are not supported. macOS 14.5 April 28, 2023 macOS 14.5
mg – emacs-like text editor
mg [-nR] [-b file] [-f mode] [-u file] [+number] [file ...]
null
null
sfltool
sfltool a tool for testing and debugging SharedFileList. sfltool archive [-z] creates a directory containing a snapshot of the content of the SharedFileList persistant store locations. Adding -z will archive the a directory. FILES /usr/bin/sfltool executable Darwin 8/9/12 Darwin
sfltool – tool for testing and debugging SharedFileList.
sfltool [archive [-z]]
null
null
less
Less is a program similar to more(1), but which allows backward movement in the file as well as forward movement. Also, less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi(1). Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with a caret.) Commands are based on both more and vi. Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated. COMMANDS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the two character sequence "ESCAPE", then "v". h or H Help: display a summary of these commands. If you forget all the other commands, remember this one. SPACE or ^V or f or ^F Scroll forward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. Warning: some systems use ^V as a special literalization character. z Like SPACE, but if N is specified, it becomes the new window size. ESC-SPACE Like SPACE, but scrolls a full screenful, even if it reaches end-of-file in the process. ENTER or RETURN or ^N or e or ^E or j or ^J Scroll forward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. d or ^D Scroll forward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. b or ^B or ESC-v Scroll backward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. w Like ESC-v, but if N is specified, it becomes the new window size. y or ^Y or ^P or k or ^K Scroll backward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. Warning: some systems use ^Y as a special job control character. u or ^U Scroll backward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. J Like j, but continues to scroll beyond the end of the file. K or Y Like k, but continues to scroll beyond the beginning of the file. ESC-) or RIGHTARROW Scroll horizontally right N characters, default half the screen width (see the -# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. While the text is scrolled, it acts as though the -S option (chop lines) were in effect. ESC-( or LEFTARROW Scroll horizontally left N characters, default half the screen width (see the -# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. ESC-} or ^RIGHTARROW Scroll horizontally right to show the end of the longest displayed line. ESC-{ or ^LEFTARROW Scroll horizontally left back to the first column. r or ^R or ^L Repaint the screen. R Repaint the screen, discarding any buffered input. That is, reload the current file. Useful if the file is changing while it is being viewed. F Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the end of the file. It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail -f" command.) To stop waiting for more data, enter the interrupt character (usually ^C). On some systems you can also use ^X. ESC-F Like F, but as soon as a line is found which matches the last search pattern, the terminal bell is rung and forward scrolling stops. g or < or ESC-< Go to line N in the file, default 1 (beginning of file). (Warning: this may be slow if N is large.) G or > or ESC-> Go to line N in the file, default the end of the file. (Warning: this may be slow if N is large, or if N is not specified and standard input, rather than a file, is being read.) ESC-G Same as G, except if no number N is specified and the input is standard input, goes to the last line which is currently buffered. p or % Go to a position N percent into the file. N should be between 0 and 100, and may contain a decimal point. P Go to the line containing byte offset N in the file. { If a left curly bracket appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. } If a right curly bracket appears in the bottom line displayed on the screen, the } command will go to the matching left curly bracket. The matching left curly bracket is positioned on the top line of the screen. If there is more than one right curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. ( Like {, but applies to parentheses rather than curly brackets. ) Like }, but applies to parentheses rather than curly brackets. [ Like {, but applies to square brackets rather than curly brackets. ] Like }, but applies to square brackets rather than curly brackets. ESC-^F Followed by two characters, acts like {, but uses the two characters as open and close brackets, respectively. For example, "ESC ^F < >" could be used to go forward to the > which matches the < in the top displayed line. ESC-^B Followed by two characters, acts like }, but uses the two characters as open and close brackets, respectively. For example, "ESC ^B < >" could be used to go backward to the < which matches the > in the bottom displayed line. m Followed by any lowercase or uppercase letter, marks the first displayed line with that letter. If the status column is enabled via the -J option, the status column shows the marked line. M Acts like m, except the last displayed line is marked rather than the first displayed line. ' (Single quote.) Followed by any lowercase or uppercase letter, returns to the position which was previously marked with that letter. Followed by another single quote, returns to the position at which the last "large" movement command was executed. Followed by a ^ or $, jumps to the beginning or end of the file respectively. Marks are preserved when a new file is examined, so the ' command can be used to switch between input files. ^X^X Same as single quote. ESC-m Followed by any lowercase or uppercase letter, clears the mark identified by that letter. /pattern Search forward in the file for the N-th line containing the pattern. N defaults to 1. The pattern is a regular expression, as recognized by the regular expression library supplied by your system. The search starts at the first line displayed (but see the -a and -j options, which change this). Certain characters are special if entered at the beginning of the pattern; they modify the type of search rather than become part of the pattern: ^N or ! Search for lines which do NOT match the pattern. ^E or * Search multiple files. That is, if the search reaches the END of the current file without finding a match, the search continues in the next file in the command line list. ^F or @ Begin the search at the first line of the FIRST file in the command line list, regardless of what is currently displayed on the screen or the settings of the -a or -j options. ^K Highlight any text which matches the pattern on the current screen, but don't move to the first match (KEEP current position). ^R Don't interpret regular expression metacharacters; that is, do a simple textual comparison. ^W WRAP around the current file. That is, if the search reaches the end of the current file without finding a match, the search continues from the first line of the current file up to the line where it started. ?pattern Search backward in the file for the N-th line containing the pattern. The search starts at the last line displayed (but see the -a and -j options, which change this). Certain characters are special as in the / command: ^N or ! Search for lines which do NOT match the pattern. ^E or * Search multiple files. That is, if the search reaches the beginning of the current file without finding a match, the search continues in the previous file in the command line list. ^F or @ Begin the search at the last line of the last file in the command line list, regardless of what is currently displayed on the screen or the settings of the -a or -j options. ^K As in forward searches. ^R As in forward searches. ^W WRAP around the current file. That is, if the search reaches the beginning of the current file without finding a match, the search continues from the last line of the current file up to the line where it started. ESC-/pattern Same as "/*". ESC-?pattern Same as "?*". n Repeat previous search, for N-th line containing the last pattern. If the previous search was modified by ^N, the search is made for the N-th line NOT containing the pattern. If the previous search was modified by ^E, the search continues in the next (or previous) file if not satisfied in the current file. If the previous search was modified by ^R, the search is done without using regular expressions. There is no effect if the previous search was modified by ^F or ^K. N Repeat previous search, but in the reverse direction. ESC-n Repeat previous search, but crossing file boundaries. The effect is as if the previous search were modified by *. ESC-N Repeat previous search, but in the reverse direction and crossing file boundaries. ESC-u Undo search highlighting. Turn off highlighting of strings matching the current search pattern. If highlighting is already off because of a previous ESC-u command, turn highlighting back on. Any search command will also turn highlighting back on. (Highlighting can also be disabled by toggling the -G option; in that case search commands do not turn highlighting back on.) ESC-U Like ESC-u but also clears the saved search pattern. If the status column is enabled via the -J option, this clears all search matches marked in the status column. &pattern Display only lines which match the pattern; lines which do not match the pattern are not displayed. If pattern is empty (if you type & immediately followed by ENTER), any filtering is turned off, and all lines are displayed. While filtering is in effect, an ampersand is displayed at the beginning of the prompt, as a reminder that some lines in the file may be hidden. Multiple & commands may be entered, in which case only lines which match all of the patterns will be displayed. Certain characters are special as in the / command: ^N or ! Display only lines which do NOT match the pattern. ^R Don't interpret regular expression metacharacters; that is, do a simple textual comparison. :e [filename] Examine a new file. If the filename is missing, the "current" file (see the :n and :p commands below) from the list of files in the command line is re-examined. A percent sign (%) in the filename is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. However, two consecutive percent signs are simply replaced with a single percent sign. This allows you to enter a filename that contains a percent sign in the name. Similarly, two consecutive pound signs are replaced with a single pound sign. The filename is inserted into the command line list of files so that it can be seen by subsequent :n and :p commands. If the filename consists of several files, they are all inserted into the list of files and the first one is examined. If the filename contains one or more spaces, the entire filename should be enclosed in double quotes (also see the -" option). ^X^V or E Same as :e. Warning: some systems use ^V as a special literalization character. On such systems, you may not be able to use ^V. :n Examine the next file (from the list of files given in the command line). If a number N is specified, the N-th next file is examined. :p Examine the previous file in the command line list. If a number N is specified, the N-th previous file is examined. :x Examine the first file in the command line list. If a number N is specified, the N-th file in the list is examined. :d Remove the current file from the list of files. t Go to the next tag, if there were more than one matches for the current tag. See the -t option for more details about tags. T Go to the previous tag, if there were more than one matches for the current tag. = or ^G or :f Prints some information about the file being viewed, including its name and the line number and byte offset of the bottom line being displayed. If possible, it also prints the length of the file, the number of lines in the file and the percent of the file above the last displayed line. - Followed by one of the command line option letters (see OPTIONS below), this will change the setting of that option and print a message describing the new setting. If a ^P (CONTROL-P) is entered immediately after the dash, the setting of the option is changed but no message is printed. If the option letter has a numeric value (such as -b or -h), or a string value (such as -P or -t), a new value may be entered after the option letter. If no new value is entered, a message describing the current setting is printed and nothing is changed. -- Like the - command, but takes a long option name (see OPTIONS below) rather than a single option letter. You must press ENTER or RETURN after typing the option name. A ^P immediately after the second dash suppresses printing of a message describing the new setting, as in the - command. -+ Followed by one of the command line option letters this will reset the option to its default setting and print a message describing the new setting. (The "-+X" command does the same thing as "-+X" on the command line.) This does not work for string-valued options. --+ Like the -+ command, but takes a long option name rather than a single option letter. -! Followed by one of the command line option letters, this will reset the option to the "opposite" of its default setting and print a message describing the new setting. This does not work for numeric or string-valued options. --! Like the -! command, but takes a long option name rather than a single option letter. _ (Underscore.) Followed by one of the command line option letters, this will print a message describing the current setting of that option. The setting of the option is not changed. __ (Double underscore.) Like the _ (underscore) command, but takes a long option name rather than a single option letter. You must press ENTER or RETURN after typing the option name. +cmd Causes the specified cmd to be executed each time a new file is examined. For example, +G causes less to initially display each file starting at the end rather than the beginning. V Prints the version number of less being run. q or Q or :q or :Q or ZZ Exits less. The following four commands may or may not be valid, depending on your particular installation. v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined. See also the discussion of LESSEDIT under the section on PROMPTS below. ! shell-command Invokes a shell to run the shell-command given. A percent sign (%) in the command is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. "!!" repeats the last shell command. "!" with no shell command simply invokes a shell. On Unix systems, the shell is taken from the environment variable SHELL, or defaults to "sh". On MS-DOS and OS/2 systems, the shell is the normal command processor. | <m> shell-command <m> represents any mark letter. Pipes a section of the input file to the given shell command. The section of the file to be piped is between the position marked by the letter and the current screen. The entire current screen is included, regardless of whether the marked position is before or after the current screen. <m> may also be ^ or $ to indicate beginning or end of file respectively. If <m> is . or newline, the current screen is piped. s filename Save the input to a file. This only works if the input is a pipe, not an ordinary file.
less - opposite of more
less -? less --help less -V less --version less [-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~] [-b space] [-h lines] [-j line] [-k keyfile] [-{oO} logfile] [-p pattern] [-P prompt] [-t tag] [-T tagsfile] [-x tab,...] [-y lines] [-[z] lines] [-# shift] [+[+]cmd] [--] [filename]... (See the OPTIONS section for alternate option syntax with long option names.)
Command line options are described below. Most options may be changed while less is running, via the "-" command. Most options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. A long option name may be abbreviated as long as the abbreviation is unambiguous. For example, --quit-at-eof may be abbreviated --quit, but not --qui, since both --quit-at-eof and --quiet begin with --qui. Some long option names are in uppercase, such as --QUIT-AT-EOF, as distinct from --quit-at-eof. Such option names need only have their first letter capitalized; the remainder of the name may be in either case. For example, --Quit-at-eof is equivalent to --QUIT-AT-EOF. Options are also taken from the environment variable "LESS". For example, to avoid typing "less -options ..." each time less is invoked, you might tell csh: setenv LESS "-options" or if you use sh: LESS="-options"; export LESS On MS-DOS, you don't need the quotes, but you should replace any percent signs in the options string by double percent signs. The environment variable is parsed before the command line, so command line options override the LESS environment variable. If an option appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". Some options like -k or -D require a string to follow the option letter. The string for that option is considered to end when a dollar sign ($) is found. For example, you can set two -D options on MS-DOS like this: LESS="Dn9.1$Ds4.1" If the --use-backslash option appears earlier in the options, then a dollar sign or backslash may be included literally in an option string by preceding it with a backslash. If the --use-backslash option is not in effect, then backslashes are not treated specially, and there is no way to include a dollar sign in the option string. -? or --help This option displays a summary of the commands accepted by less (the same as the h command). (Depending on how your shell interprets the question mark, it may be necessary to quote the question mark, thus: "-\?".) -a or --search-skip-screen By default, forward searches start at the top of the displayed screen and backwards searches start at the bottom of the displayed screen (except for repeated searches invoked by the n or N commands, which start after or before the "target" line respectively; see the -j option for more about the target line). The -a option causes forward searches to instead start at the bottom of the screen and backward searches to start at the top of the screen, thus skipping all lines displayed on the screen. -A or --SEARCH-SKIP-SCREEN Causes all forward searches (not just non-repeated searches) to start just after the target line, and all backward searches to start just before the target line. Thus, forward searches will skip part of the displayed screen (from the first line up to and including the target line). Similarly backwards searches will skip the displayed screen from the last line up to and including the target line. This was the default behavior in less versions prior to 441. -bn or --buffers=n Specifies the amount of buffer space less will use for each file, in units of kilobytes (1024 bytes). By default 64 KB of buffer space is used for each file (unless the file is a pipe; see the -B option). The -b option specifies instead that n kilobytes of buffer space should be used for each file. If n is -1, buffer space is unlimited; that is, the entire file can be read into memory. -B or --auto-buffers By default, when data is read from a pipe, buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allocated. The -B option disables this automatic allocation of buffers for pipes, so that only 64 KB (or the amount of space specified by the -b option) is used for the pipe. Warning: use of -B can result in erroneous display, since only the most recently viewed part of the piped data is kept in memory; any earlier data is lost. -c or --clear-screen Causes full screen repaints to be painted from the top line down. By default, full screen repaints are done by scrolling from the bottom of the screen. -C or --CLEAR-SCREEN Same as -c, for compatibility with older versions of less. -d or --dumb The -d option suppresses the error message normally displayed if the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The -d option does not otherwise change the behavior of less on a dumb terminal. -Dxcolor or --color=xcolor Changes the color of different parts of the displayed text. x is a single character which selects the type of text whose color is being set: B Binary characters. C Control characters. E Errors and informational messages. M Mark letters in the status column. N Line numbers enabled via the -N option. P Prompts. R The rscroll character. S Search results. W The highlight enabled via the -w option. d Bold text. k Blinking text. s Standout text. u Underlined text. The uppercase letters can be used only when the --use-color option is enabled. When text color is specified by both an uppercase letter and a lowercase letter, the uppercase letter takes precedence. For example, error messages are normally displayed as standout text. So if both "s" and "E" are given a color, the "E" color applies to error messages, and the "s" color applies to other standout text. The "d" and "u" letters refer to bold and underline text formed by overstriking with backspaces (see the -u option), not to text using ANSI escape sequences with the -R option. A lowercase letter may be followed by a + to indicate that both the normal format change and the specified color should both be used. For example, -Dug displays underlined text as green without underlining; the green color has replaced the usual underline formatting. But -Du+g displays underlined text as both green and in underlined format. color is either a 4-bit color string or an 8-bit color string: A 4-bit color string is zero, one or two characters, where the first character specifies the foreground color and the second specifies the background color as follows: b Blue c Cyan g Green k Black m Magenta r Red w White y Yellow The corresponding upper-case letter denotes a brighter shade of the color. For example, -DNGk displays line numbers as bright green text on a black background, and -DEbR displays error messages as blue text on a bright red background. If either character is a "-" or is omitted, the corresponding color is set to that of normal text. An 8-bit color string is one or two decimal integers separated by a dot, where the first integer specifies the foreground color and the second specifies the background color. Each integer is a value between 0 and 255 inclusive which selects a "CSI 38;5" color value (see https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) If either integer is a "-" or is omitted, the corresponding color is set to that of normal text. On MS-DOS versions of less, 8-bit color is not supported; instead, decimal values are interpreted as 4-bit CHAR_INFO.Attributes values (see https://docs.microsoft.com/en-us/windows/console/char-info-str). -e or --quit-at-eof Causes less to automatically exit the second time it reaches end-of-file. By default, the only way to exit less is via the "q" command. -E or --QUIT-AT-EOF Causes less to automatically exit the first time it reaches end- of-file. -f or --force Forces non-regular files to be opened. (A non-regular file is a directory or a device special file.) Also suppresses the warning message when a binary file is opened. By default, less will refuse to open non-regular files. Note that some operating systems will not allow directories to be read, even if -f is set. -F or --quit-if-one-screen Causes less to automatically exit if the entire file can be displayed on the first screen. -g or --hilite-search Normally, less will highlight ALL strings which match the last search command. The -g option changes this behavior to highlight only the particular string which was found by the last search command. This can cause less to run somewhat faster than the default. -G or --HILITE-SEARCH The -G option suppresses all highlighting of strings found by search commands. -hn or --max-back-scroll=n Specifies a maximum number of lines to scroll backward. If it is necessary to scroll backward more than n lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, -h0 is implied.) -i or --ignore-case Causes searches to ignore case; that is, uppercase and lowercase are considered identical. This option is ignored if any uppercase letters appear in the search pattern; in other words, if a pattern contains uppercase letters, then that search does not ignore case. -I or --IGNORE-CASE Like -i, but searches ignore case even if the pattern contains uppercase letters. -jn or --jump-target=n Specifies a line on the screen where the "target" line is to be positioned. The target line is the line specified by any command to search for a pattern, jump to a line number, jump to a file percentage or jump to a tag. The screen line may be specified by a number: the top line on the screen is 1, the next is 2, and so on. The number may be negative to specify a line relative to the bottom of the screen: the bottom line on the screen is -1, the second to the bottom is -2, and so on. Alternately, the screen line may be specified as a fraction of the height of the screen, starting with a decimal point: .5 is in the middle of the screen, .3 is three tenths down from the first line, and so on. If the line is specified as a fraction, the actual line number is recalculated if the terminal window is resized, so that the target line remains at the specified fraction of the screen height. If any form of the -j option is used, repeated forward searches (invoked with "n" or "N") begin at the line immediately after the target line, and repeated backward searches begin at the target line, unless changed by -a or -A. For example, if "-j4" is used, the target line is the fourth line on the screen, so forward searches begin at the fifth line on the screen. However nonrepeated searches (invoked with "/" or "?") always begin at the start or end of the current screen respectively. -J or --status-column Displays a status column at the left edge of the screen. The status column shows the lines that matched the current search, and any lines that are marked (via the m or M command). -kfilename or --lesskey-file=filename Causes less to open and interpret the named file as a lesskey(1) file. Multiple -k options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a lesskey file. -K or --quit-on-intr Causes less to exit immediately (with status 2) when an interrupt character (usually ^C) is typed. Normally, an interrupt character causes less to stop whatever it is doing and return to its command prompt. Note that use of this option makes it impossible to return to the command prompt from the "F" command. -L or --no-lessopen Ignore the LESSOPEN environment variable (see the INPUT PREPROCESSOR section below). This option can be set from within less, but it will apply only to files opened subsequently, not to the file which is currently open. -m or --long-prompt Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon. -M or --LONG-PROMPT Causes less to prompt even more verbosely than more. -n or --line-numbers Suppresses line numbers. The default (to use line numbers) may cause less to run more slowly in some cases, especially with a very large input file. Suppressing line numbers with the -n option will avoid this problem. Using line numbers means: the line number will be displayed in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also the discussion of LESSEDIT in PROMPTS below). -N or --LINE-NUMBERS Causes a line number to be displayed at the beginning of each line in the display. -ofilename or --log-file=filename Causes less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an ordinary file. If the file already exists, less will ask for confirmation before overwriting it. -Ofilename or --LOG-FILE=filename The -O option is like -o, but it will overwrite an existing file without asking for confirmation. If no log file has been specified, the -o and -O options can be used from within less to specify a log file. Without a file name, they will simply report the name of the log file. The "s" command is equivalent to specifying -o from within less. -ppattern or --pattern=pattern The -p option on the command line is equivalent to specifying +/pattern; that is, it tells less to start at the first occurrence of pattern in the file. -Pprompt or --prompt=prompt Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS environment variable, rather than being typed in with each less command. Such an option must either be the last option in the LESS variable, or be terminated by a dollar sign. -Ps followed by a string changes the default (short) prompt to that string. -Pm changes the medium (-m) prompt. -PM changes the long (-M) prompt. -Ph changes the prompt for the help screen. -P= changes the message printed by the = command. -Pw changes the message printed while waiting for data (in the F command). All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. -q or --quiet or --silent Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual bell", it is used instead. The bell will be rung on certain other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases. -Q or --QUIET or --SILENT Causes totally "quiet" operation: the terminal bell is never rung. If the terminal has a "visual bell", it is used in all cases where the terminal bell would have been rung. -r or --raw-control-chars Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "^A". Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display problems may result, such as long lines being split in the wrong place. USE OF THE -r OPTION IS NOT RECOMMENDED. -R or --RAW-CONTROL-CHARS Like -r, but only ANSI "color" escape sequences and OSC 8 hyperlink sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly, provided that there are no escape sequences in the file other than these types of escape sequences. Color escape sequences are only supported when the color is changed within one line, not across lines. In other words, the beginning of each line is assumed to be normal (non-colored), regardless of any escape sequences in previous lines. For the purpose of keeping track of screen appearance, these escape sequences are assumed to not move the cursor. OSC 8 hyperlinks are sequences of the form: ESC ] 8 ; ... \7 The terminating sequence may be either a BEL character (\7) or the two-character sequence "ESC \". ANSI color escape sequences are sequences of the form: ESC [ ... m where the "..." is zero or more color specification characters. You can make less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. -s or --squeeze-blank-lines Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing nroff output. -S or --chop-long-lines Causes lines longer than the screen width to be chopped (truncated) rather than wrapped. That is, the portion of a long line that does not fit in the screen width is not displayed until you press RIGHT-ARROW. The default is to wrap long lines; that is, display the remainder on the next line. -ttag or --tag=tag The -t option, followed immediately by a TAG, will edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by ctags(1) or an equivalent command. If the environment variable LESSGLOBALTAGS is set, it is taken to be the name of a command compatible with global(1), and that command is executed to find the tag. (See http://www.gnu.org/software/global/global.html). The -t option may also be specified from within less (using the - command) as a way of examining a new file. The command ":t" is equivalent to specifying -t from within less. -Ttagsfile or --tag-file=tagsfile Specifies a tags file to be used instead of "tags". -u or --underline-special Causes backspaces and carriage returns to be treated as printable characters; that is, they are sent to the terminal when they appear in the input. -U or --UNDERLINE-SPECIAL Causes backspaces, tabs, carriage returns and "formatting characters" (as defined by Unicode) to be treated as control characters; that is, they are handled as specified by the -r option. By default, if neither -u nor -U is given, backspaces which appear adjacent to an underscore character are treated specially: the underlined text is displayed using the terminal's hardware underlining capability. Also, backspaces which appear between two identical characters are treated specially: the overstruck text is printed using the terminal's hardware boldface capability. Other backspaces are deleted, along with the preceding character. Carriage returns immediately followed by a newline are deleted. Other carriage returns are handled as specified by the -r option. Unicode formatting characters, such as the Byte Order Mark, are sent to the terminal. Text which is overstruck or underlined can be searched for if neither -u nor -U is in effect. -V or --version Displays the version number of less. -w or --hilite-unread Temporarily highlights the first "new" line after a forward movement of a full page. The first "new" line is the line immediately following the line previously at the bottom of the screen. Also highlights the target line after a g or p command. The highlight is removed at the next command which causes movement. The entire line is highlighted, unless the -J option is in effect, in which case only the status column is highlighted. -W or --HILITE-UNREAD Like -w, but temporarily highlights the first new line after any forward movement command larger than one line. -xn,... or --tabs=n,... Sets tab stops. If only one n is specified, tab stops are set at multiples of n. If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two. For example, -x9,17 will set tabs at positions 9, 17, 25, 33, etc. The default for n is 8. -X or --no-init Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen. -yn or --max-forw-scroll=n Specifies a maximum number of lines to scroll forward. If it is necessary to scroll forward more than n lines, the screen is repainted instead. The -c or -C option may be used to repaint from the top of the screen if desired. By default, any forward movement causes scrolling. -zn or --window=n or -n Changes the default scrolling window size to n lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compatibility with some versions of more. If the number n is negative, it indicates n lines less than the current screen size. For example, if the screen is 24 lines, -z-4 sets the scrolling window to 20 lines. If the screen is resized to 40 lines, the scrolling window automatically changes to 36 lines. -"cc or --quotes=cc Changes the filename quoting character. This may be necessary if you are trying to name a file which contains both spaces and quote characters. Followed by a single character, this changes the quote character to that character. Filenames containing a space should then be surrounded by that character rather than by double quotes. Followed by two characters, changes the open quote to the first character, and the close quote to the second character. Filenames containing a space should then be preceded by the open quote character and followed by the close quote character. Note that even after the quote characters are changed, this option remains -" (a dash followed by a double quote). -~ or --tilde Normally lines after end of file are displayed as a single tilde (~). This option causes lines after end of file to be displayed as blank lines. -# or --shift Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number specified is zero, it sets the default number of positions to one half of the screen width. Alternately, the number may be specified as a fraction of the width of the screen, starting with a decimal point: .5 is half of the screen width, .3 is three tenths of the screen width, and so on. If the number is specified as a fraction, the actual number of scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width. --follow-name Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the original file despite its name change. If --follow-name is specified, during an F command less will periodically attempt to reopen the file by name. If the reopen succeeds and the file is a different file from the original (which means that a new file has been created with the same name as the original (now renamed) file), less will display the contents of that new file. --incsearch Subsequent search commands will be "incremental"; that is, less will advance to the next line containing the search pattern as each character of the pattern is typed in. --line-num-width Sets the minimum width of the line number field when the -N option is in effect. The default is 7 characters. --mouse Enables mouse input: scrolling the mouse wheel down moves forward in the file, scrolling the mouse wheel up moves backwards in the file, and clicking the mouse sets the "#" mark to the line where the mouse is clicked. The number of lines to scroll when the wheel is moved can be set by the --wheel-lines option. Mouse input works only on terminals which support X11 mouse reporting, and on the Windows version of less. --MOUSE Like --mouse, except the direction scrolled on mouse wheel movement is reversed. --no-keypad Disables sending the keypad initialization and deinitialization strings to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner. --no-histdups This option changes the behavior so that if a search string or file name is typed in, and the same string is already in the history list, the existing copy is removed from the history list before the new one is added. Thus, a given string will appear only once in the history list. Normally, a string may appear multiple times. --rscroll This option changes the character used to mark truncated lines. It may begin with a two-character attribute indicator like LESSBINFMT does. If there is no attribute indicator, standout is used. If set to "-", truncated lines are not marked. --save-marks Save marks in the history file, so marks are retained across different invocations of less. --status-col-width Sets the width of the status column when the -J option is in effect. The default is 2 characters. --use-backslash This option changes the interpretations of options which follow this one. After the --use-backslash option, any backslash in an option string is removed and the following character is taken literally. This allows a dollar sign to be included in option strings. --use-color Enables the colored text in various places. The -D option can be used to change the colors. Colored text works only if the terminal supports ANSI color escape sequences (as defined in ECMA-48 SGR; see https://www.ecma-international.org/publications-and- standards/standards/ecma-48). --wheel-lines=n Set the number of lines to scroll when the mouse wheel is scrolled and the --mouse or --MOUSE option is in effect. The default is 1 line. -- A command line argument of "--" marks the end of option arguments. Any arguments following this are interpreted as filenames. This can be useful when viewing a file whose name begins with a "-" or "+". + If a command line option begins with +, the remainder of that option is taken to be an initial command to less. For example, +G tells less to start at the end of the file rather than the beginning, and +/xyz tells it to start at the first occurrence of "xyz" in the file. As a special case, +<number> acts like +<number>g; that is, it starts the display at the specified line number (however, see the caveat under the "g" command above). If the option starts with ++, the initial command applies to every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an initial command for every file. LINE EDITING When entering a command line at the bottom of the screen (for example, a filename for the :e command, or the pattern for a search command), certain keys can be used to manipulate the command line. Most commands have an alternate form in [ brackets ] which can be used if a key does not exist on a particular keyboard. (Note that the forms beginning with ESC do not work in some MS-DOS and Windows systems because ESC is the line erase character.) Any of these special keys may be entered literally by preceding it with the "literal" character, either ^V or ^A. A backslash itself may also be entered literally by entering two backslashes. LEFTARROW [ ESC-h ] Move the cursor one space to the left. RIGHTARROW [ ESC-l ] Move the cursor one space to the right. ^LEFTARROW [ ESC-b or ESC-LEFTARROW ] (That is, CONTROL and LEFTARROW simultaneously.) Move the cursor one word to the left. ^RIGHTARROW [ ESC-w or ESC-RIGHTARROW ] (That is, CONTROL and RIGHTARROW simultaneously.) Move the cursor one word to the right. HOME [ ESC-0 ] Move the cursor to the beginning of the line. END [ ESC-$ ] Move the cursor to the end of the line. BACKSPACE Delete the character to the left of the cursor, or cancel the command if the command line is empty. DELETE or [ ESC-x ] Delete the character under the cursor. ^BACKSPACE [ ESC-BACKSPACE ] (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor. ^DELETE [ ESC-X or ESC-DELETE ] (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor. UPARROW [ ESC-k ] Retrieve the previous command line. If you first enter some text and then press UPARROW, it will retrieve the previous command which begins with that text. DOWNARROW [ ESC-j ] Retrieve the next command line. If you first enter some text and then press DOWNARROW, it will retrieve the next command which begins with that text. TAB Complete the partial filename to the left of the cursor. If it matches more than one filename, the first match is entered into the command line. Repeated TABs will cycle thru the other matching filenames. If the completed filename is a directory, a "/" is appended to the filename. (On MS-DOS systems, a "\" is appended.) The environment variable LESSSEPARATOR can be used to specify a different character to append to a directory name. BACKTAB [ ESC-TAB ] Like, TAB, but cycles in the reverse direction thru the matching filenames. ^L Complete the partial filename to the left of the cursor. If it matches more than one filename, all matches are entered into the command line (if they fit). ^U (Unix and OS/2) or ESC (MS-DOS) Delete the entire command line, or cancel the command if the command line is empty. If you have changed your line-kill character in Unix to something other than ^U, that character is used instead of ^U. ^G Delete the entire command line and return to the main prompt. KEY BINDINGS You may define your own less commands by using the program lesskey(1) to create a lesskey file. This file specifies a set of command keys and an action associated with each key. You may also use lesskey to change the line-editing keys (see LINE EDITING), and to set environment variables. If the environment variable LESSKEY is set, less uses that as the name of the lesskey file. Otherwise, less looks in a standard place for the lesskey file: On Unix systems, less looks for a lesskey file called "$HOME/.less". On MS-DOS and Windows systems, less looks for a lesskey file called "$HOME/_less", and if it is not found there, then looks for a lesskey file called "_less" in any directory specified in the PATH environment variable. On OS/2 systems, less looks for a lesskey file called "$HOME/less.ini", and if it is not found, then looks for a lesskey file called "less.ini" in any directory specified in the INIT environment variable, and if it not found there, then looks for a lesskey file called "less.ini" in any directory specified in the PATH environment variable. See the lesskey manual page for more details. A system-wide lesskey file may also be set up to provide key bindings. If a key is defined in both a local lesskey file and in the system-wide file, key bindings in the local file take precedence over those in the system-wide file. If the environment variable LESSKEY_SYSTEM is set, less uses that as the name of the system-wide lesskey file. Otherwise, less looks in a standard place for the system-wide lesskey file: On Unix systems, the system-wide lesskey file is /usr/local/etc/sysless. (However, if less was built with a different sysconf directory than /usr/local/etc, that directory is where the sysless file is found.) On MS-DOS and Windows systems, the system-wide lesskey file is c:\_sysless. On OS/2 systems, the system-wide lesskey file is c:\sysless.ini. INPUT PREPROCESSOR You may define an "input preprocessor" for less. Before less opens a file, it first gives your input preprocessor a chance to modify the way the contents of the file are displayed. An input preprocessor is simply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The contents of the replacement file are then displayed in place of the contents of the original file. However, it will appear to the user as if the original file is opened; that is, less will display the original filename as the name of the current file. An input preprocessor receives one command line argument, the original filename, as entered by the user. It should create the replacement file, and when finished, print the name of the replacement file to its standard output. If the input preprocessor does not output a replacement filename, less uses the original file, as normal. The input preprocessor is not called when viewing standard input. To set up an input preprocessor, set the LESSOPEN 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 filename when the input preprocessor command is invoked. When less closes a file opened in such a way, it will call another program, called the input postprocessor, which may perform any desired clean-up action (such as deleting the replacement file created by LESSOPEN). This program receives two command line arguments, the original filename as entered by the user, and the name of the replacement file. To set up an input postprocessor, set the LESSCLOSE environment variable to a command line which will invoke your input postprocessor. It may include two occurrences of the string "%s"; the first is replaced with the original name of the file and the second with the name of the replacement file, which was output by LESSOPEN. For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let less view them directly: lessopen.sh: #! /bin/sh case "$1" in *.Z) TEMPFILE=$(mktemp) uncompress -c $1 >$TEMPFILE 2>/dev/null if [ -s $TEMPFILE ]; then echo $TEMPFILE else rm -f $TEMPFILE fi ;; esac lessclose.sh: #! /bin/sh rm $2 To use these scripts, put them both where they can be executed and set LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More complex LESSOPEN and LESSCLOSE scripts may be written to accept other types of compressed files, and so on. It is also possible to set up an input preprocessor to pipe the file data directly to less, rather than putting the data into a replacement file. This avoids the need to decompress the entire file before starting to view it. An input preprocessor that works this way is called an input pipe. An input pipe, instead of writing the name of a replacement file on its standard output, writes the entire contents of the replacement file on its standard output. If the input pipe does not write any characters on its standard output, then there is no replacement file and less uses the original file, as normal. To use an input pipe, make the first character in the LESSOPEN environment variable a vertical bar (|) to signify that the input preprocessor is an input pipe. As with non-pipe input preprocessors, the command string must contain one occurrence of %s, which is replaced with the filename of the input file. For example, on many Unix systems, this script will work like the previous example scripts: lesspipe.sh: #! /bin/sh case "$1" in *.Z) uncompress -c $1 2>/dev/null ;; *) exit 1 ;; esac exit $? To use this script, put it where it can be executed and set LESSOPEN="|lesspipe.sh %s". Note that a preprocessor cannot output an empty file, since that is interpreted as meaning there is no replacement, and the original file is used. To avoid this, if LESSOPEN starts with two vertical bars, the exit status of the script becomes meaningful. If the exit status is zero, the output is considered to be replacement text, even if it is empty. If the exit status is nonzero, any output is ignored and the original file is used. For compatibility with previous versions of less, if LESSOPEN starts with only one vertical bar, the exit status of the preprocessor is ignored. When an input pipe is used, a LESSCLOSE postprocessor can be used, but it is usually not necessary since there is no replacement file to clean up. In this case, the replacement file name passed to the LESSCLOSE postprocessor is "-". For compatibility with previous versions of less, the input preprocessor or pipe is not used if less is viewing standard input. However, if the first character of LESSOPEN is a dash (-), the input preprocessor is used on standard input as well as other files. In this case, the dash is not considered to be part of the preprocessor command. If standard input is being viewed, the input preprocessor is passed a file name consisting of a single dash. Similarly, if the first two characters of LESSOPEN are vertical bar and dash (|-) or two vertical bars and a dash (||-), the input pipe is used on standard input as well as other files. Again, in this case the dash is not considered to be part of the input pipe command. NATIONAL CHARACTER SETS There are three types of characters in the input file: normal characters can be displayed directly to the screen. control characters should not be displayed directly, but are expected to be found in ordinary text files (such as backspace and tab). binary characters should not be displayed directly and are not expected to be found in text files. A "character set" is simply a description of which characters are to be considered normal, control, and binary. The LESSCHARSET environment variable may be used to select a character set. Possible values for LESSCHARSET are: ascii BS, TAB, NL, CR, and formfeed are control characters, all chars with values between 32 and 126 are normal, and all others are binary. iso8859 Selects an ISO 8859 character set. This is the same as ASCII, except characters between 160 and 255 are treated as normal characters. latin1 Same as iso8859. latin9 Same as iso8859. dos Selects a character set appropriate for MS-DOS. ebcdic Selects an EBCDIC character set. IBM-1047 Selects an EBCDIC character set used by OS/390 Unix Services. This is the EBCDIC analogue of latin1. You get similar results by setting either LESSCHARSET=IBM-1047 or LC_CTYPE=en_US in your environment. koi8-r Selects a Russian character set. next Selects a character set appropriate for NeXT computers. utf-8 Selects the UTF-8 encoding of the ISO 10646 character set. UTF-8 is special in that it supports multi-byte characters in the input file. It is the only character set that supports multi-byte characters. windows Selects a character set appropriate for Microsoft Windows (cp 1251). In rare cases, it may be desired to tailor less to use a character set other than the ones definable by LESSCHARSET. In this case, the environment variable LESSCHARDEF can be used to define a character set. It should be set to a string where each character in the string represents one character in the character set. The character "." is used for a normal character, "c" for control, and "b" for binary. A decimal number may be used for repetition. For example, "bccc4b." would mean character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are binary, and 8 is normal. All characters after the last are taken to be the same as the last, so characters 9 through 255 would be normal. (This is an example, and does not necessarily represent any real character set.) This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: ascii 8bcccbcc18b95.b dos 8bcccbcc12bc5b95.b. ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc 191.b iso8859 8bcccbcc18b95.33b. koi8-r 8bcccbcc18b95.b128. latin1 8bcccbcc18b95.33b. next 8bcccbcc18b95.bb125.bb If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_CTYPE or LANG environment variables, then the default character set is utf-8. If that string is not found, but your system supports the setlocale interface, less will use setlocale to determine the character set. setlocale is controlled by setting the LANG or LC_CTYPE environment variables. Finally, if the setlocale interface is also not available, the default character set is latin1. Control and binary characters are displayed in standout (reverse video). Each such character is displayed in caret notation if possible (e.g. ^A for control-A). Caret notation is used only if inverting the 0100 bit results in a normal printable character. Otherwise, the character is displayed as a hex number in angle brackets. This format can be changed by setting the LESSBINFMT environment variable. LESSBINFMT may begin with a "*" and one character to select the display attribute: "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout, and "*n" is normal. If LESSBINFMT does not begin with a "*", normal attribute is assumed. The remainder of LESSBINFMT is a string which may include one printf-style escape sequence (a % followed by x, X, o, d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters are displayed in underlined hexadecimal surrounded by brackets. The default if no LESSBINFMT is specified is "*s<%02X>". Warning: the result of expanding the character via LESSBINFMT must be less than 31 characters. When the character set is utf-8, the LESSUTFBINFMT environment variable acts similarly to LESSBINFMT but it applies to Unicode code points that were successfully decoded but are unsuitable for display (e.g., unassigned code points). Its default value is "<U+%04lX>". Note that LESSUTFBINFMT and LESSBINFMT share their display attribute setting ("*x") so specifying one will affect both; LESSUTFBINFMT is read after LESSBINFMT so its setting, if any, will have priority. Problematic octets in a UTF-8 file (octets of a truncated sequence, octets of a complete but non-shortest form sequence, invalid octets, and stray trailing octets) are displayed individually using LESSBINFMT so as to facilitate diagnostic of how the UTF-8 file is ill-formed. PROMPTS The -P option allows you to tailor the prompt to your preference. The string given to the -P option replaces the specified prompt string. Certain characters in the string are interpreted specially. The prompt mechanism is rather complicated to provide flexibility, but the ordinary user need not understand the details of constructing personalized prompt strings. A percent sign followed by a single character is expanded according to what the following character is: %bX Replaced by the byte offset into the current input file. The b is followed by a single character (shown as X above) which specifies the line whose byte offset is to be used. If the character is a "t", the byte offset of the top line in the display is used, an "m" means use the middle line, a "b" means use the bottom line, a "B" means use the line just after the bottom line, and a "j" means use the "target" line, as specified by the -j option. %B Replaced by the size of the current input file. %c Replaced by the column number of the text appearing in the first column of the screen. %dX Replaced by the page number of a line in the input file. The line to be used is determined by the X, as with the %b option. %D Replaced by the number of pages in the input file, or equivalently, the page number of the last line in the input file. %E Replaced by the name of the editor (from the VISUAL environment variable, or the EDITOR environment variable if VISUAL is not defined). See the discussion of the LESSEDIT feature below. %f Replaced by the name of the current input file. %F Replaced by the last component of the name of the current input file. %g Replaced by the shell-escaped name of the current input file. This is useful when the expanded string will be used in a shell command, such as in LESSEDIT. %i Replaced by the index of the current file in the list of input files. %lX Replaced by the line number of a line in the input file. The line to be used is determined by the X, as with the %b option. %L Replaced by the line number of the last line in the input file. %m Replaced by the total number of input files. %pX Replaced by the percent into the current input file, based on byte offsets. The line used is determined by the X as with the %b option. %PX Replaced by the percent into the current input file, based on line numbers. The line used is determined by the X as with the %b option. %s Same as %B. %t Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. %T Normally expands to the word "file". However if viewing files via a tags list using the -t option, it expands to the word "tag". %x Replaced by the name of the next input file in the list. If any item is unknown (for example, the file size if input is a pipe), a question mark is printed instead. The format of the prompt string can be changed depending on certain conditions. A question mark followed by a single character acts like an "IF": depending on the following character, a condition is evaluated. If the condition is true, any characters following the question mark and condition character, up to a period, are included in the prompt. If the condition is false, such characters are not included. A colon appearing between the question mark and the period can be used to establish an "ELSE": any characters between the colon and the period are included in the string if and only if the IF condition is false. Condition characters (which follow a question mark) may be: ?a True if any characters have been included in the prompt so far. ?bX True if the byte offset of the specified line is known. ?B True if the size of current input file is known. ?c True if the text is horizontally shifted (%c is not zero). ?dX True if the page number of the specified line is known. ?e True if at end-of-file. ?f True if there is an input filename (that is, if input is not a pipe). ?lX True if the line number of the specified line is known. ?L True if the line number of the last line in the file is known. ?m True if there is more than one input file. ?n True if this is the first prompt in a new input file. ?pX True if the percent into the current input file, based on byte offsets, of the specified line is known. ?PX True if the percent into the current input file, based on line numbers, of the specified line is known. ?s Same as "?B". ?x True if there is a next input file (that is, if the current input file is not the last one). Any characters other than the special ones (question mark, colon, period, percent, and backslash) become literally part of the prompt. Any of the special characters may be included in the prompt literally by preceding it with a backslash. Some examples: ?f%f:Standard input. This prompt prints the filename, if known; otherwise the string "Standard input". ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-... This prompt would print the filename, if known. The filename is followed by the line number, if known, otherwise the percent if known, otherwise the byte offset if known. Otherwise, a dash is printed. Notice how each question mark has a matching period, and how the % after the %pt is included literally by escaping it with a backslash. ?n?f%f .?m(%T %i of %m) ..?e(END) ?x- Next\: %x..%t"; This prints the filename if this is the first prompt in a file, followed by the "file N of N" message if there is more than one input file. Then, if we are at end-of-file, the string "(END)" is printed followed by the name of the next file, if there is one. Finally, any trailing spaces are truncated. This is the default prompt. For reference, here are the defaults for the other two prompts (-m and -M respectively). Each is broken into two lines here for readability only. ?n?f%f .?m(%T %i of %m) ..?e(END) ?x- Next\: %x.: ?pB%pB\%:byte %bB?s/%s...%t ?f%f .?n?m(%T %i of %m) ..?ltlines %lt-%lb?L/%L. : byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t And here is the default message produced by the = command: ?f%f .?m(%T %i of %m) .?ltlines %lt-%lb?L/%L. . byte %bB?s/%s. ?e(END) :?pB%pB\%..%t The prompt expansion features are also used for another purpose: if an environment variable LESSEDIT is defined, it is used as the command to be executed when the v command is invoked. The LESSEDIT string is expanded in the same way as the prompt strings. The default value for LESSEDIT is: %E ?lm+%lm. %g Note that this expands to the editor name, followed by a + and the line number, followed by the shell-escaped file name. If your editor does not accept the "+linenumber" syntax, or has other differences in invocation syntax, the LESSEDIT variable can be changed to modify this default. SECURITY When the environment variable LESSSECURE is set to 1, less runs in a "secure" mode. This means these features are disabled: ! the shell command | the pipe command :e the examine command. v the editing command s -o log files -k use of lesskey files -t use of tags files metacharacters in filenames, such as * filename completion (TAB, ^L) Less can also be compiled to be permanently in "secure" mode. COMPATIBILITY WITH MORE If the environment variable LESS_IS_MORE is set to 1, or if the program is invoked via a file link named "more", less behaves (mostly) in conformance with the POSIX "more" command specification. In this mode, less behaves differently in these ways: The -e option works differently. If the -e option is not set, less behaves as if the -e option were set. If the -e option is set, less behaves as if the -E option were set. The -m option works differently. If the -m option is not set, the medium prompt is used, and it is prefixed with the string "--More--". If the -m option is set, the short prompt is used. The -n option acts like the -z option. The normal behavior of the -n option is unavailable in this mode. The parameter to the -p option is taken to be a less command rather than a search pattern. The LESS environment variable is ignored, and the MORE environment variable is used in its place. ENVIRONMENT VARIABLES Environment variables may be specified either in the system environment as usual, or in a lesskey(1) file. If environment variables are defined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence over variables defined in the system-wide lesskey file. COLUMNS Sets the number of columns on the screen. Takes precedence over the number of columns specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) EDITOR The name of the editor (used for the v command). HOME Name of the user's home directory (used to find a lesskey file on Unix and OS/2 systems). HOMEDRIVE, HOMEPATH Concatenation of the HOMEDRIVE and HOMEPATH environment variables is the name of the user's home directory if the HOME variable is not set (only in the Windows version). INIT Name of the user's init directory (used to find a lesskey file on OS/2 systems). LANG Language for determining the character set. LC_CTYPE Language for determining the character set. LESS Options which are passed to less automatically. LESSANSIENDCHARS Characters which may end an ANSI color escape sequence (default "m"). LESSANSIMIDCHARS Characters which may appear between the ESC character and the end character in an ANSI color escape sequence (default "0123456789:;[?!"'#%()*+ ". LESSBINFMT Format for displaying non-printable, non-control characters. LESSCHARDEF Defines a character set. LESSCHARSET Selects a predefined character set. LESSCLOSE Command line to invoke the (optional) input-postprocessor. LESSECHO Name of the lessecho program (default "lessecho"). The lessecho program is needed to expand metacharacters, such as * and ?, in filenames on Unix systems. LESSEDIT Editor prototype string (used for the v command). See discussion under PROMPTS. LESSGLOBALTAGS Name of the command used by the -t option to find global tags. Normally should be set to "global" if your system has the global(1) command. If not set, global tags are not used. LESSHISTFILE Name of the history file used to remember search commands and shell commands between invocations of less. If set to "-" or "/dev/null", a history file is not used. The default is "$HOME/.lesshst" on Unix systems, "$HOME/_lesshst" on DOS and Windows systems, or "$HOME/lesshst.ini" or "$INIT/lesshst.ini" on OS/2 systems. LESSHISTSIZE The maximum number of commands to save in the history file. The default is 100. LESSKEY Name of the default lesskey(1) file. LESSKEY_SYSTEM Name of the default system-wide lesskey(1) file. LESSMETACHARS List of characters which are considered "metacharacters" by the shell. LESSMETAESCAPE Prefix which less will add before each metacharacter in a command sent to the shell. If LESSMETAESCAPE is an empty string, commands containing metacharacters will not be passed to the shell. LESSOPEN Command line to invoke the (optional) input-preprocessor. LESSSECURE Runs less in "secure" mode. See discussion under SECURITY. LESSSEPARATOR String to be appended to a directory name in filename completion. LESSUTFBINFMT Format for displaying non-printable Unicode code points. LESS_IS_MORE Emulate the more(1) command. LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) MORE Options which are passed to less automatically when running in more compatible mode. PATH User's search path (used to find a lesskey file on MS-DOS and OS/2 systems). SHELL The shell used to execute the ! command, as well as to expand filenames. TERM The type of terminal on which less is being run. VISUAL The name of the editor (used for the v command). COPYRIGHT Copyright (C) 1984-2021 Mark Nudelman less is part of the GNU project and is free software. You can redistribute it and/or modify it under the terms of either (1) the GNU General Public License as published by the Free Software Foundation; or (2) the Less License. See the file README in the less distribution for more details regarding redistribution. You should have received a copy of the GNU General Public License along with the source for less; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. You should also have received a copy of the Less License; see the file LICENSE. less is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. AUTHOR Mark Nudelman Report bugs at https://github.com/gwsw/less/issues. For more information, see the less homepage at https://greenwoodsoftware.com/less. Version 581.2: 28 Apr 2021 LESS(1)
null
bunzip2
bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors. The command-line options are deliberately very similar to those of GNU gzip, but they are not identical. bzip2 expects a list of file names to accompany the command-line flags. Each file is replaced by a compressed version of itself, with the name "original_name.bz2". Each compressed file has the same modification date, permissions, and, when possible, ownership as the corresponding original, so that these properties can be correctly restored at decompression time. File name handling is naive in the sense that there is no mechanism for preserving original file names, permissions, ownerships or dates in filesystems which lack these concepts, or have serious file name length restrictions, such as MS-DOS. bzip2 and bunzip2 will by default not overwrite existing files. If you want this to happen, specify the -f flag. If no file names are specified, bzip2 compresses from standard input to standard output. In this case, bzip2 will decline to write compressed output to a terminal, as this would be entirely incomprehensible and therefore pointless. bunzip2 (or bzip2 -d) decompresses all specified files. Files which were not created by bzip2 will be detected and ignored, and a warning issued. bzip2 attempts to guess the filename for the decompressed file from that of the compressed file as follows: filename.bz2 becomes filename filename.bz becomes filename filename.tbz2 becomes filename.tar filename.tbz becomes filename.tar anyothername becomes anyothername.out If the file does not end in one of the recognised endings, .bz2, .bz, .tbz2 or .tbz, bzip2 complains that it cannot guess the name of the original file, and uses the original name with .out appended. As with compression, supplying no filenames causes decompression from standard input to standard output. bunzip2 will correctly decompress a file which is the concatenation of two or more compressed files. The result is the concatenation of the corresponding uncompressed files. Integrity testing (-t) of concatenated compressed files is also supported. You can also compress or decompress files to the standard output by giving the -c flag. Multiple files may be compressed and decompressed like this. The resulting outputs are fed sequentially to stdout. Compression of multiple files in this manner generates a stream containing multiple compressed file representations. Such a stream can be decompressed correctly only by bzip2 version 0.9.0 or later. Earlier versions of bzip2 will stop after decompressing the first file in the stream. bzcat (or bzip2 -dc) decompresses all specified files to the standard output. bzip2 will read arguments from the environment variables BZIP2 and BZIP, in that order, and will process them before any arguments read from the command line. This gives a convenient way to supply default arguments. Compression is always performed, even if the compressed file is slightly larger than the original. Files of less than about one hundred bytes tend to get larger, since the compression mechanism has a constant overhead in the region of 50 bytes. Random data (including the output of most file compressors) is coded at about 8.05 bits per byte, giving an expansion of around 0.5%. As a self-check for your protection, bzip2 uses 32-bit CRCs to make sure that the decompressed version of a file is identical to the original. This guards against corruption of the compressed data, and against undetected bugs in bzip2 (hopefully very unlikely). The chances of data corruption going undetected is microscopic, about one chance in four billion for each file processed. Be aware, though, that the check occurs upon decompression, so it can only tell you that something is wrong. It can't help you recover the original uncompressed data. You can use bzip2recover to try to recover data from damaged files. Return values: 0 for a normal exit, 1 for environmental problems (file not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt compressed file, 3 for an internal consistency error (eg, bug) which caused bzip2 to panic.
bzip2, bunzip2 - a block-sorting file compressor, v1.0.8 bzcat - decompresses files to stdout bzip2recover - recovers data from damaged bzip2 files
bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ] bunzip2 [ -fkvsVL ] [ filenames ... ] bzcat [ -s ] [ filenames ... ] bzip2recover filename
-c --stdout Compress or decompress to standard output. -d --decompress Force decompression. bzip2, bunzip2 and bzcat are really the same program, and the decision about what actions to take is done on the basis of which name is used. This flag overrides that mechanism, and forces bzip2 to decompress. -z --compress The complement to -d: forces compression, regardless of the invocation name. -t --test Check integrity of the specified file(s), but don't decompress them. This really performs a trial decompression and throws away the result. -f --force Force overwrite of output files. Normally, bzip2 will not overwrite existing output files. Also forces bzip2 to break hard links to files, which it otherwise wouldn't do. bzip2 normally declines to decompress files which don't have the correct magic header bytes. If forced (-f), however, it will pass such files through unmodified. This is how GNU gzip behaves. -k --keep Keep (don't delete) input files during compression or decompression. -s --small Reduce memory usage, for compression, decompression and testing. Files are decompressed and tested using a modified algorithm which only requires 2.5 bytes per block byte. This means any file can be decompressed in 2300k of memory, albeit at about half the normal speed. During compression, -s selects a block size of 200k, which limits memory use to around the same figure, at the expense of your compression ratio. In short, if your machine is low on memory (8 megabytes or less), use -s for everything. See MEMORY MANAGEMENT below. -q --quiet Suppress non-essential warning messages. Messages pertaining to I/O errors and other critical events will not be suppressed. -v --verbose Verbose mode -- show the compression ratio for each file processed. Further -v's increase the verbosity level, spewing out lots of information which is primarily of interest for diagnostic purposes. -L --license -V --version Display the software version, license terms and conditions. -1 (or --fast) to -9 (or --best) Set the block size to 100 k, 200 k .. 900 k when compressing. Has no effect when decompressing. See MEMORY MANAGEMENT below. The --fast and --best aliases are primarily for GNU gzip compatibility. In particular, --fast doesn't make things significantly faster. And --best merely selects the default behaviour. -- Treats all subsequent arguments as file names, even if they start with a dash. This is so you can handle files with names beginning with a dash, for example: bzip2 -- -myfilename. --repetitive-fast --repetitive-best These flags are redundant in versions 0.9.5 and above. They provided some coarse control over the behaviour of the sorting algorithm in earlier versions, which was sometimes useful. 0.9.5 and above have an improved algorithm which renders these flags irrelevant. MEMORY MANAGEMENT bzip2 compresses large files in blocks. The block size affects both the compression ratio achieved, and the amount of memory needed for compression and decompression. The flags -1 through -9 specify the block size to be 100,000 bytes through 900,000 bytes (the default) respectively. At decompression time, the block size used for compression is read from the header of the compressed file, and bunzip2 then allocates itself just enough memory to decompress the file. Since block sizes are stored in compressed files, it follows that the flags -1 to -9 are irrelevant to and so ignored during decompression. Compression and decompression requirements, in bytes, can be estimated as: Compression: 400k + ( 8 x block size ) Decompression: 100k + ( 4 x block size ), or 100k + ( 2.5 x block size ) Larger block sizes give rapidly diminishing marginal returns. Most of the compression comes from the first two or three hundred k of block size, a fact worth bearing in mind when using bzip2 on small machines. It is also important to appreciate that the decompression memory requirement is set at compression time by the choice of block size. For files compressed with the default 900k block size, bunzip2 will require about 3700 kbytes to decompress. To support decompression of any file on a 4 megabyte machine, bunzip2 has an option to decompress using approximately half this amount of memory, about 2300 kbytes. Decompression speed is also halved, so you should use this option only where necessary. The relevant flag is -s. In general, try and use the largest block size memory constraints allow, since that maximises the compression achieved. Compression and decompression speed are virtually unaffected by block size. Another significant point applies to files which fit in a single block -- that means most files you'd encounter using a large block size. The amount of real memory touched is proportional to the size of the file, since the file is smaller than a block. For example, compressing a file 20,000 bytes long with the flag -9 will cause the compressor to allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560 kbytes of it. Similarly, the decompressor will allocate 3700k but only touch 100k + 20000 * 4 = 180 kbytes. Here is a table which summarises the maximum memory usage for different block sizes. Also recorded is the total compressed size for 14 files of the Calgary Text Compression Corpus totalling 3,141,622 bytes. This column gives some feel for how compression varies with block size. These figures tend to understate the advantage of larger block sizes for larger files, since the Corpus is dominated by smaller files. Compress Decompress Decompress Corpus Flag usage usage -s usage Size -1 1200k 500k 350k 914704 -2 2000k 900k 600k 877703 -3 2800k 1300k 850k 860338 -4 3600k 1700k 1100k 846899 -5 4400k 2100k 1350k 845160 -6 5200k 2500k 1600k 838626 -7 6100k 2900k 1850k 834096 -8 6800k 3300k 2100k 828642 -9 7600k 3700k 2350k 828642 RECOVERING DATA FROM DAMAGED FILES bzip2 compresses files in blocks, usually 900kbytes long. Each block is handled independently. If a media or transmission error causes a multi-block .bz2 file to become damaged, it may be possible to recover data from the undamaged blocks in the file. The compressed representation of each block is delimited by a 48-bit pattern, which makes it possible to find the block boundaries with reasonable certainty. Each block also carries its own 32-bit CRC, so damaged blocks can be distinguished from undamaged ones. bzip2recover is a simple program whose purpose is to search for blocks in .bz2 files, and write each block out into its own .bz2 file. You can then use bzip2 -t to test the integrity of the resulting files, and decompress those which are undamaged. bzip2recover takes a single argument, the name of the damaged file, and writes a number of files "rec00001file.bz2", "rec00002file.bz2", etc, containing the extracted blocks. The output filenames are designed so that the use of wildcards in subsequent processing -- for example, "bzip2 -dc rec*file.bz2 > recovered_data" -- processes the files in the correct order. bzip2recover should be of most use dealing with large .bz2 files, as these will contain many blocks. It is clearly futile to use it on damaged single-block files, since a damaged block cannot be recovered. If you wish to minimise any potential data loss through media or transmission errors, you might consider compressing with a smaller block size. PERFORMANCE NOTES The sorting phase of compression gathers together similar strings in the file. Because of this, files containing very long runs of repeated symbols, like "aabaabaabaab ..." (repeated several hundred times) may compress more slowly than normal. Versions 0.9.5 and above fare much better than previous versions in this respect. The ratio between worst-case and average-case compression time is in the region of 10:1. For previous versions, this figure was more like 100:1. You can use the -vvvv option to monitor progress in great detail, if you want. Decompression speed is unaffected by these phenomena. bzip2 usually allocates several megabytes of memory to operate in, and then charges all over it in a fairly random fashion. This means that performance, both for compressing and decompressing, is largely determined by the speed at which your machine can service cache misses. Because of this, small changes to the code to reduce the miss rate have been observed to give disproportionately large performance improvements. I imagine bzip2 will perform best on machines with very large caches. CAVEATS I/O error messages are not as helpful as they could be. bzip2 tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. This manual page pertains to version 1.0.8 of bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and above, but with the following exception: 0.9.0 and above can correctly decompress multiple concatenated compressed files. 0.1pl2 cannot do this; it will stop after decompressing just the first file in the stream. bzip2recover versions prior to 1.0.2 used 32-bit integers to represent bit positions in compressed files, so they could not handle compressed files more than 512 megabytes long. Versions 1.0.2 and above use 64-bit ints on some platforms which support them (GNU supported targets, and Windows). To establish whether or not bzip2recover was built with such a limitation, run it without arguments. In any event you can build yourself an unlimited version if you can recompile it with MaybeUInt64 set to be an unsigned 64-bit integer. AUTHOR Julian Seward, jseward@acm.org. https://sourceware.org/bzip2/ The ideas embodied in bzip2 are due to (at least) the following people: Michael Burrows and David Wheeler (for the block sorting transformation), David Wheeler (again, for the Huffman coder), Peter Fenwick (for the structured coding model in the original bzip, and many refinements), and Alistair Moffat, Radford Neal and Ian Witten (for the arithmetic coder in the original bzip). I am much indebted for their help, support and advice. See the manual in the source distribution for pointers to sources of documentation. Christian von Roques encouraged me to look for faster sorting algorithms, so as to speed up compression. Bela Lubkin encouraged me to improve the worst-case compression performance. Donna Robinson XMLised the documentation. The bz* scripts are derived from those of GNU gzip. Many people sent patches, helped with portability problems, lent machines, gave advice and were generally helpful. bzip2(1)
null
touch
The touch utility sets the modification and access times of files. If any file does not exist, it is created with default permissions. By default, touch changes both modification and access times. The -a and -m flags may be used to select the access time or the modification time individually. Selecting both is equivalent to the default. By default, the timestamps are set to the current time. The -d and -t flags explicitly specify a different time, and the -r flag specifies to set the times those of the specified file. The -A flag adjusts the values by a specified amount. The following options are available: -A Adjust the access and modification time stamps for the file by the specified value. This flag is intended for use in modifying files with incorrectly set time stamps. The argument is of the form “[-][[hh]mm]SS” where each pair of letters represents the following: - Make the adjustment negative: the new time stamp is set to be before the old one. hh The number of hours, from 00 to 99. mm The number of minutes, from 00 to 59. SS The number of seconds, from 00 to 59. The -A flag implies the -c flag: if any file specified does not exist, it will be silently ignored. -a Change the access time of the file. The modification time of the file is not changed unless the -m flag is also specified. -c Do not create the file if it does not exist. The touch utility does not treat this as an error. No error messages are displayed and the exit value is not affected. -d Change the access and modification times to the specified date time instead of the current time of day. The argument is of the form “YYYY-MM-DDThh:mm:SS[.frac][tz]” where the letters represent the following: YYYY At least four decimal digits representing the year. MM, DD, hh, mm, SS As with -t time. T The letter T or a space is the time designator. .frac An optional fraction, consisting of a period or a comma followed by one or more digits. The number of significant digits depends on the kernel configuration and the filesystem, and may be zero. tz An optional letter Z indicating the time is in UTC. Otherwise, the time is assumed to be in local time. Local time is affected by the value of the TZ environment variable. -h If the file is a symbolic link, change the times of the link itself rather than the file that the link points to. Note that -h implies -c and thus will not create any new files. -m Change the modification time of the file. The access time of the file is not changed unless the -a flag is also specified. -r Use the access and modifications times from the specified file instead of the current time of day. -t Change the access and modification times to the specified time instead of the current time of day. The argument is of the form “[[CC]YY]MMDDhhmm[.SS]” where each pair of letters represents the following: CC The first two digits of the year (the century). YY The second two digits of the year. If “YY” is specified, but “CC” is not, a value for “YY” between 69 and 99 results in a “CC” value of 19. Otherwise, a “CC” value of 20 is used. MM The month of the year, from 01 to 12. DD the day of the month, from 01 to 31. hh The hour of the day, from 00 to 23. mm The minute of the hour, from 00 to 59. SS The second of the minute, from 00 to 60. If the “CC” and “YY” letter pairs are not specified, the values default to the current year. If the “SS” letter pair is not specified, the value defaults to 0. EXIT STATUS The touch utility exits 0 on success, and >0 if an error occurs. COMPATIBILITY The obsolescent form of touch, where a time format is specified as the first argument, is supported. When no -r or -t option is specified, there are at least two arguments, and the first argument is a string of digits either eight or ten characters in length, the first argument is interpreted as a time specification of the form “MMDDhhmm[YY]”. The “MM”, “DD”, “hh” and “mm” letter pairs are treated as their counterparts specified to the -t option. If the “YY” letter pair is in the range 39 to 99, the year is set to 1939 to 1999, otherwise, the year is set in the 21st century. SEE ALSO utimensat(2) STANDARDS The touch utility is expected to be a superset of the IEEE Std 1003.2 (“POSIX.2”) specification. HISTORY A touch utility appeared in Version 7 AT&T UNIX. macOS 14.5 June 1, 2018 macOS 14.5
touch – change file access and modification times
touch [-A [-][[hh]mm]SS] [-achm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] [-d YYYY-MM-DDThh:mm:SS[.frac][tz]] file ...
null
null
rmic
null
null
null
null
null
dispqlen.d
The dispatcher queue length is an indication of CPU saturation. It is not an indicatior of utilisation - the CPUs may or may not be utilised when the dispatcher queue reports a length of zero. This script measures this activity by sampling at 1000 Hertz per CPU. Since this uses DTrace, only users with root privileges can run this command.
dispqlen.d - dispatcher queue length by CPU. Uses DTrace.
dispqlen.d
null
Print dispatcher queue length by CPU. # dispqlen.d DOCUMENTATION See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with verbose descriptions explaining the output. EXIT dispqlen.d will sample until Ctrl-C is hit. AUTHOR Brendan Gregg [Sydney, Australia] SEE ALSO uptime(1), dtrace(1M) version 0.80 June 27, 2005 dispqlen.d(1m)
db_archive
The db_archive utility writes the pathnames of log files that are no longer in use (for example, no longer involved in active transactions), to the standard output, one pathname per line. These log files should be written to backup media to provide for recovery in the case of catastrophic failure (which also requires a snapshot of the database files), but they may then be deleted from the system to reclaim disk space. The options are as follows: -a Write all pathnames as absolute pathnames, instead of relative to the database home directories. -d Remove log files that are no longer needed; no filenames are written. Automatic log file removal is likely to make catastrophic recovery impossible. -h Specify a home directory for the database environment; by default, the current working directory is used. -l Write out the pathnames of all the database log files, whether or not they are involved in active transactions. -P Specify an environment password. Although Berkeley DB utilities overwrite password strings as soon as possible, be aware there may be a window of vulnerability on systems where unprivileged users can see command-line arguments or where utilities are not able to overwrite the memory containing the command-line arguments. -s Write the pathnames of all the database files that need to be archived in order to recover the database from catastrophic failure. If any of the database files have not been accessed during the lifetime of the current log files, db_archive will not include them in this output. It is possible that some of the files to which the log refers have since been deleted from the system. In this case, db_archive will ignore them. When db_recover is run, any files to which the log refers that are not present during recovery are assumed to have been deleted and will not be recovered. -V Write the library version number to the standard output, and exit. -v Run in verbose mode, listing the checkpoints in the log files as they are reviewed. Log cursor handles (returned by the DB_ENV->log_cursor method) may have open file descriptors for log files in the database environment. Also, the Berkeley DB interfaces to the database environment logging subsystem (for example, DB_ENV->log_put and DB_TXN->abort) may allocate log cursors and have open file descriptors for log files as well. On operating systems where filesystem related system calls (for example, rename and unlink on Windows/NT) can fail if a process has an open file descriptor for the affected file, attempting to move or remove the log files listed by db_archive may fail. All Berkeley DB internal use of log cursors operates on active log files only and furthermore, is short-lived in nature. So, an application seeing such a failure should be restructured to close any open log cursors it may have, and otherwise to retry the operation until it succeeds. (Although the latter is not likely to be necessary; it is hard to imagine a reason to move or rename a log file in which transactions are being logged or aborted.) The db_archive utility uses a Berkeley DB environment (as described for the -h option, the environment variable DB_HOME, or because the utility was run in a directory containing a Berkeley DB environment). In order to avoid environment corruption when using a Berkeley DB environment, db_archive should always be given the chance to detach from the environment and exit gracefully. To cause db_archive to release all environment resources and exit cleanly, send it an interrupt signal (SIGINT). The DB_ENV->log_archive method is the underlying method used by the db_archive utility. See the db_archive utility source code for an example of using DB_ENV->log_archive in a IEEE/ANSI Std 1003.1 (POSIX) environment. The db_archive utility exits 0 on success, and >0 if an error occurs. ENVIRONMENT DB_HOME If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home, as described in DB_ENV->open. SEE ALSO db_checkpoint(1), db_deadlock(1), db_dump(1), db_load(1), db_printlog(1), db_recover(1), db_stat(1), db_upgrade(1), db_verify(1) Darwin December 3, 2003 Darwin
db_archive
db_archive [-adlsVv] [-h home] [-P password]
null
null
getopt
The getopt utility is used to break up options in command lines for easy parsing by shell procedures, and to check for legal options. Optstring is a string of recognized option letters (see getopt(3)); if a letter is followed by a colon, the option is expected to have an argument which may or may not be separated from it by white space. The special option ‘--’ is used to delimit the end of the options. The getopt utility will place ‘--’ in the arguments at the end of the options, or recognize it if used explicitly. The shell arguments ($1 $2 ...) are reset so that each option is preceded by a ‘-’ and in its own shell argument; each option argument is also in its own shell argument. EXIT STATUS The getopt utility prints an error message on the standard error output and exits with status > 0 when it encounters an option letter not included in optstring.
getopt – parse command options
args=`getopt optstring $*` ; errcode=$?; set -- $args
null
The following code fragment shows how one might process the arguments for a command that can take the options -a and -b, and the option -o, which requires an argument. args=`getopt abo: $*` # you should not use `getopt abo: "$@"` since that would parse # the arguments differently from what the set command below does. if [ $? -ne 0 ]; then echo 'Usage: ...' exit 2 fi set -- $args # You cannot use the set command with a backquoted getopt directly, # since the exit code from getopt would be shadowed by those of set, # which is zero by definition. while :; do case "$1" in -a|-b) echo "flag $1 set"; sflags="${1#-}$sflags" shift ;; -o) echo "oarg is '$2'"; oarg="$2" shift; shift ;; --) shift; break ;; esac done echo "single-char flags: '$sflags'" echo "oarg is '$oarg'" This code will accept any of the following as equivalent: cmd -aoarg file1 file2 cmd -a -o arg file1 file2 cmd -oarg -a file1 file2 cmd -a -oarg -- file1 file2 SEE ALSO getopts(1), sh(1), getopt(3) HISTORY Written by Henry Spencer, working from a Bell Labs manual page. Behavior believed identical to the Bell version. Example changed in FreeBSD version 3.2 and 4.0. BUGS Whatever getopt(3) has. Arguments containing white space or embedded shell metacharacters generally will not survive intact; this looks easy to fix but is not. People trying to fix getopt or the example in this manpage should check the history of this file in FreeBSD. The error message for an invalid option is identified as coming from getopt rather than from the shell procedure containing the invocation of getopt; this again is hard to fix. The precise best way to use the set command to set the arguments without disrupting the value(s) of shell options varies from one shell version to another. Each shellscript has to carry complex code to parse arguments halfway correctly (like the example presented here). A better getopt-like tool would move much of the complexity into the tool and keep the client shell scripts simpler. macOS 14.5 August 1, 2015 macOS 14.5
instmodsh5.30
A little interface to ExtUtils::Installed to examine installed modules, validate your packlists and even create a tarball from an installed module. SEE ALSO ExtUtils::Installed perl v5.30.3 2024-04-13 INSTMODSH(1)
instmodsh - A shell to examine installed modules
instmodsh
null
null
krb5-config
krb5-config tells the application programmer what flags to use to compile and link programs against the installed Kerberos libraries.
krb5-config - tool for linking against MIT Kerberos libraries
krb5-config [--help | --all | --version | --vendor | --prefix | --exec-prefix | --defccname | --defktname | --defcktname | --cflags | --libs [libraries]]
--help prints a usage message. This is the default behavior when no options are specified. --all prints the version, vendor, prefix, and exec-prefix. --version prints the version number of the Kerberos installation. --vendor prints the name of the vendor of the Kerberos installation. --prefix prints the prefix for which the Kerberos installation was built. --exec-prefix prints the prefix for executables for which the Kerberos installation was built. --defccname prints the built-in default credentials cache location. --defktname prints the built-in default keytab location. --defcktname prints the built-in default client (initiator) keytab location. --cflags prints the compilation flags used to build the Kerberos installation. --libs [library] prints the compiler options needed to link against library. Allowed values for library are: ┌────────────┬──────────────────────────┐ │krb5 │ Kerberos 5 applications │ │ │ (default) │ ├────────────┼──────────────────────────┤ │gssapi │ GSSAPI applications with │ │ │ Kerberos 5 bindings │ ├────────────┼──────────────────────────┤ │kadm-client │ Kadmin client │ ├────────────┼──────────────────────────┤ │kadm-server │ Kadmin server │ ├────────────┼──────────────────────────┤ │kdb │ Applications that access │ │ │ the Kerberos database │ └────────────┴──────────────────────────┘
krb5-config is particularly useful for compiling against a Kerberos installation that was installed in a non-standard location. For example, a Kerberos installation that is installed in /opt/krb5/ but uses libraries in /usr/local/lib/ for text localization would produce the following output: shell% krb5-config --libs krb5 -L/opt/krb5/lib -Wl,-rpath -Wl,/opt/krb5/lib -L/usr/local/lib -lkrb5 -lk5crypto -lcom_err SEE ALSO kerberos(7), cc(1) AUTHOR MIT COPYRIGHT 1985-2022, MIT 1.20.1 KRB5-CONFIG(1)
security
A simple command line interface which lets you administer keychains, manipulate keys and certificates, and do just about anything the Security framework is capable of from the command line. By default security will execute the command supplied and report if anything went wrong. If the -i or -p options are provided, security will enter interactive mode and allow the user to enter multiple commands on stdin. When EOF is read from stdin security will exit. Here is a complete list of the options available: -h If no arguments are specified, show a list of all commands. If arguments are provided, show usage for each the specified commands. This option is essentially the same as the help command. -i Run security in interactive mode. A prompt (security> by default) will be displayed and the user will be able to type commands on stdin until an EOF is encountered. -l Before security exits, run /usr/bin/leaks -nocontext on itself to see if the command(s) you executed had any leaks. -p prompt This option implies the -i option but changes the default prompt to the argument specified instead. -q Will make security less verbose. -v Will make security more verbose. SECURITY COMMAND SUMMARY security provides a rich variety of commands (command in the SYNOPSIS), each of which often has a wealth of options, to allow access to the broad functionality provided by the Security framework. However, you don't have to master every detail for security to be useful to you. Here are brief descriptions of all the security commands: help Show all commands, or show usage for a command. list-keychains Display or manipulate the keychain search list. default-keychain Display or set the default keychain. login-keychain Display or set the login keychain. create-keychain Create keychains. delete-keychain Delete keychains and remove them from the search list. lock-keychain Lock the specified keychain. unlock-keychain Unlock the specified keychain. set-keychain-settings Set settings for a keychain. set-keychain-password Set password for a keychain. show-keychain-info Show the settings for keychain. dump-keychain Dump the contents of one or more keychains. create-keypair Create an asymmetric key pair. add-generic-password Add a generic password item. add-internet-password Add an internet password item. add-certificates Add certificates to a keychain. find-generic-password Find a generic password item. delete-generic-password Delete a generic password item. set-generic-password-partition-list Set the partition list of a generic password item. find-internet-password Find an internet password item. delete-internet-password Delete an internet password item. set-internet-password-partition-list Set the partition list of a internet password item. find-key Find keys in the keychain set-key-partition-list Set the partition list of a key. find-certificate Find a certificate item. find-identity Find an identity (certificate + private key). delete-certificate Delete a certificate from a keychain. delete-identity Delete a certificate and its private key from a keychain. set-identity-preference Set the preferred identity to use for a service. get-identity-preference Get the preferred identity to use for a service. create-db Create a db using the DL. export Export items from a keychain. import Import items into a keychain. cms Encode or decode CMS messages. install-mds Install (or re-install) the MDS database. add-trusted-cert Add trusted certificate(s). remove-trusted-cert Remove trusted certificate(s). dump-trust-settings Display contents of trust settings. user-trust-settings-enable Display or manipulate user-level trust settings. trust-settings-export Export trust settings. trust-settings-import Import trust settings. verify-cert Verify certificate(s). authorize Perform authorization operations. authorizationdb Make changes to the authorization policy database. execute-with-privileges Execute tool with privileges. leaks Run /usr/bin/leaks on this process. smartcards Enable, disable or list disabled smartcard tokens. list-smartcards Display available smartcards. export-smartcard Export/display items from a smartcard. error Display a descriptive message for the given error code(s). COMMON COMMAND OPTIONS This section describes the command_options that are available across all security commands. -h Show a usage message for the specified command. This option is essentially the same as the help command. SECURITY COMMANDS Here (finally) are details on all the security commands and the options each accepts. help [-h] Show all commands, or show usage for a command. list-keychains [-h] [-d user|system|common|dynamic] [-s [keychain...]] Display or manipulate the keychain search list. -d user|system|common|dynamic Use the specified preference domain. -s Set the search list to the specified keychains. default-keychain [-h] [-d user|system|common|dynamic] [-s [keychain]] Display or set the default keychain. -d user|system|common|dynamic Use the specified preference domain. -s Set the default keychain to the specified keychain. Unset it if no keychain is specified. login-keychain [-h] [-d user|system|common|dynamic] [-s [keychain]] Display or set the login keychain. -d user|system|common|dynamic Use the specified preference domain. -s Set the login keychain to the specified keychain. Unset it if no keychain is specified. create-keychain [-hP] [-p password] [keychain...] Create keychains. -P Prompt the user for a password using the SecurityAgent. -p password Use password as the password for the keychains being created. If neither -P or -p password are specified, the user is prompted for a password on the command line. Use of the -p option is insecure. delete-keychain [-h] [keychain...] Delete keychains and remove them from the search list. lock-keychain [-h] [-a|keychain] Lock keychain, or the default keychain if none is specified. If the -a option is specified, all keychains are locked. unlock-keychain [-hu] [-p password] [keychain] Unlock keychain, or the default keychain if none is specified. set-keychain-settings [-hlu] [-t timeout] [keychain] Set settings for keychain, or the default keychain if none is specified. -l Lock keychain when the system sleeps. -u Lock keychain after timeout interval. -t timeout Specify timeout interval in seconds (omitting this option specifies "no timeout"). set-keychain-password [-h] [-o oldPassword] [-p newPassword] [keychain] Set password for keychain, or the default keychain if none is specified. -o oldPassword Old keychain password (if not provided, will prompt) -p newPassword New keychain password (if not provided, will prompt) show-keychain-info [-h] [keychain] Show the settings for keychain. dump-keychain [-adhir] Dump the contents of one or more keychains. -a Dump access control list of items -d Dump (decrypted) data of items -i Interactive access control list editing mode -r Dump raw (encrypted) data of items create-keypair [-h] [-a alg] [-s size] [-f date] [-t date] [-d days] [-k keychain] [-A|-T appPath] [name] Create an asymmetric key pair. -a alg Use alg as the algorithm, can be rsa, dh, dsa or fee (default rsa) -s size Specify the keysize in bits (default 512) -f date Make a key valid from the specified date (ex: "13/11/10 3:30pm") -t date Make a key valid to the specified date -d days Make a key valid for the number of days specified from today -k keychain Use the specified keychain rather than the default -A Allow any application to access this key without warning (insecure, not recommended!) -T appPath Specify an application which may access this key (multiple -T options are allowed) add-generic-password [-h] [-a account] [-s service] [-w password] [options...] [keychain] Add a generic password item. -a account Specify account name (required) -c creator Specify item creator (optional four-character code) -C type Specify item type (optional four-character code) -D kind Specify kind (default is "application password") -G value Specify generic attribute value (optional) -j comment Specify comment string (optional) -l label Specify label (if omitted, service name is used as default label) -s service Specify service name (required) -p password Specify password to be added (legacy option, equivalent to -w) -w password Specify password to be added. Put at end of command to be prompted (recommended) -A Allow any application to access this item without warning (insecure, not recommended!) -T appPath Specify an application which may access this item (multiple -T options are allowed) -U Update item if it already exists (if omitted, the item cannot already exist) -X password Specify password data to be added as a hexadecimal string By default, the application which creates an item is trusted to access its data without warning. You can remove this default access by explicitly specifying an empty app pathname: -T "". If no keychain is specified, the password is added to the default keychain. add-internet-password [-h] [-a account] [-s server] [-w password] [options...] [keychain] Add an internet password item. -a account Specify account name (required) -c creator Specify item creator (optional four-character code) -C type Specify item type (optional four-character code) -d domain Specify security domain string (optional) -D kind Specify kind (default is "application password") -j comment Specify comment string (optional) -l label Specify label (if omitted, service name is used as default label) -p path Specify path string (optional) -P port Specify port number (optional) -r protocol Specify protocol (optional four-character SecProtocolType, e.g. "http", "ftp ") -s server Specify server name (required) -t authenticationType Specify authentication type (as a four-character SecAuthenticationType, default is "dflt") -w password Specify password to be added. Put at end of command to be prompted (recommended) -A Allow any application to access this item without warning (insecure, not recommended!) -T appPath Specify an application which may access this item (multiple -T options are allowed) -U Update item if it already exists (if omitted, the item cannot already exist) -X password Specify password data to be added as a hexadecimal string By default, the application which creates an item is trusted to access its data without warning. You can remove this default access by explicitly specifying an empty app pathname: -T "". If no keychain is specified, the password is added to the default keychain. add-certificates [-h] [-k keychain] file... Add certficates contained in the specified files to the default keychain. The files must contain one DER encoded X509 certificate each. -k keychain Use keychain rather than the default keychain. find-generic-password [-h] [-a account] [-s service] [-options...] [-g] [-keychain...] Find a generic password item. -a account Match account string -c creator Match creator (four-character code) -C type Match type (four-character code) -D kind Match kind string -G value Match value string (generic attribute) -j comment Match comment string -l label Match label string -s service Match service string -g Display the password for the item found -w Display the password(only) for the item found delete-generic-password [-h] [-a account] [-s service] [-options...] [-keychain...] Delete a generic password item. -a account Match account string -c creator Match creator (four-character code) -C type Match type (four-character code) -D kind Match kind string -G value Match value string (generic attribute) -j comment Match comment string -l label Match label string -s service Match service string delete-internet-password [-h] [-a account] [-s server] [options...] [keychain...] Delete an internet password item. -a account Match account string -c creator Match creator (four-character code) -C type Match type (four-character code) -d securityDomain Match securityDomain string -D kind Match kind string -j comment Match comment string -l label Match label string -p path Match path string -P port Match port number -r protocol Match protocol (four-character code) -s server Match server string -t authenticationType Match authenticationType (four-character code) find-internet-password [-h] [-a account] [-s server] [options...] [-g] [keychain...] Find an internet password item. -a account Match account string -c creator Match creator (four-character code) -C type Match type (four-character code) -d securityDomain Match securityDomain string -D kind Match kind string -j comment Match comment string -l label Match label string -p path Match path string -P port Match port number -r protocol Match protocol (four-character code) -s server Match server string -t authenticationType Match authenticationType (four-character code) -g Display the password for the item found -w Display the password(only) for the item found find-key [options...] [keychain...] Search the keychain for keys. -a application-label Match "application label" string -c creator Match creator (four-character code) -d Match keys that can decrypt -D description Match "description" string -e Match keys that can encrypt -j comment Match comment string -l label Match label string -r Match keys that can derive -s Match keys that can sign -t type Type of key to find: one of "symmetric", "public", or "private" -u Match keys that can unwrap -v Match keys that can verify -w Match keys that can wrap set-generic-password-partition-list [-a account] [-s service] [-S <partition list (comma separated)>] [-k <keychain password>] [options...] [keychain] Sets the "partition list" for a generic password. The "partition list" is an extra parameter in the ACL which limits access to the item based on an application's code signature. You must present the keychain's password to change a partition list. -S partition-list Comma-separated partition list. See output of "security dump-keychain" for examples. -k password Password for keychain -a account Match account string -c creator Match creator (four-character code) -C type Match type (four-character code) -D kind Match kind string -G value Match value string (generic attribute) -j comment Match comment string -l label Match label string -s service Match service string set-internet-password-partition-list [-a account] [-s server] [-S <partition list (comma separated)>] [-k <keychain password>] [options...] [keychain] Sets the "partition list" for an internet password. The "partition list" is an extra parameter in the ACL which limits access to the item based on an application's code signature. You must present the keychain's password to change a partition list. -S partition-list Comma-separated partition list. See output of "security dump-keychain" for examples. -k password Password for keychain -a account Match account string -c creator Match creator (four-character code) -C type Match type (four-character code) -d securityDomain Match securityDomain string -D kind Match kind string -j comment Match comment string -l label Match label string -p path Match path string -P port Match port number -r protocol Match protocol (four-character code) -s server Match server string -t authenticationType Match authenticationType (four-character code) set-key-partition-list [-S <partition list (comma separated)>] [-k <keychain password>] [options...] [keychain] Sets the "partition list" for a key. The "partition list" is an extra parameter in the ACL which limits access to the key based on an application's code signature. You must present the keychain's password to change a partition list. If you'd like to run /usr/bin/codesign with the key, "apple:" must be an element of the partition list. -S partition-list Comma-separated partition list. See output of "security dump-keychain" for examples. -k password Password for keychain -a application-label Match "application label" string -c creator Match creator (four-character code) -d Match keys that can decrypt -D description Match "description" string -e Match keys that can encrypt -j comment Match comment string -l label Match label string -r Match keys that can derive -s Match keys that can sign -t type Type of key to find: one of "symmetric", "public", or "private" -u Match keys that can unwrap -v Match keys that can verify -w Match keys that can wrap find-certificate [-h] [-a] [-c name] [-e emailAddress] [-m] [-p] [-Z] [keychain...] Find a certificate item. If no keychain arguments are provided, the default search list is used. Options: -a Find all matching certificates, not just the first one -c name Match on name when searching (optional) -e emailAddress Match on emailAddress when searching (optional) -m Show the email addresses in the certificate -p Output certificate in pem format. Default is to dump the attributes and keychain the cert is in. -Z Print SHA-256 (and SHA-1) hash of the certificate
security – Command line interface to keychains and Security framework
security [-hilqv] [-p prompt] [command] [command_options] [command_args]
null
security> find-certificate -a -p > allcerts.pem Exports all certificates from all keychains into a pem file called allcerts.pem. security> find-certificate -a -e me@foo.com -p > certs.pem Exports all certificates from all keychains with the email address me@foo.com into a pem file called certs.pem. security> find-certificate -a -c MyName -Z login.keychain | grep ^SHA-256 Print the SHA-256 hash of every certificate in 'login.keychain' whose common name includes 'MyName' find-identity [-h] [-p policy] [-s string] [-v] [keychain...] Find an identity (certificate + private key) satisfying a given policy. If no policy arguments are provided, the X.509 basic policy is assumed. If no keychain arguments are provided, the default search list is used. Options: -p policy Specify policy to evaluate (multiple -p options are allowed). Supported policies: basic, ssl- client, ssl-server, smime, eap, ipsec, ichat, codesigning, sys-default, sys-kerberos-kdc -s string Specify optional policy-specific string (e.g. a DNS hostname for SSL, or RFC822 email address for S/MIME) -v Show valid identities only (default is to show all identities) security> find-identity -v -p ssl-client Display valid identities that can be used for SSL client authentication security> find-identity -p ssl-server -s www.domain.com Display identities for a SSL server running on the host 'www.domain.com' security> find-identity -p smime -s user@domain.com Display identities that can be used to sign a message from 'user@domain.com' delete-certificate [-h] [-c name] [-Z hash] [-t] [keychain...] Delete a certificate from a keychain. If no keychain arguments are provided, the default search list is used. -c name Specify certificate to delete by its common name -Z hash Specify certificate to delete by its SHA-256 (or SHA-1) hash -t Also delete user trust settings for this certificate The certificate to be deleted must be uniquely specified either by a string found in its common name, or by its SHA-256 (or SHA-1) hash. delete-identity [-h] [-c name] [-Z hash] [-t] [keychain...] Delete a certificate and its private key from a keychain. If no keychain arguments are provided, the default search list is used. -c name Specify certificate to delete by its common name -Z hash Specify certificate to delete by its SHA-256 (or SHA-1) hash -t Also delete user trust settings for this identity certificate The identity to be deleted must be uniquely specified either by a string found in its common name, or by its SHA-256 (or SHA-1) hash. set-identity-preference [-h] [-n] [-c identity] [-s service] [-u keyUsage] [-Z hash] [keychain...] Set the preferred identity to use for a service. -n Specify no identity (clears existing preference for the given service) -c identity Specify identity by common name of the certificate -s service Specify service (may be a URL, RFC822 email address, DNS host, or other name) for which this identity is to be preferred -u keyUsage Specify key usage (optional) -Z hash Specify identity by SHA-256 (or SHA-1) hash of certificate (optional) The identity is located by searching the specified keychain(s) for a certificate whose common name contains the given identity string. If no keychains are specified to search, the default search list is used. Different identity preferences can be set for individual key usages. You can differentiate between two identities which contain the same string by providing a SHA-256 (or SHA-1) hash of the certificate in addition to, or instead of, the name. PARTIAL PATHS AND WILDCARDS Prior to 10.5.4, identity preferences for SSL/TLS client authentication could only be set on a per-URL basis. The URL being visited had to match the service name exactly for the preference to be in effect. In 10.5.4, it became possible to specify identity preferences on a per-server basis, by using a service name with a partial path URL to match more specific paths on the same server. For example, if an identity preference for "https://www.apache-ssl.org/" exists, it will be in effect for "https://www.apache-ssl.org/cgi/cert- export", and so on. Note that partial path URLs must end with a trailing slash character. Starting with 10.6, it is possible to specify identity preferences on a per-domain basis, by using the wildcard character '*' as the leftmost component of the service name. Unlike SSL wildcards, an identity preference wildcard can match more than one subdomain. For example, an identity preference for the name "*.army.mil" will match "server1.subdomain1.army.mil" or "server2.subdomain2.army.mil". Likewise, a preference for "*.mil" will match both "server.army.mil" and "server.navy.mil". KEY USAGE CODES 0 - preference is in effect for all possible key usages (default) 1 - encryption only 2 - decryption only 4 - signing only 8 - signature verification only 16 - signing with message recovery only 32 - signature verification with message recovery only 64 - key wrapping only 128 - key unwrapping only 256 - key derivation only To specify more than one usage, add values together. get-identity-preference [-h] [-s service] [-u keyUsage] [-p] [-c] [-Z] Get the preferred identity to use for a service. -s service Specify service (may be a URL, RFC822 email address, DNS host, or other name) -u keyUsage Specify key usage (optional) -p Output identity certificate in pem format -c Print common name of the preferred identity certificate -Z Print SHA-256 (and SHA-1) hash of the preferred identity certificate create-db [-aho0] [-g dl|cspdl] [-m mode] [name] Create a db using the DL. If name isn't provided security will prompt the user to type a name. Options: -a Turn off autocommit -g dl|cspdl Use the AppleDL (default) or AppleCspDL -m mode Set the file permissions to mode. -o Force using openparams argument -0 Force using version 0 openparams security> create-db -m 0644 test.db security> create-db -g cspdl -a test2.db export [-k keychain] [-t type] [-f format] [-w] [-p format] [-P passphrase] [-o outfile] Export one or more items from a keychain to one of a number of external representations. If keychain isn't provided, items will be exported from the user's default keychain. Options: -k keychain Specify keychain from which item(s) will be exported. -t type Specify the type of items to export. Possible types are certs, allKeys, pubKeys, privKeys, identities, and all. The default is all. An identity consists of both a certificate and the corresponding private key. -f format Specify the format of the exported data. Possible formats are openssl, bsafe, pkcs7, pkcs8, pkcs12, x509, openssh1, openssh2, and pemseq. The default is pemseq if more than one item is being exported. The default is openssl if one key is being exported. The default is x509 if one certificate is being exported. -w Specifies that private keys are to be wrapped on export. -p Specifies that PEM armour is to be applied to the output data. -P passphrase Specify the wrapping passphrase immediately. The default is to obtain a secure passphrase via GUI. -o outfile Write the output data to outfile. Default is to write data to stdout. security> export -k login.keychain -t certs -o /tmp/certs.pem security> export -k newcert.keychain -t identities -f pkcs12 -o /tmp/mycerts.p12 import inputfile [-k keychain] [-t type] [-f format] [-w] [-P passphrase] [options...] Import one or more items from inputfile into a keychain. If keychain isn't provided, items will be imported into the user's default keychain. Options: -k keychain Specify keychain into which item(s) will be imported. -t type Specify the type of items to import. Possible types are cert, pub, priv, session, cert, and agg. Pub, priv, and session refer to keys; agg is one of the aggregate types (pkcs12 and PEM sequence). The command can often figure out what item_type an item contains based in the filename and/or item_format. -f format Specify the format of the exported data. Possible formats are openssl, bsafe, raw, pkcs7, pkcs8, pkcs12, x509, openssh1, openssh2, and pemseq. The command can often figure out what format an item is in based in the filename and/or item_type. -w Specify that private keys are wrapped and must be unwrapped on import. -x Specify that private keys are non-extractable after being imported. -P passphrase Specify the unwrapping passphrase immediately. The default is to obtain a secure passphrase via GUI. -a attrName attrValue Specify optional extended attribute name and value. Can be used multiple times. This is only valid when importing keys. -A Allow any application to access the imported key without warning (insecure, not recommended!) -T appPath Specify an application which may access the imported key (multiple -T options are allowed) security> import /tmp/certs.pem -k security> import /tmp/mycerts.p12 -t agg -k newcert.keychain security> import /tmp/mycerts.p12 -f pkcs12 -k newcert.keychain cms [-C|-D|-E|-S] [options...] Encode or decode CMS messages. -C create a CMS encrypted message -D decode a CMS message -E create a CMS enveloped message -S create a CMS signed message Decoding options: -c content use this detached content file -h level generate email headers with info about CMS message (output level >= 0) -n suppress output of content Encoding options: -r id,... create envelope for comma-delimited list of recipients, where id can be a certificate nickname or email address -G include a signing time attribute -H hash hash = MD2|MD4|MD5|SHA1|SHA256|SHA384|SHA512 (default: SHA1) -N nick use certificate named "nick" for signing -P include a SMIMECapabilities attribute -T do not include content in CMS message -Y nick include an EncryptionKeyPreference attribute with certificate (use "NONE" to omit) -Z hash find a certificate by subject key ID Common options: -e envelope specify envelope file (valid with -D or -E) -k keychain specify keychain to use -i infile use infile as source of data (default: stdin) -o outfile use outfile as destination of data (default: stdout) -p password use password as key db password (default: prompt) -s pass data a single byte at a time to CMS -u certusage set type of certificate usage (default: certUsageEmailSigner) -v print debugging information Cert usage codes: 0 - certUsageSSLClient 1 - certUsageSSLServer 2 - certUsageSSLServerWithStepUp 3 - certUsageSSLCA 4 - certUsageEmailSigner 5 - certUsageEmailRecipient 6 - certUsageObjectSigner 7 - certUsageUserCertImport 8 - certUsageVerifyCA 9 - certUsageProtectedObjectSigner 10 - certUsageStatusResponder 11 - certUsageAnyCA install-mds Install (or re-install) the Module Directory Services (MDS) database. This is a system tool which is not normally used by users. There are no options. add-trusted-cert [-d] [-r resultType] [-p policy] [-a appPath] [-s policyString] [-e allowedError] [-u keyUsage] [-k keychain] [-i settingsFileIn] [-o settingsFileOut] certFile Add certificate (in DER or PEM format) from certFile to per-user or local Admin Trust Settings. When modifying per-user Trust Settings, user authentication is required via an authentication dialog. When modifying admin Trust Settings, the process must be running as root, or admin authentication is required. Options: -d Add to admin cert store; default is user. -r resultType resultType = trustRoot|trustAsRoot|deny|unspecified; default is trustRoot. -p policy Specify policy constraint (ssl, smime, codeSign, IPSec, basic, swUpdate, pkgSign, eap, macappstore, appleID, timestamping). -a appPath Specify application constraint. -s policyString Specify policy-specific string. -e allowedError Specify allowed error (an integer value, or one of: certExpired, hostnameMismatch) -u keyUsage Specify key usage, an integer. -k keychain Specify keychain to which cert is added. -i settingsFileIn Input trust settings file; default is user domain. -o settingsFileOut Output trust settings file; default is user domain. Key usage codes: -1 - Any 1 - Sign 2 - Encrypt/Decrypt Data 4 - Encrypt/Decrypt Key 8 - Sign certificate 16 - Sign revocation 32 - Key exchange To specify more than one usage, add values together (except -1 - Any). security> add-trusted-cert /tmp/cert.der security> add-trusted-cert -d .tmp/cert.der remove-trusted-cert [-d] certFile Remove certificate (in DER or PEM format) in certFile from per-user or local Admin Trust Settings. When modifying per-user Trust Settings, user authentication is required via an authentication dialog. When modifying admin Trust Settings, the process must be running as root, or admin authentication is required. Options: -d Remove from admin cert store; default is user. dump-trust-settings [-s] [-d] Display Trust Settings. Options: -s Display trusted system certs; default is user. -d Display trusted admin certs; default is user. user-trust-settings-enable [-d] [-e] Display or manipulate user- level Trust Settings. With no arguments, shows the current state of the user-level Trust Settings enable. Otherwise enables or disables user-level Trust Settings. Options: -d Disable user-level Trust Settings. -e Enable user-level Trust Settings. trust-settings-export [-s] [-d] settings_file Export Trust Settings to the specified file. Options: -s Export system Trust Settings; default is user. -d Export admin Trust Settings; default is user. trust-settings-import [-d] settings_file Import Trust Settings from the specified file. When modifying per-user Trust Settings, user authentication is required via an authentication dialog. When modifying admin Trust Settings, the process must be running as root, or admin authentication is required. Options: -d Import admin Trust Settings; default is user. verify-cert [-c certFile] [-r rootCertFile] [-p policy] [-C] [-d date] [-k keychain] [-n name] [-N] [-L] [-l] [-e emailAddress] [-s sslHost] [-q] [-R revCheckOption] [-P] [-t] [-v] [url] Verify one or more certificates. If a direct URL argument is provided, a TLS connection is attempted and the certificate presented by that server is evaluated according to standard SSL server policy; other certificates or policy options will be ignored in this case. Options: -c certFile Certificate to verify, in DER or PEM format. Can be specified more than once; leaf certificate has to be specified first. -r rootCertFile Root certificate, in DER or PEM format. Can be specified more than once. If not specified, the system anchor certificates are used. If one root certificate is specified, and zero (non-root) certificates are specified, the root certificate is verified against itself. -p policy Specify verification policy (ssl, smime, codeSign, IPSec, basic, swUpdate, pkgSign, eap, appleID, macappstore, timestamping). Default is basic. -C Specify this evaluation is for client usage, if the verification policy (e.g. ssl) distinguishes between client and server usage. Default is server usage. -d date Date to set for verification. Specified in the format of YYYY-MM-DD-hh:mm:ss (time optional). e.g: 2016-04-25-15:59:59 for April 25, 2016 at 3:59:59 pm in GMT -k keychain Keychain to search for intermediate CA certificates. Can be specified multiple times. Default is the current user's keychain search list. -n name Specify a name to be verified, e.g. the SSL host name for the ssl policy, or RFC822 email address for the smime policy. For backward compatibility, if the -n option is provided without an argument, it will be interpreted as equivalent to -N. -N Avoid searching any keychains. -L Use local certificates only. If an issuing CA certificate is missing, this option will avoid accessing the network to fetch it. -l Specifies that the leaf certificate is a CA cert. By default, a leaf certificate with a Basic Constraints extension with the CA bit set fails verification. -e emailAddress Specify email address for the smime policy. (This option is deprecated; use -n instead.) -s sslHost Specify SSL host name for the ssl policy. (This option is deprecated; use -n instead.) -q Quiet, no stdout or stderr. -R revCheckOption Specify a revocation checking option for this evaluation (ocsp, require, offline). Can be specified multiple times; e.g. to enable revocation checking via the OCSP method and require a positive response, use "-R ocsp -R require". The offline option will consult previously cached responses, but will not make a request to a revocation server. -P Output the constructed certificate chain in PEM format. -t Output certificate contents as text. -v Specify verbose output, including per- certificate trust results. security> verify-cert -c applestore0.cer -c applestore1.cer -p ssl -n store.apple.com security> verify-cert -r serverbasic.crt security> verify-cert -v https://www.apple.com authorize [-updPiew] [right...] Authorize requested right(s). The extend-rights flag will be passed by default. Options: -u Allow user interaction. -p Allow returning partial rights. -d Destroy acquired rights. -P Pre-authorize rights only. -l Operate authorization in least privileged mode. -i Internalize authref passed on stdin. -e Externalize authref to stdout -w Wait while holding AuthorizationRef until stdout is closed. This will allow client to read externalized AuthorizationRef from pipe. security> security authorize -ud my-right Basic authorization of my-right. security> security -q authorize -uew my-right | security -q authorize -i my-right Authorizing a right and passing it to another command as a way to add authorization to shell scripts. authorizationdb read <right-name> authorizationdb write <right-name> [allow|deny|<rulename>] authorizationdb remove <right-name> Read/Modify authorization policy database. Without a rulename write will read a dictionary as a plist from stdin. security> security authorizationdb read system.privilege.admin > /tmp/aewp-def Read definition of system.privilege.admin right. security> security authorizationdb write system.preferences < /tmp/aewp-def Set system.preferences to definition of system.privilege.admin right. security> security authorizationdb write system.preferences authenticate-admin Every change to preferences requires an Admin user to authenticate. execute-with-privileges <program> [args...] Execute tool with privileges. On success stdin will be read and forwarded to the tool. leaks [-h] [-cycles] [-nocontext] [-nostacks] [-exclude symbol] Run /usr/bin/leaks on this process. This can help find memory leaks after running certain commands. Options: -cycles Use a stricter algorithm (See leaks(1) for details). -nocontext Withhold the hex dumps of the leaked memory. -nostacks Don't show stack traces of leaked memory. -exclude symbol Ignore leaks called from symbol. smartcards token [-l] [-e token] [-d token] Enable, disable or list disabled smartcard tokens. Options: -l List disabled smartcard tokens. -e token Enable smartcard token. -d token Disable smartcard token. To list tokens available in the system pluginkit -m -p com.apple.ctk-tokens security smartcards token -l security smartcards token -d com.apple.CryptoTokenKit.pivtoken security smartcards token -e com.apple.CryptoTokenKit.pivtoken list-smartcards Display ids of available smartcards. export-smartcard token [-i id] [-t certs|privKeys|identities|all] [-e exportPath] Export/display items from a smartcard. If id isn't provided, items from all smartcards will be displayed. Options: -i id Export/display items from token specified by token id, available ids can be listed by list-smartcards command. -t certs|privKeys|identities|all Display items of the specified type (Default: all) -e exportPath Specify path to export certificates and public keys. If exportPath is specified screen output is suppressed. This option cannot be combined with -t option. error [-h] [<error code(s)...>] Display an error string for the given security-related error code. The error can be in decimal or hex, e.g. 1234 or 0x1234. Multiple errors can be separated by spaces. ENVIRONMENT MallocStackLogging When using the leaks command or the -l option it's probably a good idea to set this environment variable before security is started. Doing so will allow leaks to display symbolic backtraces. FILES ~/Library/Preferences/com.apple.security.plist Property list file containing the current user's default keychain and keychain search list. /Library/Preferences/com.apple.security.plist Property list file containing the system default keychain and keychain search list. This is used by processes started at boot time, or those requesting to use the system search domain, such as system daemons. /Library/Preferences/com.apple.security-common.plist Property list file containing the common keychain search list, which is appended to every user's search list and to the system search list. SEE ALSO certtool(1), leaks(1), pluginkit(8) HISTORY security was first introduced in Mac OS X version 10.3. BUGS security still needs more commands before it can be considered complete. In particular, it should someday supersede both the certtool and systemkeychain commands. Darwin March 15, 2017 Darwin
perlthanks5.34
This program is designed to help you generate bug reports (and thank- you notes) about perl5 and the modules which ship with it. In most cases, you can just run it interactively from a command line without any special arguments and follow the prompts. If you have found a bug with a non-standard port (one that was not part of the standard distribution), a binary distribution, or a non-core module (such as Tk, DBI, etc), then please see the documentation that came with that distribution to determine the correct place to report bugs. Bug reports should be submitted to the GitHub issue tracker at <https://github.com/Perl/perl5/issues>. The perlbug@perl.org address no longer automatically opens tickets. You can use this tool to compose your report and save it to a file which you can then submit to the issue tracker. In extreme cases, perlbug may not work well enough on your system to guide you through composing a bug report. In those cases, you may be able to use perlbug -d or perl -V to get system configuration information to include in your issue report. When reporting a bug, please run through this checklist: What version of Perl you are running? Type "perl -v" at the command line to find out. Are you running the latest released version of perl? Look at <http://www.perl.org/> to find out. If you are not using the latest released version, please try to replicate your bug on the latest stable release. Note that reports about bugs in old versions of Perl, especially those which indicate you haven't also tested the current stable release of Perl, are likely to receive less attention from the volunteers who build and maintain Perl than reports about bugs in the current release. Are you sure what you have is a bug? A significant number of the bug reports we get turn out to be documented features in Perl. Make sure the issue you've run into isn't intentional by glancing through the documentation that comes with the Perl distribution. Given the sheer volume of Perl documentation, this isn't a trivial undertaking, but if you can point to documentation that suggests the behaviour you're seeing is wrong, your issue is likely to receive more attention. You may want to start with perldoc perltrap for pointers to common traps that new (and experienced) Perl programmers run into. If you're unsure of the meaning of an error message you've run across, perldoc perldiag for an explanation. If the message isn't in perldiag, it probably isn't generated by Perl. You may have luck consulting your operating system documentation instead. If you are on a non-UNIX platform perldoc perlport, as some features may be unimplemented or work differently. You may be able to figure out what's going wrong using the Perl debugger. For information about how to use the debugger perldoc perldebug. Do you have a proper test case? The easier it is to reproduce your bug, the more likely it will be fixed -- if nobody can duplicate your problem, it probably won't be addressed. A good test case has most of these attributes: short, simple code; few dependencies on external commands, modules, or libraries; no platform-dependent code (unless it's a platform-specific bug); clear, simple documentation. A good test case is almost always a good candidate to be included in Perl's test suite. If you have the time, consider writing your test case so that it can be easily included into the standard test suite. Have you included all relevant information? Be sure to include the exact error messages, if any. "Perl gave an error" is not an exact error message. If you get a core dump (or equivalent), you may use a debugger (dbx, gdb, etc) to produce a stack trace to include in the bug report. NOTE: unless your Perl has been compiled with debug info (often -g), the stack trace is likely to be somewhat hard to use because it will most probably contain only the function names and not their arguments. If possible, recompile your Perl with debug info and reproduce the crash and the stack trace. Can you describe the bug in plain English? The easier it is to understand a reproducible bug, the more likely it will be fixed. Any insight you can provide into the problem will help a great deal. In other words, try to analyze the problem (to the extent you can) and report your discoveries. Can you fix the bug yourself? If so, that's great news; bug reports with patches are likely to receive significantly more attention and interest than those without patches. Please submit your patch via the GitHub Pull Request workflow as described in perldoc perlhack. You may also send patches to perl5-porters@perl.org. When sending a patch, create it using "git format-patch" if possible, though a unified diff created with "diff -pu" will do nearly as well. Your patch may be returned with requests for changes, or requests for more detailed explanations about your fix. Here are a few hints for creating high-quality patches: Make sure the patch is not reversed (the first argument to diff is typically the original file, the second argument your changed file). Make sure you test your patch by applying it with "git am" or the "patch" program before you send it on its way. Try to follow the same style as the code you are trying to patch. Make sure your patch really does work ("make test", if the thing you're patching is covered by Perl's test suite). Can you use "perlbug" to submit a thank-you note? Yes, you can do this by either using the "-T" option, or by invoking the program as "perlthanks". Thank-you notes are good. It makes people smile. Please make your issue title informative. "a bug" is not informative. Neither is "perl crashes" nor is "HELP!!!". These don't help. A compact description of what's wrong is fine. Having done your bit, please be prepared to wait, to be told the bug is in your code, or possibly to get no reply at all. The volunteers who maintain Perl are busy folks, so if your problem is an obvious bug in your own code, is difficult to understand or is a duplicate of an existing report, you may not receive a personal reply. If it is important to you that your bug be fixed, do monitor the issue tracker (you will be subscribed to notifications for issues you submit or comment on) and the commit logs to development versions of Perl, and encourage the maintainers with kind words or offers of frosty beverages. (Please do be kind to the maintainers. Harassing or flaming them is likely to have the opposite effect of the one you want.) Feel free to update the ticket about your bug on <https://github.com/Perl/perl5/issues> if a new version of Perl is released and your bug is still present.
perlbug - how to submit bug reports on Perl
perlbug perlbug [ -v ] [ -a address ] [ -s subject ] [ -b body | -f inputfile ] [ -F outputfile ] [ -r returnaddress ] [ -e editor ] [ -c adminaddress | -C ] [ -S ] [ -t ] [ -d ] [ -h ] [ -T ] perlbug [ -v ] [ -r returnaddress ] [ -ok | -okay | -nok | -nokay ] perlthanks
-a Address to send the report to instead of saving to a file. -b Body of the report. If not included on the command line, or in a file with -f, you will get a chance to edit the report. -C Don't send copy to administrator when sending report by mail. -c Address to send copy of report to when sending report by mail. Defaults to the address of the local perl administrator (recorded when perl was built). -d Data mode (the default if you redirect or pipe output). This prints out your configuration data, without saving or mailing anything. You can use this with -v to get more complete data. -e Editor to use. -f File containing the body of the report. Use this to quickly send a prepared report. -F File to output the results to. Defaults to perlbug.rep. -h Prints a brief summary of the options. -ok Report successful build on this system to perl porters. Forces -S and -C. Forces and supplies values for -s and -b. Only prompts for a return address if it cannot guess it (for use with make). Honors return address specified with -r. You can use this with -v to get more complete data. Only makes a report if this system is less than 60 days old. -okay As -ok except it will report on older systems. -nok Report unsuccessful build on this system. Forces -C. Forces and supplies a value for -s, then requires you to edit the report and say what went wrong. Alternatively, a prepared report may be supplied using -f. Only prompts for a return address if it cannot guess it (for use with make). Honors return address specified with -r. You can use this with -v to get more complete data. Only makes a report if this system is less than 60 days old. -nokay As -nok except it will report on older systems. -p The names of one or more patch files or other text attachments to be included with the report. Multiple files must be separated with commas. -r Your return address. The program will ask you to confirm its default if you don't use this option. -S Save or send the report without asking for confirmation. -s Subject to include with the report. You will be prompted if you don't supply one on the command line. -t Test mode. Makes it possible to command perlbug from a pipe or file, for testing purposes. -T Send a thank-you note instead of a bug report. -v Include verbose configuration data in the report. AUTHORS Kenneth Albanowski (<kjahds@kjahds.com>), subsequently doctored by Gurusamy Sarathy (<gsar@activestate.com>), Tom Christiansen (<tchrist@perl.com>), Nathan Torkington (<gnat@frii.com>), Charles F. Randall (<cfr@pobox.com>), Mike Guy (<mjtg@cam.ac.uk>), Dominic Dunlop (<domo@computer.org>), Hugo van der Sanden (<hv@crypt.org>), Jarkko Hietaniemi (<jhi@iki.fi>), Chris Nandor (<pudge@pobox.com>), Jon Orwant (<orwant@media.mit.edu>, Richard Foley (<richard.foley@rfi.net>), Jesse Vincent (<jesse@bestpractical.com>), and Craig A. Berry (<craigberry@mac.com>). SEE ALSO perl(1), perldebug(1), perldiag(1), perlport(1), perltrap(1), diff(1), patch(1), dbx(1), gdb(1) BUGS None known (guess what must have been used to report them?) perl v5.34.1 2024-04-13 PERLBUG(1)
null
hiutil
hiutil is used to create .helpindex files in the Latent Symantic Mapping (LSM) help format and .cshelpindex files in the Spotlight help format. It is also capable of examining Spotlight help indices using the modes listed below. To examine LSM indices, use a version of hiutil earlier than 2.0. Spotlight help indices are required in macOS Mojave or later. Spotlight indices are not compatible with versions earlier than macOS Mojave. The macOS help system automatically generates indices for local help books (see ~/Library/Caches/com.apple.helpd/). If your help content will be hosted remotely, you may want to manually generate an index to include with your remote help book. Creation, management, inspection, and information modes are listed directly below. Create and manage modes: -C, --create Create an index file at the location you specify. You must provide both a directory of HTML files to index and a path to an output file, which will be overwritten if the ouput file already exists. -I, --index-format Pass the index format type as either 'lsm' or 'corespotlight'. -P, --purge-caches Terminate Help Viewer and helpd if they are running and purge persisted Help Viewer related caches. Inspection and infomation modes: -A, --list-anchors List the index's anchors separated by newlines. -D, --list-anchor-dictionary List the index's anchor dictionary in XML. This includes a list of which files contain each anchor. -E, --list-index-versions List the index's version dictionary in XML. It describes the system environment on which the index was created. -F, --list-files List all the files included in the index, separated by newlines. You can use the -v option with this mode to get titles and descriptions as well. -H, --help Print out usage data. -M, --list-min-term-length List the index's minimum term length. -S, --list-stopwords List the index's stopwords separated by newlines. -T, --list-terms List the terms indexed in each file. -V, --version Print out the version of the tool. GENERAL OPTIONS These can be used with any mode. -f, --file Pass in the path to a file, either one to be created or one to be examined. -v, --verbose Specify verbose output. Errors are always shown, but passing this argument once prints out warnings also. Passing the argument twice prints out errors, warnings, and progress notes. CREATE OPTIONS These can only be used with the create mode. -1 Index one file at a time. The default is to use a queue to index several files in parallel. In combination with -vvv, this option can be useful in determining which file an error message is from. -a, --anchors Specify index anchors. The default is to have none. Without this flag, there will be no anchor dictionary in the index. -e, --exclude=PATTERN Exclude files that match the specified pattern. Uses NSPredicate's MATCHES comparison method on the file's path relative to the directory being indexed. This option can be passed as many times as necessary, once per pattern. Exclusions take precedence over files included with -i. -g, --generate-summaries Generate summary text. This can be slow, but is useful if you don't have DESCRIPTION meta tags on some pages. -i, --include=PATTERN Include files that match the specified pattern. Uses NSPredicate's MATCHES comparison method on the file's path relative to the directory being indexed. The default patterns to index are ".htm" and ".html". If these defaults are undesirable, you may use -e above to exclude them. This option can be passed as many times as necessary, once per pattern. -m, --min-term-length=NUM Specify a minimum term length. The value can be 1, 2 or 3. It represents the number of consecutive tokens (typically a character) required for a term not to be ignored by the indexer. Recommended values are 3 for English and 1 for Chinese and other ideographic languages. -r, --remote-url=URL Include a remote URL with the index. This is only useful in Type 1 or Type 2 help books, because the URL is in the help bundle's Info.plist for Type 3 books. The URL should be fully qualified. For example: https://www.mycompany.com/help_v1/ -s, --stopwords=LANG|PATH Use stopwords. If you have your own stopwords .plist, provide that path. Otherwise, pass the two-character language code. For example: en English es Spanish de German fr French hu Hungarian it Italian sv Swedish -l, --locale=LANG Specify a locale for the index. Instead of having to boot into the locale to index, pass the language code or locale identifier here to index for that language. Example locale identifiers: en_US US English es_ES Spanish de German fr French hu Hungarian ru_RU Russian FILES /usr/share/hiutil/Stopwords.plist List of default stopwords in different languages
hiutil – utility for creating and examining Help Viewer indices
hiutil -I FORMAT -Cf file [-1agv] [-m NUM] [-s LANG | PATH] [-r URL] [-t EXT] dir hiutil [-ADEFMST] -f file
null
Create .cshelpindex file from a directory of HTML help: hiutil -I corespotlight -Caf /pathto/myhelp.cshelpindex /pathto/myhelpdir/ Inspect the anchors in a .cshelpindex file: hiutil -I corespotlight -Af /pathto/myhelp.cshelpindex Verbosely inspect the terms in a .cshelpindex file: hiutil -I corespotlight -Tvf /pathto/myhelp.cshelpindex NOTES hiutil requires macOS 10.14 or later. Darwin 05/22/2019 Darwin
ip2cc5.30
Ip2cc is a program to lookup countries of IP addresses. Ip2cc has two modes: interactive and non-interactive. Interactive mode allows the user to query more than one hostname. Non-interactive mode is used to print just the country for a single host. ARGUMENTS Interactive mode is entered when no arguments are given. Non-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. SEE ALSO IP::Country - the fast database used by this script. AUTHOR Nigel Wetters Gourlay <nwetters@cpan.org> perl v5.30.3 2024-04-13 IP2CC(1)
ip2cc - lookup country from IP address or hostname
ip2cc [host-to-find]
null
null
json_xs5.34
json_xs converts between some input and output formats (one of them is JSON). The default input format is "json" and the default output format is "json-pretty".
json_xs - JSON::XS commandline utility
json_xs [-v] [-f inputformat] [-t outputformat]
-v Be slightly more verbose. -f fromformat Read a file in the given format from STDIN. "fromformat" can be one of: json - a json text encoded, either utf-8, utf16-be/le, utf32-be/le cbor - CBOR (RFC 7049, CBOR::XS), a kind of binary JSON storable - a Storable frozen value storable-file - a Storable file (Storable has two incompatible formats) bencode - use Convert::Bencode, if available (used by torrent files, among others) clzf - Compress::LZF format (requires that module to be installed) eval - evaluate the given code as (non-utf-8) Perl, basically the reverse of "-t dump" yaml - YAML format (requires that module to be installed) string - do not attempt to decode the file data none - nothing is read, creates an "undef" scalar - mainly useful with "-e" -t toformat Write the file in the given format to STDOUT. "toformat" can be one of: json, json-utf-8 - json, utf-8 encoded json-pretty - as above, but pretty-printed json-utf-16le, json-utf-16be - little endian/big endian utf-16 json-utf-32le, json-utf-32be - little endian/big endian utf-32 cbor - CBOR (RFC 7049, CBOR::XS), a kind of binary JSON cbor-packed - CBOR using extensions to make it smaller storable - a Storable frozen value in network format storable-file - a Storable file in network format (Storable has two incompatible formats) bencode - use Convert::Bencode, if available (used by torrent files, among others) clzf - Compress::LZF format yaml - YAML::XS format dump - Data::Dump dumper - Data::Dumper string - writes the data out as if it were a string none - nothing gets written, mainly useful together with "-e" Note that Data::Dumper doesn't handle self-referential data structures correctly - use "dump" instead. -e code Evaluate perl code after reading the data and before writing it out again - can be used to filter, create or extract data. The data that has been written is in $_, and whatever is in there is written out afterwards.
json_xs -t none <isitreally.json "JSON Lint" - tries to parse the file isitreally.json as JSON - if it is valid JSON, the command outputs nothing, otherwise it will print an error message and exit with non-zero exit status. <src.json json_xs >pretty.json Prettify the JSON file src.json to dst.json. json_xs -f storable-file <file Read the serialised Storable file file and print a human-readable JSON version of it to STDOUT. json_xs -f storable-file -t yaml <file Same as above, but write YAML instead (not using JSON at all :) json_xs -f none -e '$_ = [1, 2, 3]' Dump the perl array as UTF-8 encoded JSON text. <torrentfile json_xs -f bencode -e '$_ = join "\n", map @$_, @{$_->{"announce-list"}}' -t string Print the tracker list inside a torrent file. lwp-request http://cpantesters.perl.org/show/JSON-XS.json | json_xs Fetch the cpan-testers result summary "JSON::XS" and pretty-print it. AUTHOR Copyright (C) 2008 Marc Lehmann <json@schmorp.de> perl v5.34.0 2018-11-15 JSON_XS(1)
pip3
null
null
null
null
null
pod2man5.34
pod2man is a front-end for Pod::Man, using it to generate *roff input from POD source. The resulting *roff code is suitable for display on a terminal using nroff(1), normally via man(1), or printing using troff(1). input is the file to read for POD source (the POD can be embedded in code). If input isn't given, it defaults to "STDIN". output, if given, is the file to which to write the formatted output. If output isn't given, the formatted output is written to "STDOUT". Several POD files can be processed in the same pod2man invocation (saving module load and compile times) by providing multiple pairs of input and output files on the command line. --section, --release, --center, --date, and --official can be used to set the headers and footers to use; if not given, Pod::Man will assume various defaults. See below or Pod::Man for details. pod2man assumes that your *roff formatters have a fixed-width font named "CW". If yours is called something else (like "CR"), use --fixed to specify it. This generally only matters for troff output for printing. Similarly, you can set the fonts used for bold, italic, and bold italic fixed-width output. Besides the obvious pod conversions, Pod::Man, and therefore pod2man also takes care of formatting func(), func(n), and simple variable references like $foo or @bar so you don't have to use code escapes for them; complex expressions like $fred{'stuff'} will still need to be escaped, though. It also translates dashes that aren't used as hyphens into en dashes, makes long dashes--like this--into proper em dashes, fixes "paired quotes," and takes care of several other troff-specific tweaks. See Pod::Man for complete information.
pod2man - Convert POD data to formatted *roff input
pod2man [--center=string] [--date=string] [--errors=style] [--fixed=font] [--fixedbold=font] [--fixeditalic=font] [--fixedbolditalic=font] [--name=name] [--nourls] [--official] [--release=version] [--section=manext] [--quotes=quotes] [--lquote=quote] [--rquote=quote] [--stderr] [--utf8] [--verbose] [input [output] ...] pod2man --help
-c string, --center=string Sets the centered page header for the ".TH" macro to string. The default is "User Contributed Perl Documentation", but also see --official below. -d string, --date=string Set the left-hand footer string for the ".TH" macro to string. By default, the modification date of the input file will be used, or the current date if input comes from "STDIN", and will be based on UTC (so that the output will be reproducible regardless of local time zone). --errors=style Set the error handling style. "die" says to throw an exception on any POD formatting error. "stderr" says to report errors on standard error, but not to throw an exception. "pod" says to include a POD ERRORS section in the resulting documentation summarizing the errors. "none" ignores POD errors entirely, as much as possible. The default is "die". --fixed=font The fixed-width font to use for verbatim text and code. Defaults to "CW". Some systems may want "CR" instead. Only matters for troff(1) output. --fixedbold=font Bold version of the fixed-width font. Defaults to "CB". Only matters for troff(1) output. --fixeditalic=font Italic version of the fixed-width font (actually, something of a misnomer, since most fixed-width fonts only have an oblique version, not an italic version). Defaults to "CI". Only matters for troff(1) output. --fixedbolditalic=font Bold italic (probably actually oblique) version of the fixed-width font. Pod::Man doesn't assume you have this, and defaults to "CB". Some systems (such as Solaris) have this font available as "CX". Only matters for troff(1) output. -h, --help Print out usage information. -l, --lax No longer used. pod2man used to check its input for validity as a manual page, but this should now be done by podchecker(1) instead. Accepted for backward compatibility; this option no longer does anything. --lquote=quote --rquote=quote Sets the quote marks used to surround C<> text. --lquote sets the left quote mark and --rquote sets the right quote mark. Either may also be set to the special value "none", in which case no quote mark is added on that side of C<> text (but the font is still changed for troff output). Also see the --quotes option, which can be used to set both quotes at once. If both --quotes and one of the other options is set, --lquote or --rquote overrides --quotes. -n name, --name=name Set the name of the manual page for the ".TH" macro to name. Without this option, the manual name is set to the uppercased base name of the file being converted unless the manual section is 3, in which case the path is parsed to see if it is a Perl module path. If it is, a path like ".../lib/Pod/Man.pm" is converted into a name like "Pod::Man". This option, if given, overrides any automatic determination of the name. Although one does not have to follow this convention, be aware that the convention for UNIX man pages for commands is for the man page title to be in all-uppercase, even if the command isn't. This option is probably not useful when converting multiple POD files at once. When converting POD source from standard input, the name will be set to "STDIN" if this option is not provided. Providing this option is strongly recommended to set a meaningful manual page name. --nourls Normally, L<> formatting codes with a URL but anchor text are formatted to show both the anchor text and the URL. In other words: L<foo|http://example.com/> is formatted as: foo <http://example.com/> This flag, if given, suppresses the URL when anchor text is given, so this example would be formatted as just "foo". This can produce less cluttered output in cases where the URLs are not particularly important. -o, --official Set the default header to indicate that this page is part of the standard Perl release, if --center is not also given. -q quotes, --quotes=quotes Sets the quote marks used to surround C<> text to quotes. If quotes is a single character, it is used as both the left and right quote. Otherwise, it is split in half, and the first half of the string is used as the left quote and the second is used as the right quote. quotes may also be set to the special value "none", in which case no quote marks are added around C<> text (but the font is still changed for troff output). Also see the --lquote and --rquote options, which can be used to set the left and right quotes independently. If both --quotes and one of the other options is set, --lquote or --rquote overrides --quotes. -r version, --release=version Set the centered footer for the ".TH" macro to version. By default, this is set to the version of Perl you run pod2man under. Setting this to the empty string will cause some *roff implementations to use the system default value. Note that some system "an" macro sets assume that the centered footer will be a modification date and will prepend something like "Last modified: ". If this is the case for your target system, you may want to set --release to the last modified date and --date to the version number. -s string, --section=string Set the section for the ".TH" macro. The standard section numbering convention is to use 1 for user commands, 2 for system calls, 3 for functions, 4 for devices, 5 for file formats, 6 for games, 7 for miscellaneous information, and 8 for administrator commands. There is a lot of variation here, however; some systems (like Solaris) use 4 for file formats, 5 for miscellaneous information, and 7 for devices. Still others use 1m instead of 8, or some mix of both. About the only section numbers that are reliably consistent are 1, 2, and 3. By default, section 1 will be used unless the file ends in ".pm", in which case section 3 will be selected. --stderr By default, pod2man dies if any errors are detected in the POD input. If --stderr is given and no --errors flag is present, errors are sent to standard error, but pod2man does not abort. This is equivalent to "--errors=stderr" and is supported for backward compatibility. -u, --utf8 By default, pod2man produces the most conservative possible *roff output to try to ensure that it will work with as many different *roff implementations as possible. Many *roff implementations cannot handle non-ASCII characters, so this means all non-ASCII characters are converted either to a *roff escape sequence that tries to create a properly accented character (at least for troff output) or to "X". This option says to instead output literal UTF-8 characters. If your *roff implementation can handle it, this is the best output format to use and avoids corruption of documents containing non- ASCII characters. However, be warned that *roff source with literal UTF-8 characters is not supported by many implementations and may even result in segfaults and other bad behavior. Be aware that, when using this option, the input encoding of your POD source should be properly declared unless it's US-ASCII. Pod::Simple will attempt to guess the encoding and may be successful if it's Latin-1 or UTF-8, but it will warn, which by default results in a pod2man failure. Use the "=encoding" command to declare the encoding. See perlpod(1) for more information. -v, --verbose Print out the name of each output file as it is being generated. EXIT STATUS As long as all documents processed result in some output, even if that output includes errata (a "POD ERRORS" section generated with "--errors=pod"), pod2man will exit with status 0. If any of the documents being processed do not result in an output document, pod2man will exit with status 1. If there are syntax errors in a POD document being processed and the error handling style is set to the default of "die", pod2man will abort immediately with exit status 255. DIAGNOSTICS If pod2man fails with errors, see Pod::Man and Pod::Simple for information about what those errors might mean.
pod2man program > program.1 pod2man SomeModule.pm /usr/perl/man/man3/SomeModule.3 pod2man --section=7 note.pod > note.7 If you would like to print out a lot of man page continuously, you probably want to set the C and D registers to set contiguous page numbering and even/odd paging, at least on some versions of man(7). troff -man -rC1 -rD1 perl.1 perldata.1 perlsyn.1 ... To get index entries on "STDERR", turn on the F register, as in: troff -man -rF1 perl.1 The indexing merely outputs messages via ".tm" for each major page, section, subsection, item, and any "X<>" directives. See Pod::Man for more details. BUGS Lots of this documentation is duplicated from Pod::Man. AUTHOR Russ Allbery <rra@cpan.org>, based very heavily on the original pod2man by Larry Wall and Tom Christiansen. COPYRIGHT AND LICENSE Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2019 Russ Allbery <rra@cpan.org> This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO Pod::Man, Pod::Simple, man(1), nroff(1), perlpod(1), podchecker(1), perlpodstyle(1), troff(1), man(7) The man page documenting the an macro set may be man(5) instead of man(7) on your system. The current version of this script is always available from its web site at <https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the Perl core distribution as of 5.6.0. perl v5.34.1 2024-04-13 POD2MAN(1)
lastwords
This prints the last few system calls for processes matching the given name, when they exit. This makes use of a ring buffer so that the impact on the system is minimised. Since this uses DTrace, only users with root privileges can run this command.
lastwords - print syscalls before exit. Uses DTrace.
lastwords command
null
Catch last few syscalls for dying netscape processes, # lastwords netscape FIELDS TIME time of syscall return, ns PID process ID EXEC process name (execname) SYSCALL system call RETURN return value for the system call ERR errno for the system call BASED ON /usr/demo/dtrace/ring.d DOCUMENTATION DTrace Guide "Buffers and Buffering" chapter (docs.sun.com) See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with verbose descriptions explaining the output. EXIT lastwords will sample until a command with that name exits. SEE ALSO dtruss(1M), dtrace(1M) version 0.70 June 8, 2005 lastwords(1m)
rmid
null
null
null
null
null
sed
The sed utility reads the specified files, or the standard input if no files are specified, modifying the input as specified by a list of commands. The input is then written to the standard output. A single command may be specified as the first argument to sed. Multiple commands may be specified by using the -e or -f options. All commands are applied to the input in the order they are specified regardless of their origin. The following options are available: -E Interpret regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's). The re_format(7) manual page fully describes both formats. -a The files listed as parameters for the “w” functions are created (or truncated) before any processing begins, by default. The -a option causes sed to delay opening each file until a command containing the related “w” function is applied to a line of input. -e command Append the editing commands specified by the command argument to the list of commands. -f command_file Append the editing commands found in the file command_file to the list of commands. The editing commands should each be listed on a separate line. The commands are read from the standard input if command_file is “-”. -I extension Edit files in-place, saving backups with the specified extension. If a zero-length extension is given, no backup will be saved. It is not recommended to give a zero-length extension when in-place editing files, as you risk corruption or partial content in situations where disk space is exhausted, etc. Note that in-place editing with -I still takes place in a single continuous line address space covering all files, although each file preserves its individuality instead of forming one output stream. The line counter is never reset between files, address ranges can span file boundaries, and the “$” address matches only the last line of the last file. (See Sed Addresses.) That can lead to unexpected results in many cases of in-place editing, where using -i is desired. -i extension Edit files in-place similarly to -I, but treat each file independently from other files. In particular, line numbers in each file start at 1, the “$” address matches the last line of the current file, and address ranges are limited to the current file. (See Sed Addresses.) The net result is as though each file were edited by a separate sed instance. -l Make output line buffered. -n By default, each line of input is echoed to the standard output after all of the commands have been applied to it. The -n option suppresses this behavior. -r Same as -E for compatibility with GNU sed. -u Make output unbuffered. The form of a sed command is as follows: [address[,address]]function[arguments] Whitespace may be inserted before the first address and the function portions of the command. Normally, sed cyclically copies a line of input, not including its terminating newline character, into a pattern space, (unless there is something left after a “D” function), applies all of the commands with addresses that select that pattern space, copies the pattern space to the standard output, appending a newline, and deletes the pattern space. Some of the functions use a hold space to save all or part of the pattern space for subsequent retrieval. Sed Addresses An address is not required, but if specified must have one of the following formats: • a number that counts input lines cumulatively across input files (or in each file independently if a -i option is in effect); • a dollar (“$”) character that addresses the last line of input (or the last line of the current file if a -i option was specified); • a context address that consists of a regular expression preceded and followed by a delimiter. The closing delimiter can also optionally be followed by the “I” character, to indicate that the regular expression is to be matched in a case-insensitive way. A command line with no addresses selects every pattern space. A command line with one address selects all of the pattern spaces that match the address. A command line with two addresses selects an inclusive range. This range starts with the first pattern space that matches the first address. The end of the range is the next following pattern space that matches the second address. If the second address is a number less than or equal to the line number first selected, only that line is selected. The number in the second address may be prefixed with a (“+”) to specify the number of lines to match after the first pattern. In the case when the second address is a context address, sed does not re-match the second address against the pattern space that matched the first address. Starting at the first line following the selected range, sed starts looking again for the first address. Editing commands can be applied to non-selected pattern spaces by use of the exclamation character (“!”) function. Sed Regular Expressions The regular expressions used in sed, by default, are basic regular expressions (BREs, see re_format(7) for more information), but extended (modern) regular expressions can be used instead if the -E flag is given. In addition, sed has the following two additions to regular expressions: 1. In a context address, any character other than a backslash (“\”) or newline character may be used to delimit the regular expression. The opening delimiter needs to be preceded by a backslash unless it is a slash. For example, the context address \xabcx is equivalent to /abc/. Also, putting a backslash character before the delimiting character within the regular expression causes the character to be treated literally. For example, in the context address \xabc\xdefx, the RE delimiter is an “x” and the second “x” stands for itself, so that the regular expression is “abcxdef”. 2. The escape sequence \n matches a newline character embedded in the pattern space. You cannot, however, use a literal newline character in an address or in the substitute command. One special feature of sed regular expressions is that they can default to the last regular expression used. If a regular expression is empty, i.e., just the delimiter characters are specified, the last regular expression encountered is used instead. The last regular expression is defined as the last regular expression used as part of an address or substitute command, and at run-time, not compile-time. For example, the command “/abc/s//XXX/” will substitute “XXX” for the pattern “abc”. Sed Functions In the following list of commands, the maximum number of permissible addresses for each command is indicated by [0addr], [1addr], or [2addr], representing zero, one, or two addresses. The argument text consists of one or more lines. To embed a newline in the text, precede it with a backslash. Other backslashes in text are deleted and the following character taken literally. The “r” and “w” functions take an optional file parameter, which should be separated from the function letter by white space. Each file given as an argument to sed is created (or its contents truncated) before any input processing begins. The “b”, “r”, “s”, “t”, “w”, “y”, “!”, and “:” functions all accept additional arguments. The following synopses indicate which arguments have to be separated from the function letters by white space characters. Two of the functions take a function-list. This is a list of sed functions separated by newlines, as follows: { function function ... function } The “{” can be preceded by white space and can be followed by white space. The function can be preceded by white space. The terminating “}” must be preceded by a newline, and may also be preceded by white space. [2addr] function-list Execute function-list only when the pattern space is selected. [1addr]a\ text Write text to standard output immediately before each attempt to read a line of input, whether by executing the “N” function or by beginning a new cycle. [2addr]b[label] Branch to the “:” function with the specified label. If the label is not specified, branch to the end of the script. [2addr]c\ text Delete the pattern space. With 0 or 1 address or at the end of a 2-address range, text is written to the standard output. [2addr]d Delete the pattern space and start the next cycle. [2addr]D Delete the initial segment of the pattern space through the first newline character and start the next cycle. [2addr]g Replace the contents of the pattern space with the contents of the hold space. [2addr]G Append a newline character followed by the contents of the hold space to the pattern space. [2addr]h Replace the contents of the hold space with the contents of the pattern space. [2addr]H Append a newline character followed by the contents of the pattern space to the hold space. [1addr]i\ text Write text to the standard output. [2addr]l (The letter ell.) Write the pattern space to the standard output in a visually unambiguous form. This form is as follows: backslash \\ alert \a form-feed \f carriage-return \r tab \t vertical tab \v Nonprintable characters are written as three-digit octal numbers (with a preceding backslash) for each byte in the character (most significant byte first). Long lines are folded, with the point of folding indicated by displaying a backslash followed by a newline. The end of each line is marked with a “$”. [2addr]n Write the pattern space to the standard output if the default output has not been suppressed, and replace the pattern space with the next line of input. [2addr]N Append the next line of input to the pattern space, using an embedded newline character to separate the appended material from the original contents. Note that the current line number changes. [2addr]p Write the pattern space to standard output. [2addr]P Write the pattern space, up to the first newline character to the standard output. [1addr]q Branch to the end of the script and quit without starting a new cycle. [1addr]r file Copy the contents of file to the standard output immediately before the next attempt to read a line of input. If file cannot be read for any reason, it is silently ignored and no error condition is set. [2addr]s/regular expression/replacement/flags Substitute the replacement string for the first instance of the regular expression in the pattern space. Any character other than backslash or newline can be used instead of a slash to delimit the RE and the replacement. Within the RE and the replacement, the RE delimiter itself can be used as a literal character if it is preceded by a backslash. An ampersand (“&”) appearing in the replacement is replaced by the string matching the RE. The special meaning of “&” in this context can be suppressed by preceding it by a backslash. The string “\#”, where “#” is a digit, is replaced by the text matched by the corresponding backreference expression (see re_format(7)). A line can be split by substituting a newline character into it. To specify a newline character in the replacement string, precede it with a backslash. The value of flags in the substitute function is zero or more of the following: N Make the substitution only for the N'th occurrence of the regular expression in the pattern space. g Make the substitution for all non-overlapping matches of the regular expression, not just the first one. p Write the pattern space to standard output if a replacement was made. If the replacement string is identical to that which it replaces, it is still considered to have been a replacement. w file Append the pattern space to file if a replacement was made. If the replacement string is identical to that which it replaces, it is still considered to have been a replacement. i or I Match the regular expression in a case-insensitive way. [2addr]t [label] Branch to the “:” function bearing the label if any substitutions have been made since the most recent reading of an input line or execution of a “t” function. If no label is specified, branch to the end of the script. [2addr]w file Append the pattern space to the file. [2addr]x Swap the contents of the pattern and hold spaces. [2addr]y/string1/string2/ Replace all occurrences of characters in string1 in the pattern space with the corresponding characters from string2. Any character other than a backslash or newline can be used instead of a slash to delimit the strings. Within string1 and string2, a backslash followed by any character other than a newline is that literal character, and a backslash followed by an ``n'' is replaced by a newline character. [2addr]!function [2addr]!function-list Apply the function or function-list only to the lines that are not selected by the address(es). [0addr]:label This function does nothing; it bears a label to which the “b” and “t” commands may branch. [1addr]= Write the line number to the standard output followed by a newline character. [0addr] Empty lines are ignored. [0addr]# The “#” and the remainder of the line are ignored (treated as a comment), with the single exception that if the first two characters in the file are “#n”, the default output is suppressed. This is the same as specifying the -n option on the command line. ENVIRONMENT The COLUMNS, LANG, LC_ALL, LC_CTYPE and LC_COLLATE environment variables affect the execution of sed as described in environ(7). EXIT STATUS The sed utility exits 0 on success, and >0 if an error occurs.
sed – stream editor
sed [-Ealnru] command [-I extension] [-i extension] [file ...] sed [-Ealnru] [-e command] [-f command_file] [-I extension] [-i extension] [file ...]
null
Replace ‘bar’ with ‘baz’ when piped from another command: echo "An alternate word, like bar, is sometimes used in examples." | sed 's/bar/baz/' Using backlashes can sometimes be hard to read and follow: echo "/home/example" | sed 's/\/home\/example/\/usr\/local\/example/' Using a different separator can be handy when working with paths: echo "/home/example" | sed 's#/home/example#/usr/local/example#' Replace all occurances of ‘foo’ with ‘bar’ in the file test.txt, without creating a backup of the file: sed -i '' -e 's/foo/bar/g' test.txt SEE ALSO awk(1), ed(1), grep(1), regex(3), re_format(7) STANDARDS The sed utility is expected to be a superset of the IEEE Std 1003.2 (“POSIX.2”) specification. The -E, -I, -a and -i options, the special meaning of -f -, the prefixing “+” in the second member of an address range, as well as the “I” flag to the address regular expression and substitution command are non-standard FreeBSD extensions and may not be available on other operating systems. HISTORY A sed command, written by L. E. McMahon, appeared in Version 7 AT&T UNIX. AUTHORS Diomidis D. Spinellis <dds@FreeBSD.org> BUGS Multibyte characters containing a byte with value 0x5C (ASCII ‘\’) may be incorrectly treated as line continuation characters in arguments to the “a”, “c” and “i” commands. Multibyte characters cannot be used as delimiters with the “s” and “y” commands. macOS 14.5 June 10, 2020 macOS 14.5
ld
The ld command combines several object files and libraries, resolves references, and produces an output file. ld can produce a final linked image (executable, dylib, or bundle), or with the -r option, produce another object file. If the -o option is not used, the output file produced is named "a.out". Universal The linker accepts universal (multiple-architecture) input files, but always creates a "thin" (single-architecture), standard Mach-O output file. The architecture for the output file is specified using the -arch option. If this option is not used, ld attempts to determine the output architecture by examining the object files in command line order. The first "thin" architecture determines that of the output file. If no input object file is a "thin" file, the native 32-bit architecture for the host is used. Usually, ld is not used directly. Instead the compiler driver invokes ld. The compiler driver can be passed multiple -arch options and it will create a universal final linked image by invoking ld multiple times and then running lipo(1) merge the outputs into a universal file. Layout The object files are loaded in the order in which they are specified on the command line. The segments and the sections in those segments will appear in the output file in the order they are encountered in the object files being linked. All zero fill sections will appear after all non- zero fill sections in their segments. Libraries A static library (aka static archive) is a collection of .o files with a table of contents that lists the global symbols in the .o files. ld will only pull .o files out of a static library if needed to resolve some symbol reference. Unlike traditional linkers, ld will continually search a static library while linking. There is no need to specify a static library multiple times on the command line. A dynamic library (aka dylib or framework) is a final linked image. Putting a dynamic library on the command line causes two things: 1) The generated final linked image will have encoded that it depends on that dynamic library. 2) Exported symbols from the dynamic library are used to resolve references. Both dynamic and static libraries are searched as they appear on the command line. Search paths ld maintains a list of directories to search for a library or framework to use. The default library search path is /usr/lib then /usr/local/lib. The -L option will add a new library search path. The default framework search path is /Library/Frameworks then /System/Library/Frameworks. (Note: previously, /Network/Library/Frameworks was at the end of the default path. If you need that functionality, you need to explicitly add -F/Network/Library/Frameworks). The -F option will add a new framework search path. The -Z option will remove the standard search paths. The -syslibroot option will prepend a prefix to all search paths. Two-level namespace By default all references resolved to a dynamic library record the library to which they were resolved. At runtime, dyld uses that information to directly resolve symbols. The alternative is to use the -flat_namespace option. With flat namespace, the library is not recorded. At runtime, dyld will search each dynamic library in load order when resolving symbols. This is slower, but more like how other operating systems resolve symbols. Indirect dynamic libraries If the command line specifies to link against dylib A, and when dylib A was built it linked against dylib B, then B is considered an indirect dylib. When linking for two-level namespace, ld does not look at indirect dylibs, except when re-exported by a direct dylibs. On the other hand when linking for flat namespace, ld does load all indirect dylibs and uses them to resolve references. Even though indirect dylibs are specified via a full path, ld first uses the specified search paths to locate each indirect dylib. If one cannot be found using the search paths, the full path is used. Dynamic libraries undefines When linking for two-level namespace, ld does not verify that undefines in dylibs actually exist. But when linking for flat namespace, ld does check that all undefines from all loaded dylibs have a matching definition. This is sometimes used to force selected functions to be loaded from a static library.
ld – linker
ld files... [options] [-o outputfile]
Options that control the kind of output -execute The default. Produce a mach-o main executable that has file type MH_EXECUTE. -dylib Produce a mach-o shared library that has file type MH_DYLIB. -bundle Produce a mach-o bundle that has file type MH_BUNDLE. -r Merges object files to produce another mach-o object file with file type MH_OBJECT. -dylinker Produce a mach-o dylinker that has file type MH_DYLINKER. Only used when building dyld. -dynamic The default. Implied by -dylib, -bundle, or -execute -static Produces a mach-o file that does not use the dyld. Only used building the kernel. -preload Produces a mach-o file in which the mach_header, load commands, and symbol table are not in any segment. This output type is used for firmware or embedded development where the segments are copied out of the mach-o into ROM/Flash. -arch arch_name Specifies which architecture (e.g. ppc, ppc64, i386, x86_64) the output file should be. -o path Specifies the name and location of the output file. If not specified, `a.out' is used. Options that control libraries -lx This option tells the linker to search for libx.dylib or libx.a in the library search path. If string x is of the form y.o, then that file is searched for in the same places, but without prepending `lib' or appending `.a' or `.dylib' to the filename. -needed-lx This is the same as the -lx but means to really link with the dylib even if no symbols are used from it. Thus, it can be used suppress warnings about unused dylibs. -reexport-lx This is the same as the -lx but specifies that the all symbols in library x should be available to clients linking to the library being created. This was previously done with a separate -sub_library option. -upward-lx This is the same as the -lx but specifies that the dylib is an upward dependency. -hidden-lx This is the same as the -lx for locating a static library, but treats all global symbols from the static library as if they are visibility hidden. Useful when building a dynamic library that uses a static library but does not want to export anything from that static library. -weak-lx This is the same as the -lx but forces the library and all references to it to be marked as weak imports. That is, the library is allowed to be missing at runtime. -needed_library path_to_dylib This is the same as placing path_to_dylib on the link line but means to really link with the dylib even if no symbols are used from it. Thus, it can be used suppress warnings about unused dylibs. -reexport_library path_to_library This is the same as listing a file name path to a library on the link line and it specifies that the all symbols in library path should be available to clients linking to the library being created. This was previously done with a separate -sub_library option. -upward_library path_to_library This is the same as listing a file name path to a library on the link line but also marks the dylib as an upward dependency. -weak_library path_to_library This is the same as listing a file name path to a library on the link line except that it forces the library and all references to it to be marked as weak imports. -Ldir Add dir to the list of directories in which to search for libraries. Directories specified with -L are searched in the order they appear on the command line and before the default search path. In Xcode4 and later, there can be a space between the -L and directory. -Z Do not search the standard directories when searching for libraries and frameworks. -syslibroot rootdir Prepend rootdir to all search paths when searching for libraries or frameworks. -search_paths_first This is now the default (in Xcode4 tools). When processing -lx the linker now searches each directory in its library search paths for `libx.dylib' then `libx.a' before the moving on to the next path in the library search path. -search_dylibs_first Changes the searching behavior for libraries. The default is that when processing -lx the linker searches each directory in its library search paths for `libx.dylib' then `libx.a'. This option changes the behavior to first search for a file of the form `libx.dylib' in each directory in the library search path, then a file of the form `libx.a' is searched for in the library search paths. This option restores the search behavior of the linker prior to Xcode4. -framework name[,suffix] This option tells the linker to search for `name.framework/name' the framework search path. If the optional suffix is specified the framework is first searched for the name with the suffix and then without (e.g. look for `name.framework/name_suffix' first, if not there try `name.framework/name'). -needed_framework name[,suffix] This is the same as the -framework name[,suffix] but means to really link with the framework even if no symbols are used from it. Thus, it can be used suppress warnings about unused dylibs. -weak_framework name[,suffix] This is the same as the -framework name[,suffix] but forces the framework and all references to it to be marked as weak imports. Note: due to a clang optimizations, if functions are not marked weak, the compiler will optimize out any checks if the function address is NULL. -reexport_framework name[,suffix] This is the same as the -framework name[,suffix] but also specifies that the all symbols in that framework should be available to clients linking to the library being created. This was previously done with a separate -sub_umbrella option. -upward_framework name[,suffix] This is the same as the -framework name[,suffix] but also specifies that the framework is an upward dependency. -Fdir Add dir to the list of directories in which to search for frameworks. Directories specified with -F are searched in the order they appear on the command line and before the default search path. In Xcode4 and later, there can be a space between the -F and directory. -all_load Loads all members of static archive libraries. -ObjC Loads all members of static archive libraries that implement an Objective-C class or category. -force_load path_to_archive Loads all members of the specified static archive library. Note: -all_load forces all members of all archives to be loaded. This option allows you to target a specific archive. -load_hidden path_to_archive Uses specified static library as usual, but treats all global symbols from the static library to as if they are visibility hidden. Useful when building a dynamic library that uses a static library but does not want to export anything from that static library. -image_suffix suffix Search for libraries and frameworks with suffix and then without. Options that control additional content -sectcreate segname sectname file The section sectname in the segment segname is created from the contents of file file. If there's a section (segname,sectname) from any other input, the linker will append the content from the file to that section. -add_empty_section segname sectname An empty section named sectname in the segment segname. If any of the inputs contains a section (segname,sectname), that section will be included in the output, and this option will be ignored. -add_ast_path file The linker will add a N_AST stab symbol to the output file where the string is the path pointed by file and its values is the modification time of the file. -filelist file[,dirname] Specifies that the linker should link the files listed in file. This is an alternative to listing the files on the command line. The file names are listed one per line separated only by newlines. (Spaces and tabs are assumed to be part of the file name.) If the optional directory name, dirname is specified, it is prepended to each name in the list file. -dtrace file Enables dtrace static probes when producing a final linked image. The file file must be a DTrace script which declares the static probes. Options that control optimizations -dead_strip Remove functions and data that are unreachable by the entry point or exported symbols. -order_file file Alters the order in which functions and data are laid out. For each section in the output file, any symbol in that section that are specified in the order file file is moved to the start of its section and laid out in the same order as in the order file file. Order files are text files with one symbol name per line. Lines starting with a # are comments. A symbol name may be optionally preceded with its object file leaf name and a colon (e.g. foo.o:_foo). This is useful for static functions/data that occur in multiple files. A symbol name may also be optionally preceded with the architecture (e.g. ppc:_foo or ppc:foo.o:_foo). This enables you to have one order file that works for multiple architectures. Literal c-strings may be ordered by by quoting the string (e.g. "Hello, world\n") in the order file. -no_order_inits When the -order_file option is not used, the linker lays out functions in object file order and it moves all initializer routines to the start of the __text section and terminator routines to the end. Use this option to disable the automatic rearrangement of initializers and terminators. -platform_version platform min_version sdk_version This is set to indicate the platform, oldest supported version of that platform that output is to be used on, and the SDK that the output was built against. platform is a numeric value as defined in <mach-o/loader.h>, or it may be one of the following strings: • macos • ios • tvos • watchos • bridgeos • visionos • xros • mac-catalyst • ios-simulator • tvos-simulator • watchos-simulator • visionos-simulator • xros-simulator • driverkit Specifying a newer min or SDK version enables the linker to assume features of that OS or SDK in the output file. The format of min_version and sdk_version is a version number such as 10.13 or 10.14 -macos_version_min version This is set to indicate the oldest macOS version that that the output is to be used on. Specifying a later version enables the linker to assumes features of that OS in the output file. The format of version is a macOS version number such as 10.9 or 10.14 -ios_version_min version This is set to indicate the oldest iOS version that that the output is to be used on. Specifying a later version enables the linker to assumes features of that OS in the output file. The format of version is an iOS version number such as 3.1 or 4.0 -image_base address Specifies the preferred load address for a dylib or bundle. The argument address is a hexadecimal number with an optional leading 0x. By choosing non-overlapping address for all dylibs and bundles that a program loads, launch time can be improved because dyld will not need to "rebase" the image (that is, adjust pointers within the image to work at the loaded address). It is often easier to not use this option, but instead use the rebase(1) tool, and give it a list of dylibs. It will then choose non-overlapping addresses for the list and rebase them all. When building a position independent executable, this option will be ignored. This option is also called -seg1addr for compatibility. -no_implicit_dylibs When creating a two-level namespace final linked image, normally the linker will hoist up public dylibs that are implicitly linked to make the two-level namespace encoding more efficient for dyld. For example, Cocoa re-exports AppKit and AppKit re-exports Foundation. If you link with -framework Cocoa and use a symbol from Foundation, the linker will implicitly add a load command to load Foundation and encode the symbol as coming from Foundation. If you use this option, the linker will not add a load command for Foundation and encode the symbol as coming from Cocoa. Then at runtime dyld will have to search Cocoa and AppKit before finding the symbol in Foundation. -no_zero_fill_sections By default the linker moves all zero fill sections to the end of the __DATA segment and configures them to use no space on disk. This option suppresses that optimization, so zero-filled data occupies space on disk in a final linked image. -merge_zero_fill_sections Causes all zero-fill sections in the __DATA segment to be merged into one __zerofill section. -no_branch_islands Disables linker creation of branch islands which allows images to be created that are larger than the maximum branch distance. Useful with -preload when code is in multiple sections but all are within the branch range. -O0 Disables certain optimizations and layout algorithms to optimize build time. This option should be used with debug builds to speed up incremental development. The exact implementation might change to match the intent. -reproducible By default output content will be deterministic, but small changes in input files such as a compilation time might affect certain data structures in the linked binary. This option instructs ld to create a reproducible output binary by ignoring certain input properties or using alternative algorithms. Options when creating a dynamic library (dylib) -install_name name Sets an internal "install path" (LC_ID_DYLIB) in a dynamic library. Any clients linked against the library will record that path as the way dyld should locate this library. If this option is not specified, then the -o path will be used. This option is also called -dylib_install_name for compatibility. -compatibility_version number Specifies the compatibility version number of the library. When a library is loaded by dyld, the compatibility version is checked and if the program's version is greater that the library's version, it is an error. The format of number is X[.Y[.Z]] where X must be a positive non-zero number less than or equal to 65535, and .Y and .Z are optional and if present must be non-negative numbers less than or equal to 255. If the compatibility version number is not specified, it has a value of 0 and no checking is done when the library is used. This option is also called -dylib_compatibility_version for compatibility. -current_version number Specifies the current version number of the library. The current version of the library can be obtained programmatically by the user of the library so it can determine exactly which version of the library it is using. The format of number is X[.Y[.Z]] where X must be a positive non-zero number less than or equal to 65535, and .Y and .Z are optional and if present must be non-negative numbers less than or equal to 255. If the version number is not specified, it has a value of 0. This option is also called -dylib_current_version for compatibility. Options when creating a main executable -pie This makes a special kind of main executable that is position independent (PIE). On Mac OS X 10.5 and later, the OS the OS will load a PIE at a random address each time it is executed. You cannot create a PIE from .o files compiled with -mdynamic-no- pic. That means the codegen is less optimal, but the address randomization adds some security. When targeting Mac OS X 10.7 or later PIE is the default for main executables. -no_pie Do not make a position independent executable (PIE). This is the default, when targeting 10.6 and earlier. -pagezero_size size By default the linker creates an unreadable segment starting at address zero named __PAGEZERO. Its existence will cause a bus error if a NULL pointer is dereferenced. The argument size is a hexadecimal number with an optional leading 0x. If size is zero, the linker will not generate a page zero segment. By default on 32-bit architectures the page zero size is 4KB. On 64-bit architectures, the default size is 4GB. -stack_size size Specifies the maximum stack size for the main thread in a program. Without this option a program has a 8MB stack. The argument size is a hexadecimal number with an optional leading 0x. The size should be a multiple of the architecture's page size (4KB or 16KB). -allow_stack_execute Marks executable so that all stacks in the task will be given stack execution privilege. This includes pthread stacks. This option is only valid when targeting architectures that support stack execution (i.e. Intel). -export_dynamic Preserves all global symbols in main executables during LTO. Without this option, Link Time Optimization is allowed to inline and remove global functions. This option is used when a main executable may load a plug-in which requires certain symbols from the main executable. Options when creating a bundle -bundle_loader executable This specifies the executable that will be loading the bundle output file being linked. Undefined symbols from the bundle are checked against the specified executable like it was one of the dynamic libraries the bundle was linked with. Options when creating an object file -keep_private_externs Don't turn private external (aka visibility=hidden) symbols into static symbols, but rather leave them as private external in the resulting object file. -d Force definition of common symbols. That is, transform tentative definitions into real definitions. Options that control symbol resolution -exported_symbols_list filename The specified filename contains a list of global symbol names that will remain as global symbols in the output file. All other global symbols will be treated as if they were marked as __private_extern__ (aka visibility=hidden) and will not be global in the output file. The symbol names listed in filename must be one per line. Leading and trailing white space are not part of the symbol name. Lines starting with # are ignored, as are lines with only white space. Some wildcards (similar to shell file matching) are supported. The * matches zero or more characters. The ? matches one character. [abc] matches one character which must be an 'a', 'b', or 'c'. [a-z] matches any single lower case letter from 'a' to 'z'. -exported_symbol symbol The specified symbol is added to the list of global symbols names that will remain as global symbols in the output file. This option can be used multiple times. For short lists, this can be more convenient than creating a file and using -exported_symbols_list. -no_exported_symbols Useful for main executable that don't have plugins and thus need no symbol exports. -unexported_symbols_list file The specified filename contains a list of global symbol names that will not remain as global symbols in the output file. The symbols will be treated as if they were marked as __private_extern__ (aka visibility=hidden) and will not be global in the output file. The symbol names listed in filename must be one per line. Leading and trailing white space are not part of the symbol name. Lines starting with # are ignored, as are lines with only white space. Some wildcards (similar to shell file matching) are supported. The * matches zero or more characters. The ? matches one character. [abc] matches one character which must be an 'a', 'b', or 'c'. [a-z] matches any single lower case letter from 'a' to 'z'. -unexported_symbol symbol The specified symbol is added to the list of global symbols names that will not remain as global symbols in the output file. This option can be used multiple times. For short lists, this can be more convenient than creating a file and using -unexported_symbols_list. -reexported_symbols_list file The specified filename contains a list of symbol names that are implemented in a dependent dylib and should be re-exported through the dylib being created. -alias symbol_name alternate_symbol_name Create an alias named alternate_symbol_name for the symbol symbol_name. By default the alias symbol has global visibility. This option was previous the -idef:indir option. -alias_list filename The specified filename contains a list of aliases. The symbol name and its alias are on one line, separated by whitespace. Lines starting with # are ignored. -flat_namespace Alters how symbols are resolved at build time and runtime. With -two_levelnamespace (the default), the linker only searches dylibs on the command line for symbols, and records in which dylib they were found. With -flat_namespace, the linker searches all dylibs on the command line and all dylibs those original dylibs depend on. The linker does not record which dylib an external symbol came from, so at runtime dyld again searches all images and uses the first definition it finds. In addition, any undefines in loaded flat_namespace dylibs must be resolvable at build time. -u symbol_name Specified that symbol symbol_name must be defined for the link to succeed. This is useful to force selected functions to be loaded from a static library. -U symbol_name Specified that it is ok for symbol_name to have no definition. With -two_levelnamespace, the resulting symbol will be marked dynamic_lookup which means dyld will search all loaded images. -undefined treatment Specifies how undefined symbols are to be treated. Options are: error, warning, suppress, or dynamic_lookup. The default is error. Note: dynamic_lookup that depends on lazy binding will not work with chained fixups. -rpath path Add path to the runpath search path list for image being created. At runtime, dyld uses the runpath when searching for dylibs whose load path begins with @rpath/. -commons treatment Specifies how commons (aka tentative definitions) are resolved with respect to dylibs. Options are: ignore_dylibs, error. The default is ignore_dylibs which means the linker will turn a tentative definition in an object file into a real definition and not even check dylibs for conflicts. The error option means the linker should issue an error whenever a tentative definition in an object file conflicts with an external symbol in a linked dylib. See also -warn_commons. Options for introspecting the linker -why_load Log why each object file in a static library is loaded. That is, what symbol was needed. Also called -whyload for compatibility. -why_live symbol_name Logs a chain of references to symbol_name. Only applicable with -dead_strip . It can help debug why something that you think should be dead strip removed is not removed. See -exported_symbols_list for syntax and use of wildcards. -print_statistics Logs information about the amount of memory and time the linker used. -t Logs each file (object, archive, or dylib) the linker loads. Useful for debugging problems with search paths where the wrong library is loaded. -order_file_statistics Logs information about the processing of a -order_file. -map map_file_path Writes a map file to the specified path which details all symbols and their addresses in the output image. Options for controlling symbol table optimizations -S Do not put debug information (STABS or DWARF) in the output file. -x Do not put non-global symbols in the output file's symbol table. Non-global symbols are useful when debugging and getting symbol names in back traces, but are not used at runtime. If -x is used with -r non-global symbol names are not removed, but instead replaced with a unique, dummy name that will be automatically removed when linked into a final linked image. This allows dead code stripping, which uses symbols to break up code and data, to work properly and provides the security of having source symbol names removed. -non_global_symbols_strip_list filename The specified filename contains a list of non-global symbol names that should be removed from the output file's symbol table. All other non-global symbol names will remain in the output files symbol table. See -exported_symbols_list for syntax and use of wildcards. -non_global_symbols_no_strip_list filename The specified filename contains a list of non-global symbol names that should be remain in the output file's symbol table. All other symbol names will be removed from the output file's symbol table. See -exported_symbols_list for syntax and use of wildcards. -oso_prefix prefix-path When generating the debug map, the linker will remove the specified prefix-path from the path in OSO symbols. This can be used so to help build servers generate identical binaries. If '.' is passed as argument, the linker will expand the argument to the current working directory. Options for Bitcode build flow -bitcode_bundle Generates an embedded bitcode bundle in the output binary. The bitcode bundle is embedded in __LLVM, __bundle section. This option requires all the object files, static libraries and user frameworks/dylibs contain bitcode. Note: not all the linker options are supported to use together with -bitcode_bundle. -bitcode_hide_symbols Specifies this option together with -bitcode_bundle to hide all non-exported symbols from output bitcode bundle. The hide symbol process might not be reversible. To obtain a reverse mapping file to recover all the symbols, use -bitcode_symbol_map option. -bitcode_symbol_map path Specifies the output for bitcode symbol reverse mapping (.bcsymbolmap). If path is an existing directory, UUID.bcsymbolmap will be written to that directory. Otherwise, the reverse map will be written to a file at path. Rarely used Options @response_file_path Inserts contents of file at response_file_path into arguments. This allows for linker command line args to be store in a file. Note: ld is normally invoked through clang, and clang also interprets @file on the command line. To have clang ignore the @file and pass it through to ld, use -Wl,@file. -v Prints the version of the linker. -adhoc_codesign Directs the linker to add an ad-hoc codesignature to the output file. The default for Apple Silicon binaries is to be ad-hoc codesigned. -no_adhoc_codesign Directs the linker to not add ad-hoc codesignature to the output file, even for Apple Silicon binaries. -data_const By default the linker moves some data sections into __DATA_CONST if it knows the target OS version supports that. This option option overrides the default behavior and forces the use of __DATA_CONST. -no_data_const By default the linker moves some data sections into __DATA_CONST if it knows the target OS version supports that. This option option overrides the default behavior and forces the linker to never move sections to __DATA_CONST. -const_selrefs By default the linker moves __objc_selrefs section into __DATA_CONST if it knows the target OS version supports that. This option option overrides the default behavior and forces __objc_selrefs being in __DATA_CONST. Note this only applies if the __DATA_CONST segment is enabled. See -data_const for more information. -no_const_selrefs By default the linker moves __objc_selrefs section into __DATA_CONST if it knows the target OS version supports that. This option option overrides the default behavior and keeps the __objc_selrefs section in __DATA. -version_details Prints the version info about the linker in JSON -no_weak_imports Error if any symbols are weak imports (i.e. allowed to be unresolved (NULL) at runtime). Useful for config based projects that assume they are built and run on the same OS version. -no_deduplicate Don't run deduplication pass in linker -verbose_deduplicate Prints names of functions that are eliminated by deduplication and total code savings size. -no_inits Error if the output contains any static initializers -no_warn_inits Do not warn if the output contains any static initializers -warn_duplicate_libraries Warn if the input contains duplicate library options. -no_warn_duplicate_libraries Do not warn if the input contains duplicate library options. -debug_variant Do not warn about issues that are only problems for binaries shipping to customers. -unaligned_pointers treatment Specifies how unaligned pointers in __DATA segments should be handled. Options are: 'warning', 'error', or 'suppress'. The default for arm64e is 'error' and for all other architectures it is 'suppress'. -dirty_data_list filename Specifies a file containing the names of data symbols likely to be dirtied. If the linker is creating a __DATA_DIRTY segment, those symbols will be moved to that segment. -max_default_common_align value Any common symbols (aka tentative definitions, or uninitialized (zeroed) variables) that have no explicit alignment are normally aligned to their next power of two size (e.g. a 240 byte array is 256 aligned). This option lets you reduce the max alignment. For instance, a value of 0x40 would reduce the alignment for a 240 byte array to 64 bytes (instead of 256). The value specified must be a hexadecimal power of two If -max_default_common_align is not used, the default alignment is already limited to 0x8 (2^3) bytes for -preload and 0x8000 (2^15) for all other output types. -move_to_rw_segment segment_name filename Moves data symbols to another segment. The command line option specifies the target segment name and a path to a file containing a list of symbols to move. Comments can be added to the symbol file by starting a line with a #. If there are multiple instances of a symbol name (for instance a "static int foo=5;" in multiple files) the symbol name in the symbol list file can be prefixed with the object file name (e.g. "init.o:_foo") to move a specific instance. -move_to_ro_segment segment_name filename Moves code symbols to another segment. The command line option specifies the target segment name and a path to a file containing a list of symbols to move. Comments can be added to the symbol file by starting a line with a #. If there are multiple instances of a symbol name (for instance a "static int foo() {}" in multiple files) the symbol name in the symbol list file can be prefixed with the object file name (e.g. "init.o:_foo") to move a specific instance. -rename_section orgSegment orgSection newSegment newSection Renames section orgSegment/orgSection to newSegment/newSection. -rename_segment orgSegment newSegment Renames all sections with orgSegment segment name to have newSegment segment name. -trace_symbol_layout For using in debugging -rename_section, -rename_segment, -move_to_ro_segment, and -move_to_rw_segment. This option prints out a line show where and why each symbol was moved. Note: These options do chain. For each symbol, the linker first checks -move_to_ro_segment and -move_to_rw_segment. Next it applies any -rename_section options, and lastly and -rename_segment options. -section_order segname colon_separated_section_list Only for use with -preload. Specifies the order that sections with the specified segment should be layout out. For example: "-section_order __ROM __text:__const:__cstring". -segment_order colon_separated_segment_list Only for use with -preload. Specifies the order segments should be layout out. For example: "-segment_order __ROM:__ROM2:__RAM". -allow_heap_execute Normally i386 main executables will be marked so that the Mac OS X 10.7 and later kernel will only allow pages with the x-bit to execute instructions. This option overrides that behavior and allows instructions on any page to be executed. -application_extension Specifies that the code is being linked for use in an application extension. The linker will then validate that any dynamic libraries linked against are safe for use in application extensions. -no_application_extension Specifies that the code is being linked is not safe for use in an application extension. For instance, can be used when creating a framework that should not be used in an application extension. -fatal_warnings Causes the linker to exit with a non-zero value if any warnings were emitted. -no_eh_labels Normally in -r mode, the linker produces .eh labels on all FDEs in the __eh_frame section. This option suppresses those labels. Those labels are not needed by the Mac OS X 10.6 linker but are needed by earlier linker tools. -warn_compact_unwind When producing a final linked image, the linker processes the __eh_frame section and produces an __unwind_info section. Most FDE entries in the __eh_frame can be represented by a 32-bit value in the __unwind_info section. The option issues a warning for any function whose FDE cannot be expressed in the compact unwind format. -warn_weak_exports Issue a warning if the resulting final linked image contains weak external symbols. Such symbols require dyld to do extra work at launch time to coalesce those symbols. -no_weak_exports Issue an erro if the resulting final linked image contains weak external symbols. Such symbols require dyld to do extra work at launch time to coalesce those symbols. -warn_unused_dylibs Warn about dylibs that are linked by no symbols are used from them. -no_warn_unused_dylibs Don't warn about dylibs that are linked by no symbols are used from them. -dead_strip_dylibs Remove dylibs that are unreachable by the entry point or exported symbols. That is, suppresses the generation of load command commands for dylibs which supplied no symbols during the link. This option should not be used when linking against a dylib which is required at runtime for some indirect reason such as the dylib has an important initializer. -allow_sub_type_mismatches Normally the linker considers different cpu-subtype for ARM (e.g. armv4t and armv6) to be different different architectures that cannot be mixed at build time. This option relaxes that requirement, allowing you to mix object files compiled for different ARM subtypes. -no_uuid Do not generate an LC_UUID load command in the output file. Be warned that binaries without UUIDs may cause the debugger and crash reporting tools to be unable to track and inspect the binary. -random_uuid Generate a random LC_UUID load command in the output file. By default the linker generates the UUID of the output file based on a hash of the output file's content. But for very large output files, the hash can slow down the link. Using a hash based UUID is important for reproducible builds, but if you are just doing rapid debug builds, using -random_uuid may improve turn around time. -root_safe Sets the MH_ROOT_SAFE bit in the mach header of the output file. -setuid_safe Sets the MH_SETUID_SAFE bit in the mach header of the output file. -interposable Indirects access to all to exported symbols when creating a dynamic library. -init symbol_name The specified symbol_name will be run as the first initializer. Only used when creating a dynamic library. -sub_library library_name The specified dylib will be re-exported. For example the library_name for /usr/lib/libobjc_profile.A.dylib would be libobjc. Only used when creating a dynamic library. -sub_umbrella framework_name The specified framework will be re-exported. Only used when creating a dynamic library. -allowable_client name Restricts what can link against the dynamic library being created. By default any code can link against any dylib. But if a dylib is supposed to be private to a small set of clients, you can formalize that by adding a -allowable_client for each client. If a client is libfoo.1.dylib its -allowable_client name would be "foo". If a client is Foo.framework its -allowable_client name would be "Foo". For the degenerate case where you want no one to ever link against a dylib, you can set the -allowable_client to "!". -client_name name Enables a bundle to link against a dylib that was built with -allowable_client. The name specified must match one of the -allowable_client names specified when the dylib was created. -umbrella framework_name Specifies that the dylib being linked is re-exported through an umbrella framework of the specified name. -headerpad size Specifies the minimum space for future expansion of the load commands. Only useful if intend to run install_name_tool to alter the load commands later. Size is a hexadecimal number. -headerpad_max_install_names Automatically adds space for future expansion of load commands such that all paths could expand to MAXPATHLEN. Only useful if intend to run install_name_tool to alter the load commands later. -bind_at_load Sets a bit in the mach header of the resulting binary which tells dyld to bind all symbols when the binary is loaded, rather than lazily. -force_flat_namespace Sets a bit in the mach header of the resulting binary which tells dyld to not only use flat namespace for the binary, but force flat namespace binding on all dylibs and bundles loaded in the process. Can only be used when linking main executables. -sectalign segname sectname value The section named sectname in the segment segname will have its alignment set to value, where value is a hexadecimal number that must be an integral power of 2. -stack_addr address Specifies the initial address of the stack pointer value, where value is a hexadecimal number rounded to a page boundary. -segprot segname max_prot init_prot Specifies the maximum and initial virtual memory protection of the named segment, name, to be max and init ,respectively. The values for max and init are any combination of the characters `r' (for read), `w' (for write), `x' (for execute) and `-' (no access). -seg_addr_table filename Specifies a file containing base addresses for dynamic libraries. Each line of the file is a hexadecimal base address followed by whitespace then the install name of the corresponding dylib. The # character denotes a comment. -segs_read_write_addr address Allows a dynamic library to be built where the read-only and read-write segments are not contiguous. The address specified is a hexadecimal number that indicates the base address for the read-write segments. -segs_read_only_addr address Allows a dynamic library to be built where the read-only and read-write segments are not contiguous. The address specified is a hexadecimal number that indicates the base address for the read-only segments. -segaddr name address Specifies the starting address of the segment named name to be address. The address must be a hexadecimal number that is a multiple of 4K page size. -seg_page_size name size Specifies the page size used by the specified segment. By default the page size is 4096 for all segments. The linker will lay out segments such that size of a segment is always an even multiple of its page size. -dylib_file install_name:file_name Specifies that a dynamic shared library is in a different location than its standard location. Use this option when you link with a library that is dependent on a dynamic library, and the dynamic library is in a location other than its default location. install_name specifies the path where the library normally resides. file_name specifies the path of the library you want to use instead. For example, if you link to a library that depends upon the dynamic library libsys and you have libsys installed in a nondefault location, you would use this option: -dylib_file /lib/libsys_s.A.dylib:/me/lib/libsys_s.A.dylib. -prebind The created output file will be in the prebound format. This was used in Mac OS X 10.3 and earlier to improve launch performance. -weak_reference_mismatches treatment Specifies what to do if a symbol is weak-imported in one object file but not weak-imported in another. The valid treatments are: error, weak, or non-weak. The default is non-weak. -read_only_relocs treatment Enables the use of relocations which will cause dyld to modify (copy-on-write) read-only pages. The compiler will normally never generate such code. -force_cpusubtype_ALL The is only applicable with -arch ppc. It tells the linker to ignore the PowerPC cpu requirements (e.g. G3, G4 or G5) encoded in the object files and mark the resulting binary as runnable on any PowerPC cpu. -dylinker_install_name path Only used when building dyld. -no_arch_warnings Suppresses warning messages about files that have the wrong architecture for the -arch flag -arch_errors_fatal Turns into errors, warnings about files that have the wrong architecture for the -arch flag. -e symbol_name Specifies the entry point of a main executable. By default the entry name is "start" which is found in crt1.o which contains the glue code need to set up and call main(). -w Suppress all warning messages -final_output name Specifies the install name of a dylib if -install_name is not used. This option is used by compiler driver when it is invoked with multiple -arch arguments. -arch_multiple Specifies that the linker should augment error and warning messages with the architecture name. This option is used by compiler driver when it is invoked with multiple -arch arguments. -twolevel_namespace_hints Specifies that hints should be added to the resulting binary that can help speed up runtime binding by dyld as long as the libraries being linked against have not changed. -dot path Create a file at the specified path containing a graph of symbol dependencies. The .dot file can be viewed in GraphViz. -keep_relocs Add section based relocation records to a final linked image. These relocations are ignored at runtime by dyld. -warn_stabs Print a warning when the linker cannot do a BINCL/EINCL optimization because the compiler put a bad stab symbol inside a BINCL/EINCL range. -warn_commons Print a warning whenever a tentative definition in an object file is found and a external symbol by the same name is also found in a linked dylib. This often means that the extern keyword is missing from a variable declaration in a header file. -read_only_stubs [i386 only] Makes the __IMPORT segment of a final linked images read-only. This option makes a program slightly more secure in that the JMP instructions in the i386 fast stubs cannot be easily overwritten by malicious code. The downside is the dyld must use mprotect() to temporarily make the segment writable while it is binding the stubs. -slow_stubs [i386 only] Instead of using single JMP instruction stubs, the linker creates code in the __TEXT segment which calls through a lazy pointer in the __DATA segment. -interposable_list filename The specified filename contains a list of global symbol names that should always be accessed indirectly. For instance, if libSystem.dylib is linked such that _malloc is interposable, then calls to malloc() from within libSystem will go through a dyld stub and could potentially indirected to an alternate malloc. If libSystem.dylib were built without making _malloc interposable then if _malloc was interposed at runtime, calls to malloc from with libSystem would be missed (not interposed) because they would be direct calls. -no_function_starts By default the linker creates a compress table of function start addresses in the LINKEDIT of final linked image. This option disables that behavior. -no_objc_category_merging By default when producing final linked image, the linker will optimize Objective-C classes by merging any categories on a class into the class. Both the class and its categories must be defined in the image being linked for the optimization to occur. Using this option disables that behavior. -objc_relative_method_lists By default when producing final linked image, if targeting a new enough OS version, the linker will rewrite ObjC method lists from the tradition three pointers to use three read-only delta pointers. This option allows you to force the use of relative method lists even though the OS version is too low. -no_objc_relative_method_lists By default when producing final linked image, if targeting a new enough OS version, the linker will rewrite ObjC method lists from the tradition three pointers to use three read-only delta pointers. This option allows you to force the use of traditional three pointer method lists. -object_path_lto filename When performing Link Time Optimization (LTO) and a temporary mach-o object file is needed, if this option is used, the temporary file will be stored at the specified path and remain after the link is complete. Without the option, the linker picks a path and deletes the object file before the linker tool completes, thus tools such as the debugger or dsymutil will not be able to access the DWARF debug info in the temporary object file. -lto_library path When performing Link Time Optimization (LTO), the linker normally loads libLTO.dylib relative to the linker binary (../lib/libLTO.dylib). This option allows the user to specify the path to a specific libLTO.dylib to load instead. -cache_path_lto path When performing Incremental Link Time Optimization (LTO), use this directory as a cache for incremental rebuild. -prune_interval_lto seconds When performing Incremental Link Time Optimization (LTO), the cache will pruned after the specified interval. A value 0 will force pruning to occur and a value of -1 will disable pruning. -prune_after_lto seconds When pruning the cache for Incremental Link Time Optimization (LTO), the cache entries are removed after the specified interval. -max_relative_cache_size_lto percent When performing Incremental Link Time Optimization (LTO), the cache will be pruned to not go over this percentage of the free space. I.e. a value of 100 would indicate that the cache may fill the disk, and a value of 50 would indicate that the cache size will be kept under the free disk space. -fixup_chains_section For use with -static or -preload when -pie is used. Tells the linker to add a __TEXT,__chain_starts section which starts with a dyld_chained_starts_offsets struct which specifies the pointer format and the offsets to the start of every fixup chain. -fixup_chains_section_vm Same as -fixup_chains_section but fixes a bug. The offsets in the __chain_starts section are vm-offsets from the __TEXT segment, and the rebase targets in the chains are vm-offsets. -threaded_starts_section For arm64e only. For use with -static or -preload when -pie is used. Tells the linker to add a __TEXT,__thread_starts section which starts with a 32-bit flag field, followed by an array 32-bit values. Each value is the offset to the start of a fixup chain. This option is deprecated. -page_align_data_atoms During development, this option can be used to space out all global variables so each is on a separate page. This is useful when analyzing dirty and resident pages. The information can then be used to create an order file to cluster commonly used/dirty globals onto the same page(s). -not_for_dyld_shared_cache Normally, the linker will add extra info to dylibs with -install_name starting with /usr/lib or /System/Library/ that allows the dylib to be placed into the dyld shared cache. Adding this option tells the linker to not add that extra info. -search_in_sparse_frameworks For use when linking against versioned frameworks that do not have a normal variant. By default when -framework Foo,_suffix is used, the linker will follow Foo.framework/Foo if it is a symbolic link, append _suffix and search for a file with that path. When this option is used, the linker will also search for Foo.framework/Versions/Current/Foo_suffix. -ld_classic Override the choice of linker, and force the use of ld-classic to link the binary. This is incompatible with options such as -merge*, used to build/merge libraries. -ld_new Override the choice of linker, and force the use of ld to link the binary. This is incompatible with older architectures such as armv7k and i386. Mergeable Library Options -make_mergeable Adds additional metadata to a dylib which makes it a mergeable library. It can still be used as a dylib, or can be merged into other binaries when they link it with a -merge* option. -merge-lx This is the same as the -lx option but means to merge the contents of the library x into this binary. -merge_library path_to_library This is the same as listing a file name path to a library on the link line but also merges the contents of the library into this binary. -merge_framework name[,suffix] This is the same as the -framework name[,suffix] but means that the contents of the framework should be merged into this binary. -no_merged_libraries_hook When using mergeable libraries ld automatically adds a hook to redirect bundle resource lookups from mergeable frameworks into the merged binary. Use this option to disable the hook. The hook requires a minimum deployment version of iOS 12, you can use the option to disable the hook with a lower deployment target if your frameworks don't require bundle resource lookups. Disabling the hook might also improve launch time performance, so it's good to disable it regardless of the deployment target if it's not required. Obsolete Options -segalign value All segments must be page aligned. -seglinkedit Object files (MH_OBJECT) with a LINKEDIT segment are no longer supported. This option is obsolete. -noseglinkedit This is the default. This option is obsolete. -fvmlib Fixed VM shared libraries (MH_FVMLIB) are no longer supported. This option is obsolete. -sectobjectsymbols segname sectname Adding a local label at a section start is no longer supported. This option is obsolete. -nofixprebinding The MH_NOFIXPREBINDING bit of mach_headers has been ignored since Mac OS X 10.3.9. This option is obsolete. -noprebind_all_twolevel_modules Multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete. -prebind_all_twolevel_modules Multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete. -prebind_allow_overlap When using -prebind, the linker allows overlapping by default, so this option is obsolete. -noprebind LD_PREBIND is no longer supported as a way to force on prebinding, so there no longer needs to be a command line way to override LD_PREBIND. This option is obsolete. -sect_diff_relocs treatment This option was an attempt to warn about linking .o files compiled without -mdynamic-no-pic into a main executable, but the false positive rate generated too much noise to make the option useful. This option is obsolete. -run_init_lazily This option was removed in Mac OS X 10.2. -single_module This is now the default so does not need to be specified. -multi_module Multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete. -no_dead_strip_inits_and_terms The linker never dead strips initialization and termination routines. They are considered "roots" of the dead strip graph. -A basefile Obsolete incremental load format. This option is obsolete. -b Used with -A option to strip base file's symbols. This option is obsolete. Obsolete option to produce a load map. Use -map option instead. -Sn Don't strip any symbols. This is the default. This option is obsolete. -Si Optimize stabs debug symbols to remove duplicates. This is the default. This option is obsolete. -Sp Write minimal stabs which causes the debugger to open and read the original .o file for full stabs. This style of debugging is obsolete in Mac OS X 10.5. This option is obsolete. -X Strip local symbols that begin with 'L'. This is the default. This option is obsolete. -s Completely strip the output, including removing the symbol table. This file format variant is no longer supported. This option is obsolete. -m Don't treat multiple definitions as an error. This is no longer supported. This option is obsolete. -ysymbol Display each file in which symbol is used. This was previously used to debug where an undefined symbol was used, but the linker now automatically prints out all usages. The -why_live option can also be used to display what kept a symbol from being dead striped. This option is obsolete. -Y number Used to control how many occurrences of each symbol specified with -y would be shown. This option is obsolete. -nomultidefs Only used when linking an umbrella framework. Sets the MH_NOMULTIDEFS bit in the mach_header. The MH_NOMULTIDEFS bit has been obsolete since Mac OS X 10.4. This option is obsolete. -multiply_defined_unused treatment Previously provided a way to warn or error if any of the symbol definitions in the output file matched any definitions in dynamic library being linked. This option is obsolete. -multiply_defined treatment Previously provided a way to warn or error if any of the symbols used from a dynamic library were also available in another linked dynamic library. This option is obsolete. -private_bundle Previously prevented errors when -flat_namespace, -bundle, and -bundle_loader were used and the bundle contained a definition that conflicted with a symbol in the main executable. The linker no longer errors on such conflicts. This option is obsolete. -noall_load This is the default. This option is obsolete. -seg_addr_table_filename path Use path instead of the install name of the library for matching an entry in the seg_addr_table. This option is obsolete. -sectorder segname sectname orderfile Replaced by more general -order_file option. -sectorder_detail Produced extra logging about which entries from a sectorder entries were used. Replaced by -order_file_statistics. This option is obsolete. -lazy_framework name[,suffix] This is the same as the -framework name[,suffix] except that the linker will construct glue code so that the framework is not loaded until the first function in it is called. You cannot directly access data or Objective-C classes in a framework linked this way. This option is deprecated. -lazy-lx This is the same as the -lx but it is only for shared libraries and the linker will construct glue code so that the shared library is not loaded until the first function in it is called. This option is deprecated. -lazy_library path_to_library This is the same as listing a file name path to a shared library on the link line except that the linker will construct glue code so that the shared library is not loaded until the first function in it is called. This option is deprecated. SEE ALSO ld-classic(1), as(1), ar(1), cc(1), dyld_info(1), nm(1), otool(1) lipo(1), arch(3), dyld(3), Mach-O(5), strip(1), rebase(1) Darwin June 21, 2023 Darwin
null
dbilogstrip5.30
Replaces any hex addresses, e.g, 0x128f72ce with "0xN". Replaces any references to process id or thread id, like "pid#6254" with "pidN". So a DBI trace line like this: -> STORE for DBD::DBM::st (DBI::st=HASH(0x19162a0)~0x191f9c8 'f_params' ARRAY(0x1922018)) thr#1800400 will look like this: -> STORE for DBD::DBM::st (DBI::st=HASH(0xN)~0xN 'f_params' ARRAY(0xN)) thrN perl v5.30.3 2024-04-13 DBILOGSTRIP(1)
dbilogstrip - filter to normalize DBI trace logs for diff'ing
Read DBI trace file "dbitrace.log" and write out a stripped version to "dbitrace_stripped.log" dbilogstrip dbitrace.log > dbitrace_stripped.log Run "yourscript.pl" twice, each with different sets of arguments, with DBI_TRACE enabled. Filter the output and trace through "dbilogstrip" into a separate file for each run. Then compare using diff. (This example assumes you're using a standard shell.) DBI_TRACE=2 perl yourscript.pl ...args1... 2>&1 | dbilogstrip > dbitrace1.log DBI_TRACE=2 perl yourscript.pl ...args2... 2>&1 | dbilogstrip > dbitrace2.log diff -u dbitrace1.log dbitrace2.log
null
null
awk
Awk scans each input file for lines that match any of a set of patterns specified literally in prog or in one or more files specified as -f progfile. With each pattern there can be an associated action that will be performed when a line of a file matches the pattern. Each line is matched against the pattern portion of every pattern-action statement; the associated action is performed for each matched pattern. The file name - means the standard input. Any file of the form var=value is treated as an assignment, not a filename, and is executed at the time it would have been opened if it were a filename. The option -v followed by var=value is an assignment to be done before prog is executed; any number of -v options may be present. The -F fs option defines the input field separator to be the regular expression fs. An input line is normally made up of fields separated by white space, or by the regular expression FS. The fields are denoted $1, $2, ..., while $0 refers to the entire line. If FS is null, the input line is split into one field per character. A pattern-action statement has the form: pattern { action } A missing { action } means print the line; a missing pattern always matches. Pattern-action statements are separated by newlines or semicolons. An action is a sequence of statements. A statement can be one of the following: if( expression ) statement [ else statement ] while( expression ) statement for( expression ; expression ; expression ) statement for( var in array ) statement do statement while( expression ) break continue { [ statement ... ] } expression # commonly var = expression print [ expression-list ] [ > expression ] printf format [ , expression-list ] [ > expression ] return [ expression ] next # skip remaining patterns on this input line nextfile # skip rest of this file, open next, start at top delete array[ expression ]# delete an array element delete array # delete all elements of array exit [ expression ] # exit immediately; status is expression Statements are terminated by semicolons, newlines or right braces. An empty expression-list stands for $0. String constants are quoted " ", with the usual C escapes recognized within. Expressions take on string or numeric values as appropriate, and are built using the operators + - * / % ^ (exponentiation), and concatenation (indicated by white space). The operators ! ++ -- += -= *= /= %= ^= > >= < <= == != ?: are also available in expressions. Variables may be scalars, array elements (denoted x[i]) or fields. Variables are initialized to the null string. Array subscripts may be any string, not necessarily numeric; this allows for a form of associative memory. Multiple subscripts such as [i,j,k] are permitted; the constituents are concatenated, separated by the value of SUBSEP. The print statement prints its arguments on the standard output (or on a file if > file or >> file is present or on a pipe if | cmd is present), separated by the current output field separator, and terminated by the output record separator. file and cmd may be literal names or parenthesized expressions; identical string values in different statements denote the same open file. The printf statement formats its expression list according to the format (see printf(3)). The built-in function close(expr) closes the file or pipe expr. The built-in function fflush(expr) flushes any buffered output for the file or pipe expr. The mathematical functions atan2, cos, exp, log, sin, and sqrt are built in. Other built-in functions: length the length of its argument taken as a string, number of elements in an array for an array argument, or length of $0 if no argument. rand random number on [0,1). srand sets seed for rand and returns the previous seed. int truncates to an integer value. substr(s, m [, n]) the n-character substring of s that begins at position m counted from 1. If no n, use the rest of the string. index(s, t) the position in s where the string t occurs, or 0 if it does not. match(s, r) the position in s where the regular expression r occurs, or 0 if it does not. The variables RSTART and RLENGTH are set to the position and length of the matched string. split(s, a [, fs]) splits the string s into array elements a[1], a[2], ..., a[n], and returns n. The separation is done with the regular expression fs or with the field separator FS if fs is not given. An empty string as field separator splits the string into one array element per character. sub(r, t [, s]) substitutes t for the first occurrence of the regular expression r in the string s. If s is not given, $0 is used. gsub(r, t [, s]) same as sub except that all occurrences of the regular expression are replaced; sub and gsub return the number of replacements. sprintf(fmt, expr, ...) the string resulting from formatting expr ... according to the printf(3) format fmt. system(cmd) executes cmd and returns its exit status. This will be -1 upon error, cmd's exit status upon a normal exit, 256 + sig upon death- by-signal, where sig is the number of the murdering signal, or 512 + sig if there was a core dump. tolower(str) returns a copy of str with all upper-case characters translated to their corresponding lower-case equivalents. toupper(str) returns a copy of str with all lower-case characters translated to their corresponding upper-case equivalents. The ``function'' getline sets $0 to the next input record from the current input file; getline < file sets $0 to the next record from file. getline x sets variable x instead. Finally, cmd | getline pipes the output of cmd into getline; each call of getline returns the next line of output from cmd. In all cases, getline returns 1 for a successful input, 0 for end of file, and -1 for an error. Patterns are arbitrary Boolean combinations (with ! || &&) of regular expressions and relational expressions. Regular expressions are as defined in re_format(7). Isolated regular expressions in a pattern apply to the entire line. Regular expressions may also occur in relational expressions, using the operators ~ and !~. /re/ is a constant regular expression; any string (constant or variable) may be used as a regular expression, except in the position of an isolated regular expression in a pattern. A pattern may consist of two patterns separated by a comma; in this case, the action is performed for all lines from an occurrence of the first pattern though an occurrence of the second. A relational expression is one of the following: expression matchop regular-expression expression relop expression expression in array-name (expr,expr,...) in array-name where a relop is any of the six relational operators in C, and a matchop is either ~ (matches) or !~ (does not match). A conditional is an arithmetic expression, a relational expression, or a Boolean combination of these. The special patterns BEGIN and END may be used to capture control before the first input line is read and after the last. BEGIN and END do not combine with other patterns. They may appear multiple times in a program and execute in the order they are read by awk. Variable names with special meanings: ARGC argument count, assignable. ARGV argument array, assignable; non-null members are taken as filenames. CONVFMT conversion format used when converting numbers (default %.6g). ENVIRON array of environment variables; subscripts are names. FILENAME the name of the current input file. FNR ordinal number of the current record in the current file. FS regular expression used to separate fields; also settable by option -Ffs. NF number of fields in the current record. NR ordinal number of the current record. OFMT output format for numbers (default %.6g). OFS output field separator (default space). ORS output record separator (default newline). RLENGTH the length of a string matched by match. RS input record separator (default newline). If empty, blank lines separate records. If more than one character long, RS is treated as a regular expression, and records are separated by text matching the expression. RSTART the start position of a string matched by match. SUBSEP separates multiple subscripts (default 034). Functions may be defined (at the position of a pattern-action statement) thus: function foo(a, b, c) { ...; return x } Parameters are passed by value if scalar and by reference if array name; functions may be called recursively. Parameters are local to the function; all other variables are global. Thus local variables may be created by providing excess parameters in the function definition. ENVIRONMENT VARIABLES If POSIXLY_CORRECT is set in the environment, then awk follows the POSIX rules for sub and gsub with respect to consecutive backslashes and ampersands.
awk - pattern-directed scanning and processing language
awk [ -F fs ] [ -v var=value ] [ 'prog' | -f progfile ] [ file ... ]
null
length($0) > 72 Print lines longer than 72 characters. { print $2, $1 } Print first two fields in opposite order. BEGIN { FS = ",[ \t]*|[ \t]+" } { print $2, $1 } Same, with input fields separated by comma and/or spaces and tabs. { s += $1 } END { print "sum is", s, " average is", s/NR } Add up first column, print sum and average. /start/, /stop/ Print all lines between start/stop pairs. BEGIN { # Simulate echo(1) for (i = 1; i < ARGC; i++) printf "%s ", ARGV[i] printf "\n" exit } SEE ALSO grep(1), lex(1), sed(1) A. V. Aho, B. W. Kernighan, P. J. Weinberger, The AWK Programming Language, Addison-Wesley, 1988. ISBN 0-201-07981-X. BUGS There are no explicit conversions between numbers and strings. To force an expression to be treated as a number add 0 to it; to force it to be treated as a string concatenate "" to it. The scope rules for variables in functions are a botch; the syntax is worse. Only eight-bit characters sets are handled correctly. 2020-11-24 AWK(1)
ip2cc
Ip2cc is a program to lookup countries of IP addresses. Ip2cc has two modes: interactive and non-interactive. Interactive mode allows the user to query more than one hostname. Non-interactive mode is used to print just the country for a single host. ARGUMENTS Interactive mode is entered when no arguments are given. Non-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. SEE ALSO IP::Country - the fast database used by this script. AUTHOR Nigel Wetters Gourlay <nwetters@cpan.org> perl v5.34.0 2024-04-13 IP2CC(1)
ip2cc - lookup country from IP address or hostname
ip2cc [host-to-find]
null
null
syscallbyproc.d
syscallbyproc.d is a DTrace OneLiner to a report of the number of system calls made by process name. This is useful to identify which process is causing the most system calls. Docs/oneliners.txt and Docs/Examples/oneliners_examples.txt in the DTraceToolkit contain this as a oneliner that can be cut-n-paste to run. Since this uses DTrace, only users with root privileges can run this command.
syscallbyproc.d - syscalls by process name. Uses DTrace.
syscallbyproc.d
null
This samples until Ctrl-C is hit. # syscallbyproc.d FIELDS first field This is the process name. There may be several PIDs that have the same process name, for example with numerous instances of "bash". The value reported will be the sum of them all. second field This is the count, the number of system calls made. DOCUMENTATION See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with verbose descriptions explaining the output. EXIT syscallbyproc.d will sample until Ctrl-C is hit. AUTHOR Brendan Gregg [Sydney, Australia] SEE ALSO procsystime(1M), dtrace(1M), truss(1) version 1.00 May 15, 2005 syscallbyproc.d(1m)
umtool
Use umtool to output diagnostic data for troubleshooting UserManagement. Available commands: sysdiagnose Outputs diagnostic data for collection by sysdiagnose(1) SEE ALSO sysdiagnose(1) Darwin 4/2/21 Darwin
umtool – Diagnostic tool for UserManagement
umtool sysdiagnose
null
null
snmpstatus
snmpstatus is an SNMP application that retrieves several important statistics from a network entity. AGENT identifies a target SNMP agent, which is instrumented to monitor the given objects. At its simplest, the AGENT specification will consist of a hostname or an IPv4 address. n this situation, the command will attempt communication with the agent, using UDP/IPv4 to port 161 of the given target host. See the snmpcmd(1) manual page for a full list of the possible formats for AGENT. The information returned is: The IP address of the entity. A textual description of the entity (sysDescr.0) The uptime of the entity's SNMP agent (sysUpTime.0) The sum of received packets on all interfaces (ifInUCastPkts.* + ifInNUCastPkts.*) The sum of transmitted packets on all interfaces (ifOutUCastPkts.* + ifOutNUCastPkts.*) The number of IP input packets (ipInReceives.0) The number of IP output packets (ipOutRequests.0) For example: snmpstatus -c public -v 1 netdev-kbox.cc.cmu.edu will produce output similar to the following: [128.2.56.220]=>[Kinetics FastPath2] Up: 1 day, 4:43:31 Interfaces: 1, Recv/Trans packets: 262874/39867 | IP: 31603/15805 snmpstatus also checks the operational status of all interfaces (ifOperStatus.*), and if it finds any that are not running, it will report in a manner similar to this: 2 interfaces are down! If the network entity has an error processing the request packet, an error packet will be returned and a message will be shown, helping to pinpoint in what way the request was malformed. snmpstatus will attempt to reform its request to eliminate the malformed variable (unless the -Cf option is given, see below), but this variable will then be missing from the displayed data.
snmpstatus - retrieves a fixed set of management information from a network entity
snmpstatus [COMMON OPTIONS] [-Cf] AGENT
COMMON OPTIONS Please see snmpcmd(1) for a list of possible values for COMMON OPTIONS as well as their descriptions. -Cf By default, snmpstatus will try to fix errors returned by the agent and retry a request. In this situation, the command will display the data that it can. If the -Cf option is specified, then snmpstatus will not try to fix errors, and the error will cause the command to terminate. SEE ALSO snmpcmd(1), snmpget(1) V5.6.2.1 25 Jul 2003 SNMPSTATUS(1)
null
uudecode
The uuencode and uudecode utilities are used to transmit binary files over transmission mediums that do not support other than simple ASCII data. The b64encode utility is synonymous with uuencode with the -m flag specified. The b64decode utility is synonymous with uudecode with the -m flag specified. The base64 utility acts as a base64 decoder when passed the --decode (or -d) flag and as a base64 encoder otherwise. As a decoder it only accepts raw base64 input and as an encoder it does not produce the framing lines. base64 reads standard input or file if it is provided and writes to standard output. Options --wrap (or -w) and --ignore-garbage (or -i) are accepted for compatibility with GNU base64, but the latter is unimplemented and silently ignored. The uuencode utility reads file (or by default the standard input) and writes an encoded version to the standard output, or output_file if one has been specified. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode. The uudecode utility transforms uuencoded files (or by default, the standard input) into the original form. The resulting file is named either name or (depending on options passed to uudecode) output_file and will have the mode of the original file except that setuid and execute bits are not retained. The uudecode utility ignores any leading and trailing lines. The following options are available for uuencode: -m Use the Base64 method of encoding, rather than the traditional uuencode algorithm. -r Produce raw output by excluding the initial and final framing lines. -o output_file Output to output_file instead of standard output. The following options are available for uudecode: -c Decode more than one uuencoded file from file if possible. -i Do not overwrite files. -m When used with the -r flag, decode Base64 input instead of traditional uuencode input. Without -r it has no effect. -o output_file Output to output_file instead of any pathname contained in the input data. -p Decode file and write output to standard output. -r Decode raw (or broken) input, which is missing the initial and possibly the final framing lines. The input is assumed to be in the traditional uuencode encoding, but if the -m flag is used, or if the utility is invoked as b64decode, then the input is assumed to be in Base64 format. -s Do not strip output pathname to base filename. By default uudecode deletes any prefix ending with the last slash '/' for security reasons. Additionally, b64encode accepts the following option: -w column Wrap encoded output after column. The following options are available for base64: -b count, --break=count Insert line breaks every count characters. The default is 0, which generates an unbroken stream. -d, -D, --decode Decode incoming Base64 stream into binary data. -h, --help Print usage summary and exit. -i input_file, --input=input_file Read input from input_file. The default is stdin; passing “-” also represents stdin. -o output_file, --output=output_file Write output to output_file. The default is stdout; passing “-” also represents stdout. bintrans is a generic utility that can run any of the aforementioned encoders and decoders. It can also run algorithms that are not available through a dedicated program: qp is a quoted-printable converter and accepts the following options: -u Decode. -o output_file Output to output_file instead of standard output.
bintrans, base64, uuencode, uudecode, – encode/decode a binary file
bintrans [algorithm] [...] uuencode [-m] [-r] [-o output_file] [file] name uudecode [-cimprs] [file ...] uudecode [-i] -o output_file b64encode [-r] [-w column] [-o output_file] [file] name b64decode [-cimprs] [file ...] b64decode [-i] -o output_file [file] base64 [-h | -D | -d] [-b count] [-i input_file] [-o output_file]
null
The following example packages up a source tree, compresses it, uuencodes it and mails it to a user on another system. When uudecode is run on the target system, the file ``src_tree.tar.Z'' will be created which may then be uncompressed and extracted into the original tree. tar cf - src_tree | compress | uuencode src_tree.tar.Z | mail user@example.com The following example unpacks all uuencoded files from your mailbox into your current working directory. uudecode -c < $MAIL The following example extracts a compressed tar archive from your mailbox uudecode -o /dev/stdout < $MAIL | zcat | tar xfv - SEE ALSO basename(1), compress(1), mail(1), uucp(1) (ports/net/freebsd-uucp), uuencode(5) HISTORY The uudecode and uuencode utilities appeared in 4.0BSD. BUGS Files encoded using the traditional algorithm are expanded by 35% (3 bytes become 4 plus control information). macOS 14.5 April 18, 2022 macOS 14.5
psm
A simple command line interface which lets you check the status of slots, and remove any orphaned slots. Slots are automatically allocated on a first come first serve bases, and this tool allows you to see which users are currently being protected by a specific slot. To free up a slot you may need to delete an existing user from the system that is currently enrolled; thus allowing the next password change to enroll into Apple Silicon password slot manager. By default psm will execute the command supplied and report if anything went wrong. Here is a complete list of the options available: -d disk3s5 specify a disk to operate on <disk3s5> -s # specify a specifc slot number -v will make psm more verbose. VERBS status Displays status for all currently enrolled slots remove Allows you to remove a specific slot SEE ALSO passwd(1) diskutil(8) fdesetup(8) HISTORY psm was first introduced in Mac OS X version 11. Mac OS X June 15, 2020 Mac OS X
psm – Command line interface to Apple Silicon password slot manager
psm [verb] [-dsv]
null
null
fmt
The fmt utility is a simple text formatter which reads the concatenation of input files (or standard input if none are given) and produces on standard output a version of its input with lines as close to the goal length as possible without exceeding the maximum. The goal length defaults to 65 and the maximum to 10 more than the goal length. Alternatively, a single width parameter can be specified either by prepending a hyphen to it or by using -w. For example, “fmt -w 72”, “fmt -72”, and “fmt 72 72” all produce identical output. The spacing at the beginning of the input lines is preserved in the output, as are blank lines and interword spacing. Lines are joined or split only at white space; that is, words are never joined or hyphenated. The options are as follows: -c Center the text, line by line. In this case, most of the other options are ignored; no splitting or joining of lines is done. -m Try to format mail header lines contained in the input sensibly. -n Format lines beginning with a ‘.’ (dot) character. -p Allow indented paragraphs. Without the -p flag, any change in the amount of whitespace at the start of a line results in a new paragraph being begun. -s Collapse whitespace inside lines, so that multiple whitespace characters are turned into a single space. (Or, at the end of a sentence, a double space.) -d chars Treat the chars (and no others) as sentence-ending characters. By default the sentence-ending characters are full stop (‘.’), question mark (‘?’) and exclamation mark (‘!’). Remember that some characters may need to be escaped to protect them from your shell. -l number Replace multiple spaces with tabs at the start of each output line, if possible. Each number spaces will be replaced with one tab. The default is 8. If number is 0, spaces are preserved. -t number Assume that the input files' tabs assume number spaces per tab stop. The default is 8. The fmt utility is meant to format mail messages prior to sending, but may also be useful for other simple tasks. For instance, within visual mode of the ex(1) editor (e.g., vi(1)) the command !}fmt will reformat a paragraph, evening the lines. ENVIRONMENT The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of fmt as described in environ(7).
fmt – simple text formatter
fmt [-cmnps] [-d chars] [-l num] [-t num] [goal [maximum] | -width | -w width] [file ...]
null
Center the text in standard input: $ echo -e 'The merit of all things\nlies\nin their difficulty' | fmt -c The merit of all things lies in their difficulty Format the text in standard input collapsing spaces: $ echo -e 'Multiple spaces will be collapsed' | fmt -s Multiple spaces will be collapsed SEE ALSO fold(1), mail(1) HISTORY The fmt command appeared in 3BSD. The version described herein is a complete rewrite and appeared in FreeBSD 4.4. AUTHORS Kurt Shoens Liz Allen (added goal length concept) Gareth McCaughan BUGS The program was designed to be simple and fast - for more complex operations, the standard text processors are likely to be more appropriate. When the first line of an indented paragraph is very long (more than about twice the goal length), the indentation in the output can be wrong. The fmt utility is not infallible in guessing what lines are mail headers and what lines are not. macOS 14.5 October 29, 2020 macOS 14.5
zless
zmore is a filter that allows the viewing of files compressed with Lempel-Ziv encoding. Such files generally have a “Z” or “gz” extension (both the compress(1) and gzip(1) formats are supported). Any flags that are specified are passed to the user's preferred PAGER (which is /usr/bin/more by default). zless is equivalent to zmore but uses less(1) as a pager instead of more(1). When multiple files are specified, zmore will pause at the end of each file and present the following prompt to the user: prev_file (END) - Next: next_file Where prev_file is the file that was just displayed and next_file is the next file to be displayed. The following keys are recognized at the prompt: e or q quit zmore. s skip the next file (or exit if the next file is the last). If no files are specified, zmore will read from the standard input. In this mode zmore will assume gzip(1) style compression since there is no suffix on which to make a decision. ENVIRONMENT PAGER Program used to display files. If unset, /usr/bin/more is used (zmore) or /usr/bin/less (zless). SEE ALSO compress(1), less(1), more(1) macOS 14.5 October 22, 2014 macOS 14.5
zmore, zless – view compressed files
zmore [flags] [file ...] zless [flags] [file ...]
null
null
enc2xs5.34
enc2xs builds a Perl extension for use by Encode from either Unicode Character Mapping files (.ucm) or Tcl Encoding Files (.enc). Besides being used internally during the build process of the Encode module, you can use enc2xs to add your own encoding to perl. No knowledge of XS is necessary. Quick Guide If you want to know as little about Perl as possible but need to add a new encoding, just read this chapter and forget the rest. 0. Have a .ucm file ready. You can get it from somewhere or you can write your own from scratch or you can grab one from the Encode distribution and customize it. For the UCM format, see the next Chapter. In the example below, I'll call my theoretical encoding myascii, defined in my.ucm. "$" is a shell prompt. $ ls -F my.ucm 1. Issue a command as follows; $ enc2xs -M My my.ucm generating Makefile.PL generating My.pm generating README generating Changes Now take a look at your current directory. It should look like this. $ ls -F Makefile.PL My.pm my.ucm t/ The following files were created. Makefile.PL - MakeMaker script My.pm - Encode submodule t/My.t - test file 1.1. If you want *.ucm installed together with the modules, do as follows; $ mkdir Encode $ mv *.ucm Encode $ enc2xs -M My Encode/*ucm 2. Edit the files generated. You don't have to if you have no time AND no intention to give it to someone else. But it is a good idea to edit the pod and to add more tests. 3. Now issue a command all Perl Mongers love: $ perl Makefile.PL Writing Makefile for Encode::My 4. Now all you have to do is make. $ make cp My.pm blib/lib/Encode/My.pm /usr/local/bin/perl /usr/local/bin/enc2xs -Q -O \ -o encode_t.c -f encode_t.fnm Reading myascii (myascii) Writing compiled form 128 bytes in string tables 384 bytes (75%) saved spotting duplicates 1 bytes (0.775%) saved using substrings .... chmod 644 blib/arch/auto/Encode/My/My.bs $ The time it takes varies depending on how fast your machine is and how large your encoding is. Unless you are working on something big like euc-tw, it won't take too long. 5. You can "make install" already but you should test first. $ make test PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib \ -e 'use Test::Harness qw(&runtests $verbose); \ $verbose=0; runtests @ARGV;' t/*.t t/My....ok All tests successful. Files=1, Tests=2, 0 wallclock secs ( 0.09 cusr + 0.01 csys = 0.09 CPU) 6. If you are content with the test result, just "make install" 7. If you want to add your encoding to Encode's demand-loading list (so you don't have to "use Encode::YourEncoding"), run enc2xs -C to update Encode::ConfigLocal, a module that controls local settings. After that, "use Encode;" is enough to load your encodings on demand. The Unicode Character Map Encode uses the Unicode Character Map (UCM) format for source character mappings. This format is used by IBM's ICU package and was adopted by Nick Ing-Simmons for use with the Encode module. Since UCM is more flexible than Tcl's Encoding Map and far more user-friendly, this is the recommended format for Encode now. A UCM file looks like this. # # Comments # <code_set_name> "US-ascii" # Required <code_set_alias> "ascii" # Optional <mb_cur_min> 1 # Required; usually 1 <mb_cur_max> 1 # Max. # of bytes/char <subchar> \x3F # Substitution char # CHARMAP <U0000> \x00 |0 # <control> <U0001> \x01 |0 # <control> <U0002> \x02 |0 # <control> .... <U007C> \x7C |0 # VERTICAL LINE <U007D> \x7D |0 # RIGHT CURLY BRACKET <U007E> \x7E |0 # TILDE <U007F> \x7F |0 # <control> END CHARMAP • Anything that follows "#" is treated as a comment. • The header section continues until a line containing the word CHARMAP. This section has a form of <keyword> value, one pair per line. Strings used as values must be quoted. Barewords are treated as numbers. \xXX represents a byte. Most of the keywords are self-explanatory. subchar means substitution character, not subcharacter. When you decode a Unicode sequence to this encoding but no matching character is found, the byte sequence defined here will be used. For most cases, the value here is \x3F; in ASCII, this is a question mark. • CHARMAP starts the character map section. Each line has a form as follows: <UXXXX> \xXX.. |0 # comment ^ ^ ^ | | +- Fallback flag | +-------- Encoded byte sequence +-------------- Unicode Character ID in hex The format is roughly the same as a header section except for the fallback flag: | followed by 0..3. The meaning of the possible values is as follows: |0 Round trip safe. A character decoded to Unicode encodes back to the same byte sequence. Most characters have this flag. |1 Fallback for unicode -> encoding. When seen, enc2xs adds this character for the encode map only. |2 Skip sub-char mapping should there be no code point. |3 Fallback for encoding -> unicode. When seen, enc2xs adds this character for the decode map only. • And finally, END OF CHARMAP ends the section. When you are manually creating a UCM file, you should copy ascii.ucm or an existing encoding which is close to yours, rather than write your own from scratch. When you do so, make sure you leave at least U0000 to U0020 as is, unless your environment is EBCDIC. CAVEAT: not all features in UCM are implemented. For example, icu:state is not used. Because of that, you need to write a perl module if you want to support algorithmical encodings, notably the ISO-2022 series. Such modules include Encode::JP::2022_JP, Encode::KR::2022_KR, and Encode::TW::HZ. Coping with duplicate mappings When you create a map, you SHOULD make your mappings round-trip safe. That is, "encode('your-encoding', decode('your-encoding', $data)) eq $data" stands for all characters that are marked as "|0". Here is how to make sure: • Sort your map in Unicode order. • When you have a duplicate entry, mark either one with '|1' or '|3'. • And make sure the '|1' or '|3' entry FOLLOWS the '|0' entry. Here is an example from big5-eten. <U2550> \xF9\xF9 |0 <U2550> \xA2\xA4 |3 Internally Encoding -> Unicode and Unicode -> Encoding Map looks like this; E to U U to E -------------------------------------- \xF9\xF9 => U2550 U2550 => \xF9\xF9 \xA2\xA4 => U2550 So it is round-trip safe for \xF9\xF9. But if the line above is upside down, here is what happens. E to U U to E -------------------------------------- \xA2\xA4 => U2550 U2550 => \xF9\xF9 (\xF9\xF9 => U2550 is now overwritten!) The Encode package comes with ucmlint, a crude but sufficient utility to check the integrity of a UCM file. Check under the Encode/bin directory for this. When in doubt, you can use ucmsort, yet another utility under Encode/bin directory. Bookmarks • ICU Home Page <http://www.icu-project.org/> • ICU Character Mapping Tables <http://site.icu-project.org/charts/charset> • ICU:Conversion Data <http://www.icu-project.org/userguide/conversion-data.html> SEE ALSO Encode, perlmod, perlpod perl v5.34.1 2024-04-13 ENC2XS(1)
enc2xs -- Perl Encode Module Generator
enc2xs -[options] enc2xs -M ModName mapfiles... enc2xs -C
null
null
xslt-config
null
null
null
null
null
sdef
sdef gets the scripting definition (“sdef”) from the specified scriptable application and writes it to standard output. The application does not have to have an actual sdef in it; sdef can translate from the older aete and Cocoa suite definition (scriptSuite/scriptTerminology pairs) formats. From there, you can examine the sdef directly, or pipe it to sdp(1) for further processing. SEE ALSO sdp(1), sdef(5) Mac OS X June 30, 2006 Mac OS X
sdef – scripting definition extractor
sdef application
null
null
ncctl
ncctl controls the caller's kernel Kerberos credentials for any of the specified path's associated NFS mounts. If no paths are specified then all the caller's associated credentials for all NFS file systems are acted upon by the command given. When an NFS file system is mounted using Kerberos through the “sec=” option or by the export specified on the server, the resulting session context is stored in a table for each mount. If the user decides to finish his or her session or chooses to use a different credential, then ncctl can be called to invalidate or change those credentials in the kernel. ncctl supports the following commands: init, set Set the mount or mounts to obtain credentials form the associated principal. Any current credential is unset. destroy, unset Unset the current credentials on the mount or mounts. list, get List the principal(s) set on the mount or mounts for this session. If no principal was set, then display “Default credential” followed by “[from ⟨principal name⟩]” if the access succeeded and “[kinit needed]” if not. If there has been no access to the file system then display “Credentials are not set”. Note the second synopsis is equivalent to ncctl [-Pv] {init | set} [-F] -p principal The third synopsis is equivalent to ncctl [-Pv] {destroy | unset} And the last synopsis is equivalent to ncctl [-Pv] {list | get} Kerberos keeps a collection of credentials which can be seen by using klist -A. The current default credential can be seen with klist without any arguments. kswitch can be used to switch the default to a different Kerberos credential. kdestroy can be use to remove all or a particular Kerberos credential. New Kerberos credentials can be obtain and added to the collection by calling kinit and those credentials can be used when accessing the mount. See kinit(1), klist(1), kswitch(1), and kdestroy(1). ncctl can set any principal from the associated Kerberos credentials or can destroy and unset credentials currently on the mount. When accessing a Kerberos mounted NFS file system, if no principal is set on the mount, when the kernel needs credentials it will make an up call to the gssd daemon and what ever the default credentials are available at the time will be used. The options are as follows: -h, --help Print a help summary of the command and then exit. -v, --verbose Be verbose and show what file system is being operated on and any resulting errors. -P, --nofollow If the trailing component resolves to a symbolic link do not resolve the link but use the current path to determine any associate NFS file system. -p, --principal ⟨principal⟩ For the init, set and ncinit commands set the principal to ⟨principal⟩. This option is required for theses commands. This option is not valid for other commands. -F, --force For the init, set and ncinit commands to not check the presence of the required principal in the Kerberos cache collection. This may be useful if Kerberos credentials will be obtain later. WARNING: If the credential is incorrectly set it may not work and no access to the file system will ever be allowed until another set or unset operation takes place. This option is not valid for other commands.
ncctl – Control NFS kernel credentials
ncctl [-Pvh] {{init | set} [-F] -p principal | {destroy | unset} | {list | get}} [path ...] ncinit [-PvhF] -p principal [path ...] ncdestroy [-Pvh] [path ...] nclist [-Pvh] [path ...]
null
If leaving for the day: $ kdestroy -A $ ncdestroy Lets say a user does $ kinit user@FOO.COM And through the automounter access a path /Network/Serves/someserver/Sources/foo/bar where the mount of /Network/Servers/someserver/Sources/foo was done with user@FOO.COM. $ cat /Network/Servers/someserver/Sources/foo/bar cat: /Network/Servers/someserver/Sources/foo/bar: Permission denied The user realizes that in order to have access on the server his identity should be user2@BAR.COM. So: $ kinit user2@BAR.COM $ ncctl set -p user2@BAR.COM Now the local user can access bar. To see your credentials $ nclist /Network/Servers/someserver/Sources/foo: user2@BAR.COM If the user destroys his credentials and then acquires new ones $ ncdestroy $ nclist -v /private/tmp/mp : No credentials are set. /Network/Servers/xs1/release : NFS mount is not using Kerberos. $ kinit user user@FOO.COM's password: ****** $ klist Credentials cache: API:648E3003-0A6B-4BB3-8447-1D5034F98EAE Principal: user@FOO.COM Issued Expires Principal Dec 15 13:57:57 2014 Dec 15 23:57:57 2014 krbtgt/FOO.COM@FOO.COM $ ls /private/tmp/mp filesystemui.socket= sysdiagnose.tar.gz x mtrecorder/ systemstats/ z $ nclist /private/tmp/mp : Default credential [from user@FOO.COM] NOTES As mentioned above credentials are per session, so the console session's credential cache collection is separate for a collections of credentials obtain in an ssh session even by the same user. Kerberos will set the default credential with klist or kswitch. However, the default credential can change without the user's knowledge, because of renewals or some other script or program in the user's session is run and does a kswitch (krb5_cc_set_default_name()) or kinit on the user's behalf. kinit may not prompt for a password if the Kerberos password for the principal is in the user's keychain. ncctl with the set command will allow a user to change the mapping of the local user identity to a different one on the server. It is up to the user to decide which identity will be used. Previous versions of gssd daemon would attempt to select credentials if they were not set, by choosing credentials in the same realm as the server. This was imperfect and that has been removed. There may be multiple credentials in the same realm or a user may prefer a cross realm principal. It is highly recommended that after accessing a mount (typically through the automounter) that if the user has access to multiple credentials to set the credential on the mount that they want to use. The current default credential will be used by the automounter on first mount. If you do not explicitly set the credentials to use, then if the server expires the credential, the client will use the current default credential at the time of renewal and that may be a different identity. If using mount directly a user can select what credential to use for the mount and subsequently there after (at least until a new ncctl set command is run) by using the principal=⟨principal⟩ option. It is also possible to select the realm to use with the realm=⟨realm⟩ option. The latter can be useful to administrators in automounter maps. There is currently no way to remember what the chosen identity is for a given mount after its been unmounted. So for automounted mounts a reference it taken on the mount point so unmounts will not happen until all credentials on a mount with a set principal have been destroyed. Forced unmounts will not be effected. nclist or ncctl get can be used to see what credentials are actually being used and ncdestroy or ncctl unset can be used to destroy that session's credential. Accessing the mount after its credentials have been destroyed will cause the default credential to be used until the next ncinit or ncctl set Default credentials for an automounted NFS mount will not prevent the unmounting of the file system. DIAGNOSTICS The ncctl command will exit with 1 if any of the supplied paths doesn't exist or there is an error returned for any path tried. If all paths exist and no errors are returned the exit status will be 0. SEE ALSO kdestroy(1), kinit(1), klist(1), kswitch(1), mount_nfs(8) BUGS There should be an option to kdestroy to destroy cached NFS contexts. macOS 14.5 January 14, 2015 macOS 14.5
jmc
null
null
null
null
null
pod2text
pod2text is a wrapper script around the Pod::Text and its subclasses. It uses them to generate formatted text from POD source. It can optionally use either termcap sequences or ANSI color escape sequences to format the text. input is the file to read for POD source (the POD can be embedded in code). If input isn't given, it defaults to "STDIN". output, if given, is the file to which to write the formatted output. If output isn't given, the formatted output is written to "STDOUT". Several POD files can be processed in the same pod2text invocation (saving module load and compile times) by providing multiple pairs of input and output files on the command line. By default, the output encoding is the same as the encoding of the input file, or UTF-8 if that encoding is not set (except on EBCDIC systems). See the -e option to explicitly set the output encoding and "Encoding" in Pod::Text for more discussion.
pod2text - Convert POD data to formatted ASCII text
pod2text [-aclostu] [--code] [-e encoding] [--errors=style] [--guesswork=rule[,rule...]] [-i indent] [-q quotes] [--nourls] [--stderr] [-w width] [input [output ...]] pod2text -h
Each option is annotated with the version of podlators in which that option was added with its current meaning. -a, --alt [1.00] Use an alternate output format that, among other things, uses a different heading style and marks "=item" entries with a colon in the left margin. --code [1.11] Include any non-POD text from the input file in the output as well. Useful for viewing code documented with POD blocks with the POD rendered and the code left intact. -c, --color [1.00] Format the output with ANSI color escape sequences. Using this option requires that Term::ANSIColor be installed on your system. -e encoding, --encoding=encoding [5.00] Specifies the encoding of the output. encoding must be an encoding recognized by the Encode module (see Encode::Supported). If the output contains characters that cannot be represented in this encoding, that is an error that will be reported as configured by the "errors" option. If error handling is other than "die", the unrepresentable character will be replaced with the Encode substitution character (normally "?"). WARNING: The input encoding of the POD source is independent from the output encoding, and setting this option does not affect the interpretation of the POD input. Unless your POD source is US- ASCII, its encoding should be declared with the "=encoding" command in the source, as near to the top of the file as possible. If this is not done, Pod::Simple will will attempt to guess the encoding and may be successful if it's Latin-1 or UTF-8, but it will produce warnings. See perlpod(1) for more information. --errors=style [2.5.0] Set the error handling style. "die" says to throw an exception on any POD formatting error. "stderr" says to report errors on standard error, but not to throw an exception. "pod" says to include a POD ERRORS section in the resulting documentation summarizing the errors. "none" ignores POD errors entirely, as much as possible. The default is "die". --guesswork=rule[,rule...] [5.01] By default, pod2text applies some default formatting rules based on guesswork and regular expressions that are intended to make writing Perl documentation easier and require less explicit markup. These rules may not always be appropriate, particularly for documentation that isn't about Perl. This option allows turning all or some of it off. The special rule "all" enables all guesswork. This is also the default for backward compatibility reasons. The special rule "none" disables all guesswork. Otherwise, the value of this option should be a comma-separated list of one or more of the following keywords: quoting If no guesswork is enabled, any text enclosed in C<> is surrounded by double quotes in nroff (terminal) output unless the contents are already quoted. When this guesswork is enabled, quote marks will also be suppressed for Perl variables, function names, function calls, numbers, and hex constants. Any unknown guesswork name is silently ignored (for potential future compatibility), so be careful about spelling. -i indent, --indent=indent [1.00] Set the number of spaces to indent regular text, and the default indentation for "=over" blocks. Defaults to 4 spaces if this option isn't given. -h, --help [1.00] Print out usage information and exit. -l, --loose [1.00] Print a blank line after a "=head1" heading. Normally, no blank line is printed after "=head1", although one is still printed after "=head2", because this is the expected formatting for manual pages; if you're formatting arbitrary text documents, using this option is recommended. -m width, --left-margin=width, --margin=width [1.24] The width of the left margin in spaces. Defaults to 0. This is the margin for all text, including headings, not the amount by which regular text is indented; for the latter, see -i option. --nourls [2.5.0] Normally, L<> formatting codes with a URL but anchor text are formatted to show both the anchor text and the URL. In other words: L<foo|http://example.com/> is formatted as: foo <http://example.com/> This flag, if given, suppresses the URL when anchor text is given, so this example would be formatted as just "foo". This can produce less cluttered output in cases where the URLs are not particularly important. -o, --overstrike [1.06] Format the output with overstrike printing. Bold text is rendered as character, backspace, character. Italics and file names are rendered as underscore, backspace, character. Many pagers, such as less, know how to convert this to bold or underlined text. -q quotes, --quotes=quotes [4.00] Sets the quote marks used to surround C<> text to quotes. If quotes is a single character, it is used as both the left and right quote. Otherwise, it is split in half, and the first half of the string is used as the left quote and the second is used as the right quote. quotes may also be set to the special value "none", in which case no quote marks are added around C<> text. -s, --sentence [1.00] Assume each sentence ends with two spaces and try to preserve that spacing. Without this option, all consecutive whitespace in non-verbatim paragraphs is compressed into a single space. --stderr [2.1.3] By default, pod2text dies if any errors are detected in the POD input. If --stderr is given and no --errors flag is present, errors are sent to standard error, but pod2text does not abort. This is equivalent to "--errors=stderr" and is supported for backward compatibility. -t, --termcap [1.00] Try to determine the width of the screen and the bold and underline sequences for the terminal from termcap, and use that information in formatting the output. Output will be wrapped at two columns less than the width of your terminal device. Using this option requires that your system have a termcap file somewhere where Term::Cap can find it and requires that your system support termios. With this option, the output of pod2text will contain terminal control sequences for your current terminal type. -u, --utf8 [2.2.0] Set the output encoding to UTF-8. This is equivalent to "--encoding=UTF-8" and is supported for backward compatibility. -w, --width=width, -width [1.00] The column at which to wrap text on the right-hand side. Defaults to 76, unless -t is given, in which case it's two columns less than the width of your terminal device. EXIT STATUS As long as all documents processed result in some output, even if that output includes errata (a "POD ERRORS" section generated with "--errors=pod"), pod2text will exit with status 0. If any of the documents being processed do not result in an output document, pod2text will exit with status 1. If there are syntax errors in a POD document being processed and the error handling style is set to the default of "die", pod2text will abort immediately with exit status 255. DIAGNOSTICS If pod2text fails with errors, see Pod::Text and Pod::Simple for information about what those errors might mean. Internally, it can also produce the following diagnostics: -c (--color) requires Term::ANSIColor be installed (F) -c or --color were given, but Term::ANSIColor could not be loaded. Unknown option: %s (F) An unknown command line option was given. In addition, other Getopt::Long error messages may result from invalid command-line options. ENVIRONMENT COLUMNS If -t is given, pod2text will take the current width of your screen from this environment variable, if available. It overrides terminal width information in TERMCAP. TERMCAP If -t is given, pod2text will use the contents of this environment variable if available to determine the correct formatting sequences for your current terminal device. AUTHOR Russ Allbery <rra@cpan.org>. COPYRIGHT AND LICENSE Copyright 1999-2001, 2004, 2006, 2008, 2010, 2012-2019, 2022 Russ Allbery <rra@cpan.org> This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO Encode::Supported, Pod::Text, Pod::Text::Color, Pod::Text::Overstrike, Pod::Text::Termcap, Pod::Simple, perlpod(1) The current version of this script is always available from its web site at <https://www.eyrie.org/~eagle/software/podlators/>. It is also part of the Perl core distribution as of 5.6.0. perl v5.38.2 2023-11-28 POD2TEXT(1)
null
bashbug
bashbug is a shell script to help the user compose and mail bug reports concerning bash in a standard format. bashbug invokes the editor specified by the environment variable EDITOR on a temporary copy of the bug report format outline. The user must fill in the appropriate fields and exit the editor. bashbug then mails the completed report to bug- bash@gnu.org, or address. If the report cannot be mailed, it is saved in the file dead.bashbug in the invoking user's home directory. The bug report format outline consists of several sections. The first section provides information about the machine, operating system, the bash version, and the compilation environment. The second section should be filled in with a description of the bug. The third section should be a description of how to reproduce the bug. The optional fourth section is for a proposed fix. Fixes are encouraged. ENVIRONMENT bashbug will utilize the following environment variables if they exist: EDITOR Specifies the preferred editor. If EDITOR is not set, bashbug defaults to emacs. HOME Directory in which the failed bug report is saved if the mail fails. GNU 1998 July 30 BASHBUG(1)
bashbug - report a bug in bash
bashbug [address]
null
null
mail
null
mail, mailx – send and receive mail
mail [-dEiInv] [-s subject] [-c cc-addr] [-b bcc-addr] [-F] to-addr ... mail [-dEHiInNv] [-F] -f [name] mail [-dEHiInNv] [-F] [-u user] mail [-d] -e [-f name] mail [-H] INTRODUCTION The mail utility is an intelligent mail processing system, which has a command syntax reminiscent of ed(1) with lines replaced by messages. The following options are available: -v Verbose mode. The details of delivery are displayed on the user's terminal. -d Debugging mode. See the debug mail option for details. -e Test for the presence of mail in the (by default, system) mailbox. An exit status of 0 is returned if it has mail; otherwise, an exit status of 1 is returned. -H Write a header summary only, then exit. -E Do not send messages with an empty body. This is useful for piping errors from cron(8) scripts. -i Ignore tty interrupt signals. This is particularly useful when using mail on noisy phone lines. -I Force mail to run in interactive mode even when input is not a terminal. In particular, the ‘~’ special character when sending mail is only active in interactive mode. -n Inhibit reading the system-wide mail.rc files upon startup. -N Inhibit the initial display of message headers when reading mail or editing a mail folder. -s subject Specify subject on command line. (Only the first argument after the -s flag is used as a subject; be careful to quote subjects containing spaces.) -c cc-addr Send carbon copies to cc-addr list of users. The cc-addr argument should be a comma-separated list of names. -b bcc-addr Send blind carbon copies to bcc-addr list of users. The bcc-addr argument should be a comma-separated list of names. -f Use an alternate mailbox. Defaults to the user's mbox if no file is specified. When quit, mail writes undeleted messages back to this file. -F Record the message in a file named after the first recipient. The name is the login-name portion of the address found first on the “To:” line in the mail header. Overrides the record variable, if set. -u user Is equivalent to: mail -f /var/mail/user Startup Actions At startup time mail will execute commands in the system command files /usr/share/misc/mail.rc, /usr/local/etc/mail.rc and /etc/mail.rc in order, unless explicitly told not to by the use of the -n option. Next, the commands in the user's personal command file ~/.mailrc are executed. The mail utility then examines its command line options to determine whether a new message is to be sent, or whether an existing mailbox is to be read. Sending Mail To send a message to one or more people, mail can be invoked with arguments which are the names of people to whom the mail will be sent. You are then expected to type in your message, followed by a ⟨control-D⟩ at the beginning of a line. The section below Replying To or Originating Mail, describes some features of mail available to help you compose your letter. Reading Mail In normal usage mail is given no arguments and checks your mail out of the post office, then prints out a one line header of each message found. The current message is initially the first message (numbered 1) and can be printed using the print command (which can be abbreviated p). You can move among the messages much as you move between lines in ed(1), with the commands + and - moving backwards and forwards, and simple numbers. Disposing of Mail After examining a message you can delete (d) the message or reply (r) to it. Deletion causes the mail program to forget about the message. This is not irreversible; the message can be undeleted (u) by giving its number, or the mail session can be aborted by giving the exit (x) command. Deleted messages will, however, usually disappear never to be seen again. Specifying Messages Commands such as print and delete can be given a list of message numbers as arguments to apply to a number of messages at once. Thus “delete 1 2” deletes messages 1 and 2, while “delete 1-5” deletes messages 1 through 5. The special name ‘*’ addresses all messages, and ‘$’ addresses the last message; thus the command top which prints the first few lines of a message could be used in “top *” to print the first few lines of all messages. Replying To or Originating Mail You can use the reply command to set up a response to a message, sending it back to the person who it was from. Text you then type in, up to an end-of-file, defines the contents of the message. While you are composing a message, mail treats lines beginning with the character ‘~’ specially. For instance, typing ~m (alone on a line) will place a copy of the current message into the response right shifting it by a tabstop (see indentprefix variable, below). Other escapes will set up subject fields, add and delete recipients to the message and allow you to escape to an editor to revise the message or to a shell to run some commands. (These options are given in the summary below.) Ending a Mail Processing Session You can end a mail session with the quit (q) command. Messages which have been examined go to your mbox file unless they have been deleted in which case they are discarded. Unexamined messages go back to the post office. (See the -f option above). Personal and System Wide Distribution Lists It is also possible to create a personal distribution lists so that, for instance, you can send mail to “cohorts” and have it go to a group of people. Such lists can be defined by placing a line like alias cohorts bill ozalp jkf mark kridle@ucbcory in the file .mailrc in your home directory. The current list of such aliases can be displayed with the alias command in mail. System wide distribution lists can be created by editing /etc/mail/aliases, see aliases(5) and sendmail(8); these are kept in a different syntax. In mail you send, personal aliases will be expanded in mail sent to others so that they will be able to reply to the recipients. System wide aliases are not expanded when the mail is sent, but any reply returned to the machine will have the system wide alias expanded as all mail goes through sendmail(8). Recipient address specifications Recipient addresses (any of the “To”, “Cc” or “Bcc” header fields) are subject to expansion when the expandaddr option is set. An address may be expanded as follows: • An address that starts with a pipe (‘|’) character is treated as a command to run. The command immediately following the ‘|’ is executed with the message as its standard input. • An address that starts with a ‘+’ character is treated as a folder. • An address that contains a ‘/’ character but no ‘!’, ‘%’, or ‘@’ characters is also treated as a folder. • If none of the above apply, the recipient is treated as a local or network mail address. If the expandaddr option is not set (the default), no expansion is performed and the recipient is treated as a local or network mail address. Network Mail (ARPA, UUCP, Berknet) The mail utility has a number of options which can be set in the .mailrc file to alter its behavior; thus “set askcc” enables the askcc feature. (These options are summarized below.) SUMMARY (Adapted from the Mail Reference Manual.) Each command is typed on a line by itself, and may take arguments following the command word. The command need not be typed in its entirety — the first command which matches the typed prefix is used. For commands which take message lists as arguments, if no message list is given, then the next message forward which satisfies the command's requirements is used. If there are no messages forward of the current message, the search proceeds backwards, and if there are no good messages at all, mail types “No applicable messages” and aborts the command. - Print out the preceding message. If given a numeric argument n, goes to the n'th previous message and prints it. # ignore the remainder of the line as a comment. ? Prints a brief summary of commands. ! Executes the shell (see sh(1) and csh(1)) command which follows. Print (P) Like print but also prints out ignored header fields. See also print, ignore and retain. Reply (R) Reply to originator. Does not reply to other recipients of the original message. Type (T) Identical to the Print command. alias (a) With no arguments, prints out all currently-defined aliases. With one argument, prints out that alias. With more than one argument, creates a new alias or changes an old one. alternates (alt) The alternates command is useful if you have accounts on several machines. It can be used to inform mail that the listed addresses are really you. When you reply to messages, mail will not send a copy of the message to any of the addresses listed on the alternates list. If the alternates command is given with no argument, the current set of alternative names is displayed. chdir (c) Changes the user's working directory to that specified, if given. If no directory is given, then changes to the user's login directory. copy (co) The copy command does the same thing that save does, except that it does not mark the messages it is used on for deletion when you quit. delete (d) Takes a list of messages as argument and marks them all as deleted. Deleted messages will not be saved in mbox, nor will they be available for most other commands. dp (also dt) Deletes the current message and prints the next message. If there is no next message, mail says “at EOF”. edit (e) Takes a list of messages and points the text editor at each one in turn. On return from the editor, the message is read back in. exit (ex or x) Effects an immediate return to the shell without modifying the user's system mailbox, his mbox file, or his edit file in -f. file (fi) The same as folder. folders List the names of the folders in your folder directory. folder (fo) The folder command switches to a new mail file or folder. With no arguments, it tells you which file you are currently reading. If you give it an argument, it will write out changes (such as deletions) you have made in the current file and read in the new file. Some special conventions are recognized for the name. ‘#’ means the previous file, ‘%’ means your system mailbox, “%user” means user's system mailbox, ‘&’ means your mbox file, and “+folder” means a file in your folder directory. from (f) Takes a list of messages and prints their message headers. headers (h) Lists the current range of headers, which is an 18-message group. If a ‘+’ argument is given, then the next 18-message group is printed, and if a ‘-’ argument is given, the previous 18-message group is printed. help A synonym for ?. hold (ho, also preserve) Takes a message list and marks each message therein to be saved in the user's system mailbox instead of in mbox. Does not override the delete command. ignore Add the list of header fields named to the ignored list. Header fields in the ignore list are not printed on your terminal when you print a message. This command is very handy for suppression of certain machine-generated header fields. The Type and Print commands can be used to print a message in its entirety, including ignored fields. If ignore is executed with no arguments, it lists the current set of ignored fields. inc Incorporate any new messages that have arrived while mail is being read. The new messages are added to the end of the message list, and the current message is reset to be the first new mail message. This does not renumber the existing message list, nor does it cause any changes made so far to be saved. mail (m) Takes as argument login names and distribution group names and sends mail to those people. mbox Indicate that a list of messages be sent to mbox in your home directory when you quit. This is the default action for messages if you do not have the hold option set. more (mo) Takes a list of messages and invokes the pager on that list. next (n, like + or CR) Goes to the next message in sequence and types it. With an argument list, types the next matching message. preserve (pre) A synonym for hold. print (p) Takes a message list and types out each message on the user's terminal. quit (q) Terminates the session, saving all undeleted, unsaved messages in the user's mbox file in his login directory, preserving all messages marked with hold or preserve or never referenced in his system mailbox, and removing all other messages from his system mailbox. If new mail has arrived during the session, the message “You have new mail” is given. If given while editing a mailbox file with the -f flag, then the edit file is rewritten. A return to the shell is effected, unless the rewrite of edit file fails, in which case the user can escape with the exit command. reply (r) Takes a message list and sends mail to the sender and all recipients of the specified message. The default message must not be deleted. respond A synonym for reply. retain Add the list of header fields named to the retained list. Only the header fields in the retained list are shown on your terminal when you print a message. All other header fields are suppressed. The type and print commands can be used to print a message in its entirety. If retain is executed with no arguments, it lists the current set of retained fields. save (s) Takes a message list and a filename and appends each message in turn to the end of the file. The filename in quotes, followed by the line count and character count is echoed on the user's terminal. set (se) With no arguments, prints all variable values. Otherwise, sets option. Arguments are of the form option=value (no space before or after ‘=’) or option. Quotation marks may be placed around any part of the assignment statement to quote blanks or tabs, i.e. “set indentprefix="->"” saveignore Saveignore is to save what ignore is to print and type. Header fields thus marked are filtered out when saving a message by save or when automatically saving to mbox. saveretain Saveretain is to save what retain is to print and type. Header fields thus marked are the only ones saved with a message when saving by save or when automatically saving to mbox. Saveretain overrides saveignore. shell (sh) Invokes an interactive version of the shell. size Takes a message list and prints out the size in characters of each message. source The source command reads commands from a file. top Takes a message list and prints the top few lines of each. The number of lines printed is controlled by the variable toplines and defaults to 5. type (t) A synonym for print. unalias Takes a list of names defined by alias commands and discards the remembered groups of users. The group names no longer have any significance. undelete (u) Takes a message list and marks each message as not being deleted. unread (U) Takes a message list and marks each message as not having been read. unset Takes a list of option names and discards their remembered values; the inverse of set. visual (v) Takes a message list and invokes the display editor on each message. write (w) Similar to save, except that only the message body (without the header) is saved. Extremely useful for such tasks as sending and receiving source program text over the message system. xit (x) A synonym for exit. z The mail utility presents message headers in windowfuls as described under the headers command. You can move mail's attention forward to the next window with the z command. Also, you can move to the previous window by using z-. Tilde/Escapes Here is a summary of the tilde escapes, which are used when composing messages to perform special functions. Tilde escapes are only recognized at the beginning of lines. The name “tilde escape” is somewhat of a misnomer since the actual escape character can be set by the option escape. ~a Inserts the autograph string from the sign= option into the message. ~A Inserts the autograph string from the Sign= option into the message. ~b name ... Add the given names to the list of carbon copy recipients but do not make the names visible in the Cc: line (“blind” carbon copy). ~c name ... Add the given names to the list of carbon copy recipients. ~d Read the file dead.letter from your home directory into the message. ~e Invoke the text editor on the message collected so far. After the editing session is finished, you may continue appending text to the message. ~f messages Read the named messages into the message being sent. If no messages are specified, read in the current message. Message headers currently being ignored (by the ignore or retain command) are not included. ~F messages Identical to ~f, except all message headers are included. ~h Edit the message header fields by typing each one in turn and allowing the user to append text to the end or modify the field by using the current terminal erase and kill characters. ~i string Inserts the value of the named option into the text of the message. ~m messages Read the named messages into the message being sent, indented by a tab or by the value of indentprefix. If no messages are specified, read the current message. Message headers currently being ignored (by the ignore or retain command) are not included. ~M messages Identical to ~m, except all message headers are included. ~p Print out the message collected so far, prefaced by the message header fields. ~q Abort the message being sent, copying the message to dead.letter in your home directory if save is set. ~r filename, ~r !command ~< filename, ~< !command Read the named file into the message. If the argument begins with a ‘!’, the rest of the string is taken as an arbitrary system command and is executed, with the standard output inserted into the message. ~R string Use string as the Reply-To field. ~s string Cause the named string to become the current subject field. ~t name ... Add the given names to the direct recipient list. ~v Invoke an alternative editor (defined by the VISUAL environment variable) on the message collected so far. Usually, the alternative editor will be a screen editor. After you quit the editor, you may resume appending text to the end of your message. ~w filename Write the message onto the named file. ~x Exits as with ~q, except the message is not saved in dead.letter. ~! command Execute the indicated shell command, then return to the message. ~| command, ~^ command Pipe the message through the command as a filter. If the command gives no output or terminates abnormally, retain the original text of the message. The command fmt(1) is often used as command to rejustify the message. ~: mail-command, ~_ mail-command Execute the given mail command. Not all commands, however, are allowed. ~. Simulate end-of-file on input. ~? Print a summary of the available command escapes. ~~ string Insert the string of text in the message prefaced by a single ‘~’. If you have changed the escape character, then you should double that character in order to send it. Mail Options Options can be set with the set command and can be disabled with the unset or set noname commands. Options may be either binary, in which case it is only significant to see whether they are set or not; or string, in which case the actual value is of interest. If an option is not set, mail will look for an environment variable of the same name. The available options include the following: append Causes messages saved in mbox to be appended to the end rather than prepended. This should always be set (preferably in one of the system-wide mail.rc files). Default is noappend. ask, asksub Causes mail to prompt you for the subject of each message you send. If you respond with simply a newline, no subject field will be sent. Default is asksub. askbcc Causes you to be prompted for additional blind carbon copy recipients at the end of each message. Responding with a newline indicates your satisfaction with the current list. Default is noaskbcc. askcc Causes you to be prompted for additional carbon copy recipients at the end of each message. Responding with a newline indicates your satisfaction with the current list. Default is noaskcc. autoinc Causes new mail to be automatically incorporated when it arrives. Setting this is similar to issuing the inc command at each prompt, except that the current message is not reset when new mail arrives. Default is noautoinc. autoprint Causes the delete command to behave like dp; thus, after deleting a message, the next one will be typed automatically. Default is noautoprint. crt The valued option crt is used as a threshold to determine how long a message must be before PAGER is used to read it. If crt is set without a value, then the height of the terminal screen stored in the system is used to compute the threshold (see stty(1)). Default is nocrt. debug Setting the binary option debug is the same as specifying -d on the command line and causes mail to output all sorts of information useful for debugging mail. In case mail is invoked in this mode to send mail, all preparations will be performed and reported about, but the mail will not be actually sent. Default is nodebug. dot The binary option dot causes mail to interpret a period alone on a line as the terminator of a message you are sending. Default is nodot. escape If defined, the first character of this option gives the character to use in place of ‘~’ to denote escapes. expandaddr Causes mail to expand message recipient addresses, as explained in the section Recipient address specifications. flipr Reverses the sense of reply and Reply commands. Default is noflipr. folder The name of the directory to use for storing folders of messages. If this name begins with a ‘/’, mail considers it to be an absolute pathname; otherwise, the folder directory is found relative to your home directory. header If defined, initially display message headers when reading mail or editing a mail folder. Default is header. This option can be disabled by giving the -N flag on the command line. hold This option is used to hold messages in the system mailbox by default. Default is nohold. ignore Causes interrupt signals from your terminal to be ignored and echoed as @'s. Default is noignore. ignoreeof An option related to dot is ignoreeof which makes mail refuse to accept a ⟨control-D⟩ as the end of a message. Ignoreeof also applies to mail command mode. Default is noignoreeof. indentprefix String used by the ~m tilde escape for indenting messages, in place of the normal tab character (^I). Be sure to quote the value if it contains spaces or tabs. metoo Usually, when a group is expanded that contains the sender, the sender is removed from the expansion. Setting this option causes the sender to be included in the group. Default is nometoo. quiet Suppresses the printing of the version when first invoked. Default is noquiet. record If defined, gives the pathname of the file used to record all outgoing mail. If not defined, outgoing mail is not saved. Default is norecord. Replyall Reverses the sense of reply and Reply commands. Default is noReplyall. save If this option is set, and you abort a message with two RUBOUT (erase or delete), mail will copy the partial letter to the file dead.letter in your home directory. Default is save. searchheaders If this option is set, then a message-list specifier in the form “/x:y” will expand to all messages containing the substring y in the header field x. The string search is case insensitive. If x is omitted, it will default to the “Subject” header field. The form “/to:y” is a special case, and will expand to all messages containing the substring y in the “To”, “Cc” or “Bcc” header fields. The check for "to" is case sensitive, so that “/To:y” can be used to limit the search for y to just the “To:” field. Default is nosearchheaders. toplines If defined, gives the number of lines of a message to be printed out with the top command; normally, the first five lines are printed. verbose Setting the option verbose is the same as using the -v flag on the command line. When mail runs in verbose mode, the actual delivery of messages is displayed on the user's terminal. Default is noverbose. ENVIRONMENT DEAD Pathname of the file to save partial messages to in case of interrupts or delivery errors. Default is ~/dead.letter. EDITOR Pathname of the text editor to use in the edit command and ~e escape. If not defined, then a default editor is used. HOME Pathname of the user's home directory. LISTER Pathname of the directory lister to use in the folders command. Default is /bin/ls. MAIL Location of the user's mailbox. Default is /var/mail. MAILRC Pathname of file containing initial mail commands. Default is ~/.mailrc. MBOX The name of the mailbox file. It can be the name of a folder. The default is mbox in the user's home directory. PAGER Pathname of the program to use in the more command or when crt variable is set. The default paginator less(1) is used if this option is not defined. REPLYTO If set, will be used to initialize the Reply-To field for outgoing messages. SHELL Pathname of the shell to use in the ! command and the ~! escape. A default shell is used if this option is not defined. TMPDIR Pathname of the directory used for creating temporary files. VISUAL Pathname of the text editor to use in the visual command and ~v escape. USER Login name of the user executing mail. FILES /var/mail/* Post office. ~/mbox User's old mail. ~/.mailrc File giving initial mail commands. This can be overridden by setting the MAILRC environment variable. /tmp/R* Temporary files. /usr/share/misc/mail.*help Help files. /usr/share/misc/mail.rc /usr/local/etc/mail.rc /etc/mail.rc System-wide initialization files. Each file will be sourced, in order, if it exists. SEE ALSO fmt(1), newaliases(1), vacation(1), aliases(5), sendmail(8) HISTORY A mail command appeared in Version 1 AT&T UNIX. This man page is derived from The Mail Reference Manual originally written by Kurt Shoens. BUGS Usually, mail is just a link to Mail and mailx, which can be confusing. The name of the alternates list is incorrect English (it should be “alternatives”), but is retained for compatibility. macOS 14.5 August 8, 2018 macOS 14.5
null
null
yamlpp-parse-emit5.30
null
null
null
null
null
chpass
The chpass utility allows editing of the user database information associated with user or, by default, the current user. The chpass utility cannot change the user's password on Open Directory systems. Use the passwd(1) utility instead. The chfn and chsh utilities behave identically to chpass. (There is only one program.) The information is formatted and supplied to an editor for changes. Only the information that the user is allowed to change is displayed. The options are as follows: -l location If not specified, chpass will perform a search for the user record on all available Open Directory nodes. When specified, chpass will edit the user record on the directory node at the given location. -u authname The user name to use when authenticating to the directory node containing the user. -s newshell Attempt to change the user's shell to newshell. Possible display items are as follows: Login: user's login name Uid: user's login Gid: user's login group Generated uid: user's UUID Full Name: user's real name Office Location: user's office location Office Phone: user's office phone Home Phone: user's home phone Home Directory: user's home directory Shell: user's login shell The login field is the user name used to access the computer account. The uid field is the number associated with the login field. Both of these fields should be unique across the system (and often across a group of systems) as they control file access. While it is possible to have multiple entries with identical login names and/or identical user id's, it is usually a mistake to do so. Routines that manipulate these files will often return only one of the multiple entries, and that one by random selection. The gid field is the group that the user will be placed in at login. Since BSD supports multiple groups (see groups(1)) this field currently has little special meaning. This field may be filled in with either a number or a group name (see group(5)). The generated uid field is the globally unique identifier (UUID) for the user. The full name field contains the full name of the user. The user's home directory is the full UNIX path name where the user will be placed at login. The shell field is the command interpreter the user prefers. If the shell field is empty, the Bourne shell, /bin/sh, is assumed. When altering a login shell, and not the super-user, the user may not change from a non-standard shell or to a non-standard shell. Non-standard is defined as a shell not found in /etc/shells. The picture field is the path to a picture to be displayed for the user. OPEN DIRECTORY User database entries are under the control of DirectoryService(8) and may be physically located in many different places, including the local Directory Service node, and remote LDAP servers. This version of chpass uses Open Directory to change user database information. It does not interact with the historic flat file database /etc/master.passwd ENVIRONMENT The vi(1) editor will be used unless the environment variable EDITOR is set to an alternate editor. When the editor terminates, the information is re-read and used to update the user database itself. Only the user, or the super-user, may edit the information associated with the user. FILES /etc/chpass.XXXXXX temporary file /etc/shells the list of approved shells
chpass, chfn, chsh – add or change user database information
chpass [-l location] [-u authname] [-s newshell] [user]
null
Change the shell of the current user to ‘/bin/zsh’: chsh -s /bin/zsh SEE ALSO login(1), passwd(1), getusershell(3), DirectoryService(8) Robert Morris and Ken Thompson, UNIX Password security. HISTORY The chpass utility appeared in 4.3BSD-Reno. macOS 14.5 May 25, 2021 macOS 14.5
sips
This tool is used to query or modify raster image files and ColorSync ICC profiles. Its functionality can also be used through the "Image Events" AppleScript suite. It also supports executing JavaScript to either modify or generate images. FUNCTIONS Profile query functions: -g key --getProperty key Output the property value for key to stdout. -X tag tagFile --extractTag tag tagFile Write a profile tag element to tagFile. --verify Verify any profile problems and log output to stdout. -1 --oneLine Output for each file on a single line with tab delimiter Image query functions: -g key --getProperty key Output the property value for key to stdout. -x profile --extractProfile profile Get the embedded profile from image and write it to profile. -1 --oneLine Output for each file on a single line with tab delimiter Profile modification functions: -s key value --setProperty key value Set a property value for key to value. -d key --deleteProperty key Remove a property value for key. --deleteTag tag Remove the tag element from a profile. --copyTag srcTag dstTag Copy the srcTag element of a profile to dstTag. --loadTag tag tagFile Set the tag element of a profile to the contents of tagFile. --repair Repair any profile problems and log output to stdout. -o file-or-directory --out file-or-directory Image modification functions: -s key value --setProperty key value Set a property value for key to value. -d key --deleteProperty key Remove a property value for key. -e profile --embedProfile profile Embed profile in image. -E profile --embedProfileIfNone profile Embed profile in image only if image doen't have a profile. -m profile --matchTo profile Color match image to profile. -M profile intent --matchToWithIntent profile intent Color match image to profile with rendering intent perceptual | relative | saturation | absolute. --deleteColorManagementProperties Delete color management properties in TIFF, PNG, and EXIF dictionaries. -r degreesCW --rotate degreesCW -f horizontal|vertical --flip horizontal|vertical -c pixelsH pixelsW --cropToHeightWidth pixelsH pixelsW Crop image to fit specified size. --cropOffset offsetY offsetH Crop offset from top left corner. -p pixelsH pixelsW --padToHeightWidth pixelsH pixelsW Pad image with pixels to fit specified size. --padColor hexcolor Use this color when padding. White=FFFFFF, Red=FF0000, Default=Black=000000 -z pixelsH pixelsW --resampleHeightWidth pixelsH pixelsW Resample image at specified size. Image apsect ratio may be altered. --resampleWidth pixelsW Resample image to specified width. --resampleHeight pixelsH Resample image to specified height. -Z pixelsWH --resampleHeightWidthMax pixelsWH Resample image so height and width aren't greater than specified size. -i --addIcon Add a Finder icon to image file. --optimizeColorForSharing Optimize color for sharing. -o file-or-directory --out file-or-directory -j file --js file Execute JavaScript file Other functions: --debug Enable debugging output -h --help Show help -H --helpProperties Show help for properties --man Generate man pages -v --version Show the version --formats Show the read/write formats JavaScript HTML Canvas objects can be created and used to create a 2D drawing context. The commands for drawing into the context are well documented elsewhere. This section will describe the sips global object and other interesting classes. Global variable (sips) properties images Valid images passed as arguments converted into an array of Image objects arguments Arguments passed into the program as an array of strings size Recommended size for output. Setting the crop or resample flags will set this value. longestEdge If specified, the value of the -Z/--resampleHeightWidthMax option. [default: 0] outputPath Output directory [default: current directory] Image Object name Name of image size Size of image (pixels) properties Image properties getProperty(name) Return the image property for name, if any. sizeToFitLongestEdge(length) Return the size that will contain the image with the longest edge set to length. Maintains aspect ratio. Output Object new Output(context, name[, type]) Output the context to disk with name and optional type (extension or UTI). addToQueue() Adds the output to the queue to be written to disk. Functions print(str) Output to standard output. Equivalent to console.log(str).
sips – scriptable image processing system.
sips [image-functions] imagefile ... sips [profile-functions] profile ...
The commands --getProperty, --setProperty, and --deleteProperty can use one of the following keys as a parameter. Special property keys: all binary data allxml binary data Image property keys: dpiHeight float dpiWidth float pixelHeight integer (read-only) pixelWidth integer (read-only) typeIdentifier string (read-only) format string jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi | tga formatOptions string default | [low|normal|high|best|<percent>] | [lzw|packbits] space string (read-only) samplesPerPixel integer (read-only) bitsPerSample integer (read-only) creation string (read-only) make string model string software string (read-only) description string copyright string artist string profile binary data hasAlpha boolean (read-only) Profile property keys: description utf8 string size integer (read-only) cmm string version string class string (read-only) space string (read-only) pcs string (read-only) creation string platform string quality string normal | draft | best deviceManufacturer string deviceModel integer deviceAttributes0 integer deviceAttributes1 integer renderingIntent string perceptual | relative | saturation | absolute creator string copyright string md5 string (read-only) Darwin 7/10/05 Darwin
null
par5.34.pl
null
null
null
null
null
xcrun
xcrun provides a means to locate or invoke developer tools from the command-line, without requiring users to modify Makefiles or otherwise take inconvenient measures to support multiple Xcode tool chains. The tool xcode-select(1) is used to set a system default for the active developer directory, and may be overridden by the DEVELOPER_DIR environment variable (see ENVIRONMENT). The SDK which will be searched defaults to the most recent available SDK, and can be specified by the SDKROOT environment variable or the --sdk option (which takes precedences over SDKROOT). When used to invoke another tool (as opposed to simply finding it), xcrun will provide the absolute path to the selected SDK in the SDKROOT environment variable. See ENVIRONMENT for more information. Usage xcrun supports several different usages, to both look up the paths to tools as well as execute them. When used with the --find argument, as in xcrun [--sdk <SDK name>] --find <tool name>, the absolute path to the tool (in the provided SDK, if given) will be printed. When used without --find, the name of a tool is required and the tool will be executed with the provided arguments. When used as the target of a symbolic link, it derives the tool name to use from the name it was invoked under, and then executes that tool.
xcrun - Run or locate development tools and properties.
xcrun [--sdk <SDK name>] --find <tool name> xcrun [--sdk <SDK name>] <tool name> ... tool arguments ... <tool name> ... tool arguments ...
-v, --verbose Add verbose information on how the tool lookup is performed. -n, --no-cache Don't consult the cache when looking up values. In effect, causes the cache entry to be refreshed. -k, --kill-cache Removes the cache. Causes all values to be re-cached. --sdk Specifies which SDK to search for tools. If no --sdk argument is provided, then the SDK used will be taken from the SDKROOT environment variable, if present. Use xcodebuild -showsdks to list the available SDK names. --toolchain Specifies which toolchain to use to perform the lookup. If no --toolchain argument is provided, then the toolchain to use will be taken from the TOOLCHAINS environment variable, if present. -l, --log Print the full command line that is invoked. -f, --find Enable "find" mode, in which the resolved tool path is printed instead of the tool being executed. -r, --run Enable "run" mode, in which the resolved tool path is executed with any provided additional arguments. This is the default mode. --show-sdk-path Print the path to the selected SDK. --show-sdk-version Print the version number of the selected SDK. --show-sdk-build-version Print the build version number of the selected SDK. --show-sdk-platform-path Print the path to the platform for the selected SDK. --show-sdk-platform-version Print the version number of the platform for the selected SDK. ENVIRONMENT CPATH This environment variable is modified by xcrun to include /usr/local/include when an explicit SDK is not requested via environment variable nor command line argument and neither -nostdinc nor -nostdsysteminc are present. DEVELOPER_DIR Overrides the active developer directory. When DEVELOPER_DIR is set, its value will be used instead of the system-wide active developer directory. LIBRARY_PATH This environment variable is modified by xcrun to include /usr/local/lib when an explicit SDK is not requested via environment variable nor command line argument and -Z is not being passed to the linker. SDKROOT Specifies the default SDK to be used when looking up tools (some tools may have SDK specific versions). This environment variable is also set by xcrun to be the absolute path to the user provided SDK (either via SDKROOT or the --sdk option), when it is used to invoke a normal developer tool (build tools like xcodebuild or make are exempt from this behavior). For example, if xcrun is used to invoke clang via: xcrun --sdk macosx clang test.c then xcrun will provide the full path to the macosx SDK in the environment variable SDKROOT. That in turn will be used by clang(1) to automatically select that SDK when compiling the test.c file. TOOLCHAINS Specifies the default toolchain to be used when looking up tools (for tools which are toolchain specific). xcrun_log Same as specifying --log. xcrun_nocache Same as specifying --no-cache. xcrun_verbose Same as specifying --verbose.
xcrun --find clang Finds the path to the clang binary in the default SDK. xcrun --sdk iphoneos --find texturetool Finds the path to the texturetool binary in the iOS SDK. xcrun --sdk macosx --show-sdk-path Prints the path to the current Mac OS X SDK. xcrun git status Locates the git command and then executes it with a single argument ("status"). DIAGNOSTICS When xcrun is invoked with the name xcrun, the options --log and --verbose are useful debugging aids. The option --no-cache can be used to bypass cache lookup, but often at a significant cost in performance. When xcrun has taken the place of another tool, the arguments are those of the tool replaced, and the various xcrun options can't be used. In this case, use the specific environment variables instead. SEE ALSO xcodebuild(1), xcode-select(1) Mac OS X July 9, 2015 XCRUN(1)
bzcmp
Bzcmp and bzdiff are used to invoke the cmp or the diff program on bzip2 compressed files. All options specified are passed directly to cmp or diff. If only 1 file is specified, then the files compared are file1 and an uncompressed file1.bz2. If two files are specified, then they are uncompressed if necessary and fed to cmp or diff. The exit status from cmp or diff is preserved. SEE ALSO cmp(1), diff(1), bzmore(1), bzless(1), bzgrep(1), bzip2(1) BUGS Messages from the cmp or diff programs refer to temporary filenames instead of those specified. BZDIFF(1)
bzcmp, bzdiff - compare bzip2 compressed files
bzcmp [ cmp_options ] file1 [ file2 ] bzdiff [ diff_options ] file1 [ file2 ]
null
null
lldb
lldb is a fully featured debugger. It is a command line interface to the LLDB debugger library. ATTACHING --attach-name <name> Tells the debugger to attach to a process with the given name. --attach-pid <pid> Tells the debugger to attach to a process with the given pid. -n <value> Alias for --attach-name -p <value> Alias for --attach-pid --wait-for Tells the debugger to wait for a process with the given pid or name to launch before attaching. -w Alias for --wait-for COMMANDS --batch Tells the debugger to run the commands from -s, -S, -o & -O, and then quit. -b Alias for --batch -K <value> Alias for --source-on-crash -k <value> Alias for --one-line-on-crash --local-lldbinit Allow the debugger to parse the .lldbinit files in the current working directory, unless --no-lldbinit is passed. --no-lldbinit Do not automatically parse any '.lldbinit' files. --one-line-before-file <command> Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded. --one-line-on-crash <command> When in batch mode, tells the debugger to run this one-line lldb command if the target crashes. --one-line <command> Tells the debugger to execute this one-line lldb command after any file provided on the command line has been loaded. -O <value> Alias for --one-line-before-file -o <value> Alias for --one-line -Q Alias for --source-quietly --source-before-file <file> Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded. --source-on-crash <file> When in batch mode, tells the debugger to source this file of lldb commands if the target crashes. --source-quietly Tells the debugger to execute this one-line lldb command before any file has been loaded. --source <file> Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded. -S <value> Alias for --source-before-file -s <value> Alias for --source -x Alias for --no-lldbinit
lldb - LLDB Documentation
lldb [options] executable
--arch <architecture> Tells the debugger to use the specified architecture when starting and running the program. -a <value> Alias for --arch --capture-path <filename> Tells the debugger to use the given filename for the reproducer. --capture Tells the debugger to capture a reproducer. --core <filename> Tells the debugger to use the full path to <filename> as the core file. -c <value> Alias for --core --debug Tells the debugger to print out extra information for debugging itself. -d Alias for --debug --editor Tells the debugger to open source files using the host's "external editor" mechanism. -e Alias for --editor --file <filename> Tells the debugger to use the file <filename> as the program to be debugged. -f <value> Alias for --file --help Prints out the usage information for the LLDB debugger. -h Alias for --help --no-use-colors Do not use colors. --replay <filename> Tells the debugger to replay a reproducer from <filename>. --version Prints out the current version number of the LLDB debugger. -v Alias for --version -X Alias for --no-use-color REPL -r=<flags> Alias for --repl=<flags> --repl-language <language> Chooses the language for the REPL. --repl=<flags> Runs lldb in REPL mode with a stub process with the given flags. -R <value> Alias for --repl-language SCRIPTING -l <value> Alias for --script-language --python-path Prints out the path to the lldb.py file for this version of lldb. -P Alias for --python-path --script-language <language> Tells the debugger to use the specified scripting language for user-defined scripts.
The debugger can be started in several modes. Passing an executable as a positional argument prepares lldb to debug the given executable. To disambiguate between arguments passed to lldb and arguments passed to the debugged executable, arguments starting with a - must be passed after --. lldb --arch x86_64 /path/to/program program argument -- --arch arvm7 For convenience, passing the executable after -- is also supported. lldb --arch x86_64 -- /path/to/program program argument --arch arvm7 Passing one of the attach options causes lldb to immediately attach to the given process. lldb -p <pid> lldb -n <process-name> Passing --repl starts lldb in REPL mode. lldb -r Passing --core causes lldb to debug the core file. lldb -c /path/to/core Command options can be combined with these modes and cause lldb to run the specified commands before or after events, like loading the file or crashing, in the order provided on the command line. lldb -O 'settings set stop-disassembly-count 20' -o 'run' -o 'bt' lldb -S /source/before/file -s /source/after/file lldb -K /source/before/crash -k /source/after/crash Note: In REPL mode no file is loaded, so commands specified to run after loading the file (via -o or -s) will be ignored. USING LLDB In lldb there is a help command which can be used to find descriptions and examples of all lldb commands. To get help on "breakpoint set" you would type "help breakpoint set". There is also an apropos command which will search the help text of all commands for a given term ‐‐ this is useful for locating a command by topic. For instance, "apropos breakpoint" will list any command that has the word "breakpoint" in its help text. CONFIGURATION FILES lldb reads things like settings, aliases and commands from the .lldbinit file. First, it will read the application specific init file whose name is ~/.lldbinit followed by a "-" and the name of the current program. This would be ~/.lldbinit-lldb for the command line lldb and ~/.lldbinit-Xcode for Xcode. If there is no application specific init file, the global ~/.lldbinit is read. Secondly, it will look for an .lldbinit file in the current working directory. For security reasons, lldb will print a warning and not source this file by default. This behavior can be changed by changing the target.load-cwd-lldbinit setting. To always load the .lldbinit file in the current working directory, add the following command to ~/.lldbinit: settings set target.load-cwd-lldbinit true To never load the .lldbinit file in the current working directory and silence the warning, add the following command to ~/.lldbinit: settings set target.load-cwd-lldbinit false SEE ALSO The LLDB project page https://lldb.llvm.org has many different resources for lldb users ‐‐ the gdb/lldb command equivalence page https://lldb.llvm.org/use/map.html can be especially helpful for users coming from gdb. AUTHOR LLVM project COPYRIGHT 2007-2020, The LLDB Team 8 June 10, 2020 LLDB(1)
chfn
The chpass utility allows editing of the user database information associated with user or, by default, the current user. The chpass utility cannot change the user's password on Open Directory systems. Use the passwd(1) utility instead. The chfn and chsh utilities behave identically to chpass. (There is only one program.) The information is formatted and supplied to an editor for changes. Only the information that the user is allowed to change is displayed. The options are as follows: -l location If not specified, chpass will perform a search for the user record on all available Open Directory nodes. When specified, chpass will edit the user record on the directory node at the given location. -u authname The user name to use when authenticating to the directory node containing the user. -s newshell Attempt to change the user's shell to newshell. Possible display items are as follows: Login: user's login name Uid: user's login Gid: user's login group Generated uid: user's UUID Full Name: user's real name Office Location: user's office location Office Phone: user's office phone Home Phone: user's home phone Home Directory: user's home directory Shell: user's login shell The login field is the user name used to access the computer account. The uid field is the number associated with the login field. Both of these fields should be unique across the system (and often across a group of systems) as they control file access. While it is possible to have multiple entries with identical login names and/or identical user id's, it is usually a mistake to do so. Routines that manipulate these files will often return only one of the multiple entries, and that one by random selection. The gid field is the group that the user will be placed in at login. Since BSD supports multiple groups (see groups(1)) this field currently has little special meaning. This field may be filled in with either a number or a group name (see group(5)). The generated uid field is the globally unique identifier (UUID) for the user. The full name field contains the full name of the user. The user's home directory is the full UNIX path name where the user will be placed at login. The shell field is the command interpreter the user prefers. If the shell field is empty, the Bourne shell, /bin/sh, is assumed. When altering a login shell, and not the super-user, the user may not change from a non-standard shell or to a non-standard shell. Non-standard is defined as a shell not found in /etc/shells. The picture field is the path to a picture to be displayed for the user. OPEN DIRECTORY User database entries are under the control of DirectoryService(8) and may be physically located in many different places, including the local Directory Service node, and remote LDAP servers. This version of chpass uses Open Directory to change user database information. It does not interact with the historic flat file database /etc/master.passwd ENVIRONMENT The vi(1) editor will be used unless the environment variable EDITOR is set to an alternate editor. When the editor terminates, the information is re-read and used to update the user database itself. Only the user, or the super-user, may edit the information associated with the user. FILES /etc/chpass.XXXXXX temporary file /etc/shells the list of approved shells
chpass, chfn, chsh – add or change user database information
chpass [-l location] [-u authname] [-s newshell] [user]
null
Change the shell of the current user to ‘/bin/zsh’: chsh -s /bin/zsh SEE ALSO login(1), passwd(1), getusershell(3), DirectoryService(8) Robert Morris and Ken Thompson, UNIX Password security. HISTORY The chpass utility appeared in 4.3BSD-Reno. macOS 14.5 May 25, 2021 macOS 14.5
ipcount
null
null
null
null
null
newaliases
The Postfix sendmail(1) command implements the Postfix to Sendmail compatibility interface. For the sake of compatibility with existing applications, some Sendmail command-line options are recognized but silently ignored. By default, Postfix sendmail(1) reads a message from standard input until EOF or until it reads a line with only a . character, and arranges for delivery. Postfix sendmail(1) relies on the postdrop(1) command to create a queue file in the maildrop directory. Specific command aliases are provided for other common modes of operation: mailq List the mail queue. Each entry shows the queue file ID, message size, arrival time, sender, and the recipients that still need to be delivered. If mail could not be delivered upon the last attempt, the reason for failure is shown. The queue ID string is followed by an optional status character: * The message is in the active queue, i.e. the message is selected for delivery. ! The message is in the hold queue, i.e. no further delivery attempt will be made until the mail is taken off hold. This mode of operation is implemented by executing the postqueue(1) command. newaliases Initialize the alias database. If no input file is specified (with the -oA option, see below), the program processes the file(s) specified with the alias_database configuration parameter. If no alias database type is specified, the program uses the type specified with the default_database_type configuration parameter. This mode of operation is implemented by running the postalias(1) command. Note: it may take a minute or so before an alias database update becomes visible. Use the "postfix reload" command to eliminate this delay. These and other features can be selected by specifying the appropriate combination of command-line options. Some features are controlled by parameters in the main.cf configuration file. The following options are recognized: -Am (ignored) -Ac (ignored) Postfix sendmail uses the same configuration file regardless of whether or not a message is an initial submission. -B body_type The message body MIME type: 7BIT or 8BITMIME. -bd Go into daemon mode. This mode of operation is implemented by executing the "postfix start" command. -bh (ignored) -bH (ignored) Postfix has no persistent host status database. -bi Initialize alias database. See the newaliases command above. -bl Go into daemon mode. To accept only local connections as with Sendmail´s -bl option, specify "inet_interfaces = loopback" in the Postfix main.cf configuration file. -bm Read mail from standard input and arrange for delivery. This is the default mode of operation. -bp List the mail queue. See the mailq command above. -bs Stand-alone SMTP server mode. Read SMTP commands from standard input, and write responses to standard output. In stand-alone SMTP server mode, mail relaying and other access controls are disabled by default. To enable them, run the process as the mail_owner user. This mode of operation is implemented by running the smtpd(8) daemon. -bv Do not collect or deliver a message. Instead, send an email report after verifying each recipient address. This is useful for testing address rewriting and routing configurations. This feature is available in Postfix version 2.1 and later. -C config_file -C config_dir The path name of the Postfix main.cf file, or of its parent directory. This information is ignored with Postfix versions before 2.3. With Postfix version 3.2 and later, a non-default directory must be authorized in the default main.cf file, through the alternate_config_directories or multi_instance_directories parameters. With all Postfix versions, you can specify a directory pathname with the MAIL_CONFIG environment variable to override the location of configuration files. -F full_name Set the sender full name. This overrides the NAME environment variable, and is used only with messages that have no From: message header. -f sender Set the envelope sender address. This is the address where delivery problems are sent to. With Postfix versions before 2.1, the Errors-To: message header overrides the error return address. -G Gateway (relay) submission, as opposed to initial user submission. Either do not rewrite addresses at all, or update incomplete addresses with the domain information specified with remote_header_rewrite_domain. This option is ignored before Postfix version 2.3. -h hop_count (ignored) Hop count limit. Use the hopcount_limit configuration parameter instead. -I Initialize alias database. See the newaliases command above. -i When reading a message from standard input, don´t treat a line with only a . character as the end of input. -L label (ignored) The logging label. Use the syslog_name configuration parameter instead. -m (ignored) Backwards compatibility. -N dsn (default: 'delay, failure') Delivery status notification control. Specify either a comma-separated list with one or more of failure (send notification when delivery fails), delay (send notification when delivery is delayed), or success (send notification when the message is delivered); or specify never (don't send any notifications at all). This feature is available in Postfix 2.3 and later. -n (ignored) Backwards compatibility. -oAalias_database Non-default alias database. Specify pathname or type:pathname. See postalias(1) for details. -O option=value (ignored) Set the named option to value. Use the equivalent configuration parameter in main.cf instead. -o7 (ignored) -o8 (ignored) To send 8-bit or binary content, use an appropriate MIME encapsulation and specify the appropriate -B command-line option. -oi When reading a message from standard input, don´t treat a line with only a . character as the end of input. -om (ignored) The sender is never eliminated from alias etc. expansions. -o x value (ignored) Set option x to value. Use the equivalent configuration parameter in main.cf instead. -r sender Set the envelope sender address. This is the address where delivery problems are sent to. With Postfix versions before 2.1, the Errors-To: message header overrides the error return address. -R return Delivery status notification control. Specify "hdrs" to return only the header when a message bounces, "full" to return a full copy (the default behavior). The -R option specifies an upper bound; Postfix will return only the header, when a full copy would exceed the bounce_size_limit setting. This option is ignored before Postfix version 2.10. -q Attempt to deliver all queued mail. This is implemented by executing the postqueue(1) command. Warning: flushing undeliverable mail frequently will result in poor delivery performance of all other mail. -qinterval (ignored) The interval between queue runs. Use the queue_run_delay configuration parameter instead. -qIqueueid Schedule immediate delivery of mail with the specified queue ID. This option is implemented by executing the postqueue(1) command, and is available with Postfix version 2.4 and later. -qRsite Schedule immediate delivery of all mail that is queued for the named site. This option accepts only site names that are eligible for the "fast flush" service, and is implemented by executing the postqueue(1) command. See flush(8) for more information about the "fast flush" service. -qSsite This command is not implemented. Use the slower "sendmail -q" command instead. -t Extract recipients from message headers. These are added to any recipients specified on the command line. With Postfix versions prior to 2.1, this option requires that no recipient addresses are specified on the command line. -U (ignored) Initial user submission. -V envid Specify the envelope ID for notification by servers that support DSN. This feature is available in Postfix 2.3 and later. -XV (Postfix 2.2 and earlier: -V) Variable Envelope Return Path. Given an envelope sender address of the form owner-listname@origin, each recipient user@domain receives mail with a personalized envelope sender address. By default, the personalized envelope sender address is owner-listname+user=domain@origin. The default + and = characters are configurable with the default_verp_delimiters configuration parameter. -XVxy (Postfix 2.2 and earlier: -Vxy) As -XV, but uses x and y as the VERP delimiter characters, instead of the characters specified with the default_verp_delimiters configuration parameter. -v Send an email report of the first delivery attempt (Postfix versions 2.1 and later). Mail delivery always happens in the background. When multiple -v options are given, enable verbose logging for debugging purposes. -X log_file (ignored) Log mailer traffic. Use the debug_peer_list and debug_peer_level configuration parameters instead. SECURITY By design, this program is not set-user (or group) id. However, it must handle data from untrusted, possibly remote, users. Thus, the usual precautions need to be taken against malicious inputs. DIAGNOSTICS Problems are logged to syslogd(8) and to the standard error stream. ENVIRONMENT MAIL_CONFIG Directory with Postfix configuration files. MAIL_VERBOSE (value does not matter) Enable verbose logging for debugging purposes. MAIL_DEBUG (value does not matter) Enable debugging with an external command, as specified with the debugger_command configuration parameter. NAME The sender full name. This is used only with messages that have no From: message header. See also the -F option above. CONFIGURATION PARAMETERS The following main.cf parameters are especially relevant to this program. The text below provides only a parameter summary. See postconf(5) for more details including examples. COMPATIBILITY CONTROLS Available with Postfix 2.9 and later: sendmail_fix_line_endings (always) Controls how the Postfix sendmail command converts email message line endings from <CR><LF> into UNIX format (<LF>). TROUBLE SHOOTING CONTROLS The DEBUG_README file gives examples of how to trouble shoot a Postfix system. debugger_command (empty) The external command to execute when a Postfix daemon program is invoked with the -D option. debug_peer_level (2) The increment in verbose logging level when a remote client or server matches a pattern in the debug_peer_list parameter. debug_peer_list (empty) Optional list of remote client or server hostname or network address patterns that cause the verbose logging level to increase by the amount specified in $debug_peer_level. ACCESS CONTROLS Available in Postfix version 2.2 and later: authorized_flush_users (static:anyone) List of users who are authorized to flush the queue. authorized_mailq_users (static:anyone) List of users who are authorized to view the queue. authorized_submit_users (static:anyone) List of users who are authorized to submit mail with the sendmail(1) command (and with the privileged postdrop(1) helper command). RESOURCE AND RATE CONTROLS bounce_size_limit (50000) The maximal amount of original message text that is sent in a non-delivery notification. fork_attempts (5) The maximal number of attempts to fork() a child process. fork_delay (1s) The delay between attempts to fork() a child process. hopcount_limit (50) The maximal number of Received: message headers that is allowed in the primary message headers. queue_run_delay (300s) The time between deferred queue scans by the queue manager; prior to Postfix 2.4 the default value was 1000s. FAST FLUSH CONTROLS The ETRN_README file describes configuration and operation details for the Postfix "fast flush" service. fast_flush_domains ($relay_domains) Optional list of destinations that are eligible for per-destination logfiles with mail that is queued to those destinations. VERP CONTROLS The VERP_README file describes configuration and operation details of Postfix support for variable envelope return path addresses. default_verp_delimiters (+=) The two default VERP delimiter characters. verp_delimiter_filter (-=+) The characters Postfix accepts as VERP delimiter characters on the Postfix sendmail(1) command line and in SMTP commands. MISCELLANEOUS CONTROLS alias_database (see 'postconf -d' output) The alias databases for local(8) delivery that are updated with "newaliases" or with "sendmail -bi". command_directory (see 'postconf -d' output) The location of all postfix administrative commands. config_directory (see 'postconf -d' output) The default location of the Postfix main.cf and master.cf configuration files. daemon_directory (see 'postconf -d' output) The directory with Postfix support programs and daemon programs. default_database_type (see 'postconf -d' output) The default database type for use in newaliases(1), postalias(1) and postmap(1) commands. delay_warning_time (0h) The time after which the sender receives a copy of the message headers of mail that is still queued. import_environment (see 'postconf -d' output) The list of environment parameters that a privileged Postfix process will import from a non-Postfix parent process, or name=value environment overrides. mail_owner (postfix) The UNIX system account that owns the Postfix queue and most Postfix daemon processes. queue_directory (see 'postconf -d' output) The location of the Postfix top-level queue directory. remote_header_rewrite_domain (empty) Don't rewrite message headers from remote clients at all when this parameter is empty; otherwise, rewrite message headers and append the specified domain name to incomplete addresses. syslog_facility (mail) The syslog facility of Postfix logging. syslog_name (see 'postconf -d' output) A prefix that is prepended to the process name in syslog records, so that, for example, "smtpd" becomes "prefix/smtpd". Postfix 3.2 and later: alternate_config_directories (empty) A list of non-default Postfix configuration directories that may be specified with "-c config_directory" on the command line (in the case of sendmail(1), with "-C config_directory"), or via the MAIL_CONFIG environment parameter. multi_instance_directories (empty) An optional list of non-default Postfix configuration directories; these directories belong to additional Postfix instances that share the Postfix executable files and documentation with the default Postfix instance, and that are started, stopped, etc., together with the default Postfix instance. FILES /var/spool/postfix, mail queue /etc/postfix, configuration files SEE ALSO pickup(8), mail pickup daemon qmgr(8), queue manager smtpd(8), SMTP server flush(8), fast flush service postsuper(1), queue maintenance postalias(1), create/update/query alias database postdrop(1), mail posting utility postfix(1), mail system control postqueue(1), mail queue control syslogd(8), system logging README_FILES Use "postconf readme_directory" or "postconf html_directory" to locate this information. DEBUG_README, Postfix debugging howto ETRN_README, Postfix ETRN howto VERP_README, Postfix VERP howto LICENSE The Secure Mailer license must be distributed with this software. AUTHOR(S) Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA SENDMAIL(1)
sendmail - Postfix to Sendmail compatibility interface
sendmail [option ...] [recipient ...] mailq sendmail -bp newaliases sendmail -I
null
null
nano
Pico is a simple, display-oriented text editor based on the Alpine message system composer. As with Alpine, commands are displayed at the bottom of the screen, and context-sensitive help is provided. As characters are typed they are immediately inserted into the text. Editing commands are entered using control-key combinations. As a work-around for communications programs that swallow certain control characters, you can emulate a control key by pressing ESCAPE twice, followed by the desired control character, e.g. "ESC ESC c" would be equivalent to entering a ctrl-c. The editor has five basic features: paragraph justification, searching, block cut/paste, a spelling checker, and a file browser. Paragraph justification (or filling) takes place in the paragraph that contains the cursor, or, if the cursor is between lines, in the paragraph immediately below. Paragraphs are delimited by blank lines, or by lines beginning with a space or tab. Unjustification can be done immediately after justification using the control-U key combination. String searches are not sensitive to case. A search begins at the current cursor position and wraps around the end of the text. The most recent search string is offered as the default in subsequent searches. Blocks of text can be moved, copied or deleted with creative use of the command for mark (ctrl-^), delete (ctrl-k) and undelete (ctrl-u). The delete command will remove text between the "mark" and the current cursor position, and place it in the "cut" buffer. The undelete command effects a "paste" at the current cursor position. The spell checker examines all words in the text. It then offers, in turn, each misspelled word for correction while highlighting it in the text. Spell checking can be cancelled at any time. Alternatively, pico will substitute for the default spell checking routine a routine defined by the SPELL environment variable. The replacement routine should read standard input and write standard output. The file browser is offered as an option in the "Read File" and "Write Out" command prompts. It is intended to help in searching for specific files and navigating directory hierarchies. Filenames with sizes and names of directories in the current working directory are presented for selection. The current working directory is displayed on the top line of the display while the list of available commands takes up the bottom two. Several basic file manipulation functions are supported: file renaming, copying, and deletion. More specific help is available in pico's online help.
pico - simple text editor in the style of the Alpine Composer Syntax pico [ options ] [ file ]
null
+n Causes pico to be started with the cursor located n lines into the file. (Note: no space between "+" sign and number) -a Display all files including those beginning with a period (.). -b Enable word wrap. -d Rebind the "delete" key so the character the cursor is on is rubbed out rather than the character to its left. -e Enable file name completion. -f Use function keys for commands. This option supported only in conjunction with UW Enhanced NCSA telnet. -h List valid command line options. -j Enable "Goto" command in the file browser. This enables the command to permit explicitly telling pilot which directory to visit. -g Enable "Show Cursor" mode in file browser. Cause cursor to be positioned before the current selection rather than placed at the lower left of the display. -k Causes "Cut Text" command to remove characters from the cursor position to the end of the line rather than remove the entire line. -m Enable mouse functionality. This only works when pico is run from within an X Window System "xterm" window. -nn The -nn option enables new mail notification. The n argument is optional, and specifies how often, in seconds, your mailbox is checked for new mail. For example, -n60 causes pico to check for new mail once every minute. The default interval is 180 seconds, while the minimum allowed is 30. (Note: no space between "n" and the number) -o dir Sets operating directory. Only files within this directory are accessible. Likewise, the file browser is limited to the specified directory subtree. -rn Sets column used to limit the "Justify" command's right margin -s speller Specify an alternate program spell to use when spell checking. -t Enable "tool" mode. Intended for when pico is used as the editor within other tools (e.g., Elm, Pnews). Pico will not prompt for save on exit, and will not rename the buffer during the "Write Out" command. -v View the file only, disallowing any editing. -version Print Pico version and exit. -w Disable word wrap (thus allow editing of long lines). -x Disable keymenu at the bottom of the screen. -z Enable ^Z suspension of pico. -p Preserve the "start" and "stop" characters, typically Ctrl-Q and Ctrl-S, which are sometimes used in communications paths to control data flow between devices that operate at different speeds. -Q quotestr Set the quote string. Especially useful when composing email, setting this allows the quote string to be checked for when Justifying paragraphs. A common quote string is "> ". -W word_separators If characters listed here appear in the middle of a word surrounded by alphanumeric characters that word is split into two words. This is used by the Forward and Backward word commands and by the spell checker. -q Termcap or terminfo definition for input escape sequences are used in preference to sequences defined by default. This option is only available if pico was compiled with the TERMCAP_WINS define turned on. -setlocale_ctype Do setlocale(LC_CTYPE) if available. Default is to not do this setlocale. -no_setlocale_collate Do not do setlocale(LC_COLLATE). Default is to do this setlocale. Lastly, when a running pico is disconnected (i.e., receives a SIGHUP), pico will save the current work if needed before exiting. Work is saved under the current filename with ".save" appended. If the current work is unnamed, it is saved under the filename "pico.save". Color Support If your terminal supports colors, Pico can be configured to color text. Users can configure the color of the text, the text in the key menu, the titlebar, messages and prompt in the status line. As an added feature Pico can also be used to configure the color of up to three different levels of quoted text, and the signature of an email message. This is useful when Pico is used as a tool (with the -t command line switch.) Pico can tell you the number of colors that your terminal supports, when started with the switch -color_codes. In addition Pico will print a table showing the numerical code of every color supported in that terminal. In order to configure colors, one must use these numerical codes. For example, 0 is for black, so in order to configure a black color, one must use its code, the number 0. In order to activate colors, one must use the option -ncolors with a numerical value indicating the number of colors that your terminal supports, for example, -ncolors 256 indicates that the user wishes to use a table of 256 colors. All options that control color, are four letter options. Their last two letters are either "fc" or "bc", indicating foreground color and bacground color, respectively. The first two letters indicate the type of text that is being configured, for example "nt" stands for normal text, so that -ntfc represents the color of the normal text, while -ntbc represents the color of the background of normal text. Here is a complete list of the color options supported by Pico. -color_code displays the number of colors supported by the terminal, and a table showing the association of colors and numerical codes -ncolors number activates color support in Pico, and tells Pico how many colors to use. Depending on your terminal number could be 8, 16, or 256. -ntfc num specifies the number num of the color to be used to color normal text. -ntbc num specifies the number num of the color of the background for normal text. -rtfc num specifies the number num of the color of reverse text. Default: same as background color of normal text (if specified.) -rtbc num specifies the number num of the color of the background of reverse text. Default: same as color of normal text (if specified.) -tbfc num specifies the number num of then color of text of the title bar. Default: same as foreground color of reverse text. -tbbc num specifies the number num of the color in the background of the title bar. -klfc num specifies the number num of the color of the text of the key label. -klbc num specifies the number num of the color in the background of the key label. -knfc num specifies the number num of the color of the text of the key name. -knbc num specifies the number num of the color of the background of the key name. -stfc num specifies the number num of the color of the text of the status line. -stbc num specifies the number num of the color of the background of the status line. -prfc num specifies the number num of the color of the text of a prompt. -prbc num specifies the number num of the color of the background of a prompt. -q1fc num specifies the number num of the color of the text of level one of quoted text. -q1bc num specifies the number num of the color of the background of level one of quoted text. If the option -q1bc is used, the default value of this option is the background color or normal text. -q2fc num specifies the number num of the color of text of level two of quoted text. -q2bc num specifies the number num of the color of the background of level two of quoted text. If the option -q1bc is used, the default value of this option is the background color or normal text. -q3fc num specifies the number num of the color of text of level three of quoted text. -sbfc num specifies the number num of the color of text of signature block text. -sbbc num specifies the number num of the color of the background of signature block text. Bugs The manner in which lines longer than the display width are dealt is not immediately obvious. Lines that continue beyond the edge of the display are indicated by a '$' character at the end of the line. Long lines are scrolled horizontally as the cursor moves through them. Files pico.save Unnamed interrupted work saved here. *.save Interrupted work on a named file is saved here. Authors Michael Seibel <mikes@cac.washington.edu> Laurence Lundblade <lgl@cac.washington.edu> Pico was originally derived from MicroEmacs 3.6, by Dave G. Conroy. Copyright 1989-2008 by the University of Washington. See Also alpine(1) Source distribution (part of the Alpine Message System): $Date: 2009-02-02 13:54:23 -0600 (Mon, 02 Feb 2009) $ Version 5.09 pico(1)
null
lam
The lam utility copies the named files side by side onto the standard output. The n-th input lines from the input files are considered fragments of the single long n-th output line into which they are assembled. The name `-' means the standard input, and may be repeated. -f min.max, -F min.max Print line fragments according to the format string min.max, where min is the minimum field width and max the maximum field width. If min begins with a zero, zeros will be added to make up the field width, and if it begins with a `-', the fragment will be left-adjusted within the field. Using -f applies only to the next file while -F applies to all subsequent files until it appears again uncapitalized. -p min.max, -P min.max Like -f, but pad this file's field when end-of-file is reached and other files are still active. Using -p applies only to the next file while -P applies to all subsequent files until it appears again uncapitalized. -s sepstring, -S sepstring Print sepstring before printing line fragments from the next file. This option may appear after the last file. Using -s applies only to the next file while -S applies to all subsequent files until it appears again uncapitalized. -t c, -T c The input line terminator is c instead of a newline. The newline normally appended to each output line is omitted. Using -t applies only to the next file while -T applies to all subsequent files until it appears again uncapitalized. To print files simultaneously for easy viewing use pr(1).
lam – laminate files
lam [-f min.max] [-s sepstring] [-t c] file ... lam [-p min.max] [-s sepstring] [-t c] file ...
null
The command lam file1 file2 file3 file4 joins 4 files together along each line. To merge the lines from four different files use lam file1 -S "\ " file2 file3 file4 Every 2 lines of a file may be joined on one line with lam - - < file and a form letter with substitutions keyed by `@' can be done with lam -t @ letter changes SEE ALSO join(1), paste(1), pr(1), printf(3) STANDARDS Some of the functionality of lam is standardized as the paste(1) utility by IEEE Std 1003.2 (“POSIX.2”). HISTORY The lam utility first appeared in 4.2BSD. AUTHORS John A. Kunze BUGS The lam utility does not recognize multibyte characters. macOS 14.5 April 7, 2015 macOS 14.5
pod2readme5.30
This utility will use Pod::Readme to extract a README file from a POD document. It works by extracting and filtering the POD, and then calling the appropriate filter program to convert the POD to another format.
pod2readme - Intelligently generate a README file from POD USAGE pod2readme [-cfho] [long options...] input-file [output-file] [target] Intelligently generate a README file from POD -t --target target type (default: 'readme') -f --format output format (default: 'text') -b --backup backup output file -o --output output filename (default based on target) -c --stdout output to stdout (console) -F --force only update if files are changed -h --help print usage and exit
pod2readme -f markdown lib/MyApp.pm
"--backup" By default, "pod2readme" will back up the output file. To disable this, use the "--no-backup" option. "--output" Specifies the name of the output file. If omitted, it will use the second command line argument, or default to the "--target" plus the corresponding extension of the "--format". For all intents, the default is README. If a format other than "text" is chosen, then the appropriate extension will be added, e.g. for "markdown", the default output file is README.md. "--target" The target of the filter, which defaults to "readme". "--format" The output format, which defaults to "text". Other supposed formats are "github", "html", "latex", "man", "markdown", "pod", "rtf", and "xhtml". You can also use "gfm" instead of "github". Similary you can use "md" for "markdown". "--stdout" If enabled, it will output to the console instead of "--output". "--force" By default, the README will be generated if the source files have been changed. Using "--force" will force the file to be updated. Note: POD format files will always be updated. "--help" Prints the usage and exits. SEE ALSO pod2text, pod2markdown. perl v5.30.3 2018-10-31 POD2README(1)
null
ipptool
ipptool sends IPP requests to the specified printer-uri and tests and/or displays the results. Each named testfile defines one or more requests, including the expected response status, attributes, and values. Output is either a plain text, formatted text, CSV, or XML report on the standard output, with a non-zero exit status indicating that one or more tests have failed. The testfile format is described in ipptoolfile(5).
ipptool - perform internet printing protocol requests
ipptool [ --help ] [ --ippserver filename ] [ --stop-after-include-error ] [ --version ] [ -4 ] [ -6 ] [ -C ] [ -E ] [ -I ] [ -L ] [ -P filename.plist ] [ -S ] [ -T seconds ] [ -V version ] [ -X ] [ -c ] [ -d name=value ] [ -f filename ] [ -h ] [ -i seconds ] [ -n repeat-count ] [ -q ] [ -t ] [ -v ] printer-uri testfile [ ... testfile ]
The following options are recognized by ipptool: --help Shows program help. --ippserver filename Specifies that the test results should be written to the named ippserver attributes file. --stop-after-include-error Tells ipptool to stop if an error occurs in an included file. Normally ipptool will continue with subsequent tests after the INCLUDE directive. --version Shows the version of ipptool being used. -4 Specifies that ipptool must connect to the printer or server using IPv4. -6 Specifies that ipptool must connect to the printer or server using IPv6. -C Specifies that requests should be sent using the HTTP/1.1 "Transfer-Encoding: chunked" header, which is required for conformance by all versions of IPP. The default is to use "Transfer-Encoding: chunked" for requests with attached files and "Content-Length:" for requests without attached files. -E Forces TLS encryption when connecting to the server using the HTTP "Upgrade" header. -I Specifies that ipptool will continue past errors. -L Specifies that requests should be sent using the HTTP/1.0 "Content-Length:" header, which is required for conformance by all versions of IPP. The default is to use "Transfer-Encoding: chunked" for requests with attached files and "Content-Length:" for requests without attached files. -P_filename.plist Specifies that the test results should be written to the named XML (Apple plist) file in addition to the regular test report (-t). This option is incompatible with the -i (interval) and -n (repeat-count) options. -S Forces (dedicated) TLS encryption when connecting to the server. -T_seconds Specifies a timeout for IPP requests in seconds. -V_version Specifies the default IPP version to use: 1.0, 1.1, 2.0, 2.1, or 2.2. If not specified, version 1.1 is used. -X Specifies that XML (Apple plist) output is desired instead of the plain text report. This option is incompatible with the -i (interval) and -n (repeat-count) options. -c Specifies that CSV (comma-separated values) output is desired instead of the plain text output. -d_name=value Defines the named variable. -f_filename Defines the default request filename for tests. -h Validate HTTP response headers. -i_seconds Specifies that the (last) testfile should be repeated at the specified interval. This option is incompatible with the -X (XML plist output) option. -l Specifies that plain text output is desired. -n_repeat-count Specifies that the (last) testfile should be repeated the specified number of times. This option is incompatible with the -X (XML plist output) option. -q Be quiet and produce no output. -t Specifies that CUPS test report output is desired instead of the plain text output. -v Specifies that all request and response attributes should be output in CUPS test mode (-t). This is the default for XML output. EXIT STATUS The ipptool program returns 0 if all tests were successful and 1 otherwise. FILES The following standard files are available: color.jpg create-printer-subscription.test document-a4.pdf document-a4.ps document-letter.pdf document-letter.ps get-completed-jobs.test get-jobs.test get-notifications.test get-printer-attributes.test get-subscriptions.test gray.jpg ipp-1.1.test ipp-2.0.test ipp-2.1.test ipp-2.2.test ipp-everywhere.test onepage-a4.pdf onepage-a4.ps onepage-letter.pdf onepage-letter.ps print-job.test print-job-deflate.test print-job-gzip.test testfile.jpg testfile.pcl testfile.pdf testfile.ps testfile.txt validate-job.test CONFORMING TO The ipptool program is unique to CUPS and conforms to the Internet Printing Protocol up to version 2.2.
Get a list of completed jobs for "myprinter": ipptool ipp://localhost/printers/myprinter get-completed-jobs.test Send email notifications to "user@example.com" when "myprinter" changes: ipptool -d recipient=mailto:user@example.com \ ipp://localhost/printers/myprinter create-printer-subscription.test SEE ALSO ipptoolfile(5), IANA IPP Registry (http://www.iana.org/assignments/ipp-registrations), PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp) RFC 8011 (http://tools.ietf.org/html/rfc8011), COPYRIGHT Copyright © 2007-2019 by Apple Inc. 26 April 2019 CUPS ipptool(1)
irb
irb is the REPL(read-eval-print loop) environment for Ruby programs.
irb – Interactive Ruby Shell
irb [--version] [-dfm] [-I directory] [-r library] [--[no]inspect] [--[no]readline] [--prompt mode] [--prompt-mode mode] [--inf-ruby-mode] [--simple-prompt] [--noprompt] [--tracer] [--back-trace-limit n] [--irb_debug n] [--] [program_file] [argument ...]
--version Prints the version of irb. -E external[:internal] --encoding external[:internal] Same as `ruby -E' . Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:). You can omit the one for internal encodings, then the value (Encoding.default_internal) will be nil. -I path Same as `ruby -I' . Specifies $LOAD_PATH directory -U Same as `ruby -U' . Sets the default value for internal encodings (Encoding.default_internal) to UTF-8. -d Same as `ruby -d' . Sets $DEBUG to true. -f Suppresses read of ~/.irbrc. -h --help Prints a summary of the options. -r library Same as `ruby -r'. Causes irb to load the library using require. --inspect Uses `inspect' for output (default except for bc mode) --noinspect Doesn't use inspect for output --readline Uses Readline extension module. --noreadline Doesn't use Readline extension module. --prompt mode --prompt-mode mode Switch prompt mode. Pre-defined prompt modes are `default', `simple', `xmp' and `inf-ruby'. --inf-ruby-mode Uses prompt appropriate for inf-ruby-mode on emacs. Suppresses --readline. --simple-prompt Makes prompts simple. --noprompt No prompt mode. --tracer Displays trace for each execution of commands. --back-trace-limit n Displays backtrace top n and tail n. The default value is 16. --irb_debug n Sets internal debug level to n (not for popular use) ENVIRONMENT IRBRC Also irb depends on same variables as ruby(1). FILES ~/.irbrc Personal irb initialization.
% irb irb(main):001:0> 1 + 1 2 irb(main):002:0> def t(x) irb(main):003:1> x+1 irb(main):004:1> end => :t irb(main):005:0> t(3) => 4 irb(main):006:0> if t(3) == 4 irb(main):007:1> p :ok irb(main):008:1> end :ok => :ok irb(main):009:0> quit % SEE ALSO ruby(1). REPORTING BUGS • Security vulnerabilities should be reported via an email to security@ruby-lang.org. Reported problems will be published after being fixed. • Other bugs and feature requests can be reported via the Ruby Issue Tracking System (https://bugs.ruby-lang.org/). Do not report security vulnerabilities via this system because it publishes the vulnerabilities immediately. AUTHORS Written by Keiju ISHITSUKA. UNIX April 20, 2017 UNIX
ptardiff
ptardiff is a small program that diffs an extracted archive against an unextracted one, using the perl module Archive::Tar. This effectively lets you view changes made to an archives contents. Provide the progam with an ARCHIVE_FILE and it will look up all the files with in the archive, scan the current working directory for a file with the name and diff it against the contents of the archive.
ptardiff - program that diffs an extracted archive against an unextracted one
ptardiff ARCHIVE_FILE ptardiff -h $ tar -xzf Acme-Buffy-1.3.tar.gz $ vi Acme-Buffy-1.3/README [...] $ ptardiff Acme-Buffy-1.3.tar.gz > README.patch
h Prints this help message SEE ALSO tar(1), Archive::Tar. perl v5.38.2 2023-11-28 PTARDIFF(1)
null
bzless
Bzmore is a filter which allows examination of compressed or plain text files one screenful at a time on a soft-copy terminal. bzmore works on files compressed with bzip2 and also on uncompressed files. If a file does not exist, bzmore looks for a file of the same name with the addition of a .bz2 suffix. Bzmore normally pauses after each screenful, printing --More-- at the bottom of the screen. If the user then types a carriage return, one more line is displayed. If the user hits a space, another screenful is displayed. Other possibilities are enumerated later. Bzmore looks in the file /etc/termcap to determine terminal characteristics, and to determine the default window size. On a terminal capable of displaying 24 lines, the default window size is 22 lines. Other sequences which may be typed when bzmore pauses, and their effects, are as follows (i is an optional integer argument, defaulting to 1) : i<space> display i more lines, (or another screenful if no argument is given) ^D display 11 more lines (a ``scroll''). If i is given, then the scroll size is set to i. d same as ^D (control-D) iz same as typing a space except that i, if present, becomes the new window size. Note that the window size reverts back to the default at the end of the current file. is skip i lines and print a screenful of lines if skip i screenfuls and print a screenful of lines q or Q quit reading the current file; go on to the next (if any) e or q When the prompt --More--(Next file: file) is printed, this command causes bzmore to exit. s When the prompt --More--(Next file: file) is printed, this command causes bzmore to skip the next file and continue. = Display the current line number. i/expr search for the i-th occurrence of the regular expression expr. If the pattern is not found, bzmore goes on to the next file (if any). Otherwise, a screenful is displayed, starting two lines before the place where the expression was found. The user's erase and kill characters may be used to edit the regular expression. Erasing back past the first column cancels the search command. in search for the i-th occurrence of the last regular expression entered. !command invoke a shell with command. The character `!' in "command" are replaced with the previous shell command. The sequence "\!" is replaced by "!". :q or :Q quit reading the current file; go on to the next (if any) (same as q or Q). . (dot) repeat the previous command. The commands take effect immediately, i.e., it is not necessary to type a carriage return. Up to the time when the command character itself is given, the user may hit the line kill character to cancel the numerical argument being formed. In addition, the user may hit the erase character to redisplay the --More-- message. At any time when output is being sent to the terminal, the user can hit the quit key (normally control-\). Bzmore will stop sending output, and will display the usual --More-- prompt. The user may then enter one of the above commands in the normal manner. Unfortunately, some output is lost when this is done, due to the fact that any characters waiting in the terminal's output queue are flushed when the quit signal occurs. The terminal is set to noecho mode by this program so that the output can be continuous. What you type will thus not show on your terminal, except for the / and ! commands. If the standard output is not a teletype, then bzmore acts just like bzcat, except that a header is printed before each file. FILES /etc/termcap Terminal data base SEE ALSO more(1), less(1), bzip2(1), bzdiff(1), bzgrep(1) BZMORE(1)
bzmore, bzless - file perusal filter for crt viewing of bzip2 compressed text
bzmore [ name ... ] bzless [ name ... ] NOTE In the following description, bzless and less can be used interchangeably with bzmore and more.
null
null
sysdiagnose
The sysdiagnose tool gathers system diagnostic information helpful in investigating system performance issues. A great deal of information is harvested, spanning system state and configuration. The data is stored /var/tmp directory. sysdiagnose needs to be run as root. To cancel an in-flight sysdiagnose triggered via command line interface, press Ctrl-\. sysdiagnose is automatically triggered when the following key chord is pressed: Control-Option-Command-Shift-Period. What sysdiagnose collects: • A spindump of the system • Several seconds of top output • Data about kernel zones • Status of loaded kernel extensions • Resident memory usage of user processes • Recent system logs • A System Profiler report • Recent crash reports • Disk usage information • I/O Kit registry information • Network status • If a specific process is supplied as an argument: list of malloc-allocated buffers in the process's heap is collected • If a specific process is supplied as an argument: data about unreferenced malloc buffers in the process's memory is collected • If a specific process is supplied as an argument: data about the virtual memory regions allocated in the process
sysdiagnose – gathers system-wide diagnostic information helpful in investigating system performance issues
sysdiagnose -h sysdiagnose [-H] [-v] [-f results_directory] [-A archive_name] [-V volume_path] [-C, --compression compression_type] [-n] [-k] [-F] [-S] [-u] [-Q] [-b] [-p] [-P] [-g] [-G] [-d] [-D] [-r] [-R] [process_name | pid]
-h Display help. -H Print the path to the default sysdiagnose output directory. -v Enable verbose mode to display the container information as it executes. -f results_directory Specify the directory where the results will be stored. The default results directory is /var/tmp. -A archive_name Specify the name of the archive created in the results directory. -V volume_path Specify the root volume for sysdiagnose to run on. -C, --compression compression_type [tar|yaa|default|no-compression] Specify the compression type for the resulting sysdiagnose directory. -n Do not tar the resulting sysdiagnose directory. -k Do not remove the temporary directory. -F Get feedback data. -S Disable streaming to tarball. -u Disable UI feedback. -Q Skip footprint. -q Same as -Q -b Do NOT show the resulting archive in a Finder window upon completion. -p Only run time-sensitive collections; disregards previous -d or -r flags. -P Do not run time-sensitive collections. -g Only run log generation collections; disregards previous -p or -r flags. -G Do not run log generation collections. -d Only run log copying collections; disregards previous -p or -r flags. -D Do not run log copying collections. -r Collect only log archive. Disregards previous -p or -d flags. -R Do not collect log archive. process_name | pid If a single process appears to be slowing down the system, passing in the process name or ID as the argument gathers additional process-specific diagnostic data. Specify only ONE process at a time -- specifying multiple processes is not supported. EXIT STATUS sysdiagnose exits with status 0 if there were no internal errors encountered during the diagnostic, or >0 when an error unrelated to external state occurs or unusable input is provided by the user. OS X January 24, 1984 OS X
null
logname
The logname utility writes the user's login name to standard output followed by a newline. The logname utility explicitly ignores the LOGNAME and USER environment variables because the environment cannot be trusted. EXIT STATUS The logname utility exits 0 on success, and >0 if an error occurs. SEE ALSO who(1), whoami(1), getlogin(2) STANDARDS The logname utility is expected to conform to IEEE Std 1003.2 (“POSIX.2”). HISTORY The logname command appeared in 4.4BSD. macOS 14.5 June 9, 1993 macOS 14.5
logname – display user's login name
logname
null
null
tset
Tset initializes terminals. Tset first determines the type of terminal that you are using. This determination is done as follows, using the first terminal type found. 1. The terminal argument specified on the command line. 2. The value of the TERM environmental variable. 3. (BSD systems only.) The terminal type associated with the standard error output device in the /etc/ttys file. (On System-V-like UNIXes and systems using that convention, getty does this job by setting TERM according to the type passed to it by /etc/inittab.) 4. The default terminal type, “unknown”. If the terminal type was not specified on the command-line, the -m option mappings are then applied (see the section TERMINAL TYPE MAPPING for more information). Then, if the terminal type begins with a question mark (“?”), the user is prompted for confirmation of the terminal type. An empty response confirms the type, or, another type can be entered to specify a new type. Once the terminal type has been determined, the terminfo entry for the terminal is retrieved. If no terminfo entry is found for the type, the user is prompted for another terminal type. Once the terminfo entry is retrieved, the window size, backspace, interrupt and line kill characters (among many other things) are set and the terminal and tab initialization strings are sent to the standard error output. Finally, if the erase, interrupt and line kill characters have changed, or are not set to their default values, their values are displayed to the standard error output. Use the -c or -w option to select only the window sizing versus the other initialization. If neither option is given, both are assumed. When invoked as reset, @TSET@ sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets any unset special characters to their default values before doing the terminal initialization described above. This is useful after a program dies leaving a terminal in an abnormal state. Note, you may have to type <LF>reset<LF> (the line-feed character is normally control-J) to get the terminal to work, as carriage-return may no longer work in the abnormal state. Also, the terminal will often not echo the command. The options are as follows: -c Set control characters and modes. -e Set the erase character to ch. -I Do not send the terminal or tab initialization strings to the terminal. -i Set the interrupt character to ch. -k Set the line kill character to ch. -m Specify a mapping from a port type to a terminal. See the section TERMINAL TYPE MAPPING for more information. -Q Do not display any values for the erase, interrupt and line kill characters. Normally @TSET@ displays the values for control characters which differ from the system's default values. -q The terminal type is displayed to the standard output, and the terminal is not initialized in any way. The option `-' by itself is equivalent but archaic. -r Print the terminal type to the standard error output. -s Print the sequence of shell commands to initialize the environment variable TERM to the standard output. See the section SETTING THE ENVIRONMENT for details. -V reports the version of ncurses which was used in this program, and exits. -w Resize the window to match the size deduced via setupterm. Normally this has no effect, unless setupterm is not able to detect the window size. The arguments for the -e, -i, and -k options may either be entered as actual characters or by using the `hat' notation, i.e., control-h may be specified as “^H” or “^h”. SETTING THE ENVIRONMENT It is often desirable to enter the terminal type and information about the terminal's capabilities into the shell's environment. This is done using the -s option. When the -s option is specified, the commands to enter the information into the shell's environment are written to the standard output. If the SHELL environmental variable ends in “csh”, the commands are for csh, otherwise, they are for sh. Note, the csh commands set and unset the shell variable noglob, leaving it unset. The following line in the .login or .profile files will initialize the environment correctly: eval `@TSET@ -s options ... ` TERMINAL TYPE MAPPING When the terminal is not hardwired into the system (or the current system information is incorrect) the terminal type derived from the /etc/ttys file or the TERM environmental variable is often something generic like network, dialup, or unknown. When @TSET@ is used in a startup script it is often desirable to provide information about the type of terminal used on such ports. The purpose of the -m option is to map from some set of conditions to a terminal type, that is, to tell @TSET@ “If I'm on this port at a particular speed, guess that I'm on that kind of terminal”. The argument to the -m option consists of an optional port type, an optional operator, an optional baud rate specification, an optional colon (“:”) character and a terminal type. The port type is a string (delimited by either the operator or the colon character). The operator may be any combination of “>”, “<”, “@”, and “!”; “>” means greater than, “<” means less than, “@” means equal to and “!” inverts the sense of the test. The baud rate is specified as a number and is compared with the speed of the standard error output (which should be the control terminal). The terminal type is a string. If the terminal type is not specified on the command line, the -m mappings are applied to the terminal type. If the port type and baud rate match the mapping, the terminal type specified in the mapping replaces the current type. If more than one mapping is specified, the first applicable mapping is used. For example, consider the following mapping: dialup>9600:vt100. The port type is dialup , the operator is >, the baud rate specification is 9600, and the terminal type is vt100. The result of this mapping is to specify that if the terminal type is dialup, and the baud rate is greater than 9600 baud, a terminal type of vt100 will be used. If no baud rate is specified, the terminal type will match any baud rate. If no port type is specified, the terminal type will match any port type. For example, -m dialup:vt100 -m :?xterm will cause any dialup port, regardless of baud rate, to match the terminal type vt100, and any non-dialup port type to match the terminal type ?xterm. Note, because of the leading question mark, the user will be queried on a default port as to whether they are actually using an xterm terminal. No whitespace characters are permitted in the -m option argument. Also, to avoid problems with meta-characters, it is suggested that the entire -m option argument be placed within single quote characters, and that csh users insert a backslash character (“\”) before any exclamation marks (“!”). HISTORY The @TSET@ command appeared in BSD 3.0. The ncurses implementation was lightly adapted from the 4.4BSD sources for a terminfo environment by Eric S. Raymond <esr@snark.thyrsus.com>. COMPATIBILITY The @TSET@ utility has been provided for backward-compatibility with BSD environments (under most modern UNIXes, /etc/inittab and getty(1) can set TERM appropriately for each dial-up line; this obviates what was @TSET@'s most important use). This implementation behaves like 4.4BSD tset, with a few exceptions specified here. The -S option of BSD tset no longer works; it prints an error message to stderr and dies. The -s option only sets TERM, not TERMCAP. Both of these changes are because the TERMCAP variable is no longer supported under terminfo-based ncurses, which makes @TSET@ -S useless (we made it die noisily rather than silently induce lossage). There was an undocumented 4.4BSD feature that invoking tset via a link named `TSET` (or via any other name beginning with an upper-case letter) set the terminal to use upper-case only. This feature has been omitted. The -A, -E, -h, -u and -v options were deleted from the @TSET@ utility in 4.4BSD. None of them were documented in 4.3BSD and all are of limited utility at best. The -a, -d, and -p options are similarly not documented or useful, but were retained as they appear to be in widespread use. It is strongly recommended that any usage of these three options be changed to use the -m option instead. The -n option remains, but has no effect. The -adnp options are therefore omitted from the usage summary above. It is still permissible to specify the -e, -i, and -k options without arguments, although it is strongly recommended that such usage be fixed to explicitly specify the character. As of 4.4BSD, executing @TSET@ as reset no longer implies the -Q option. Also, the interaction between the - option and the terminal argument in some historic implementations of @TSET@ has been removed. ENVIRONMENT The @TSET@ command uses these environment variables: SHELL tells @TSET@ whether to initialize TERM using sh or csh syntax. TERM Denotes your terminal type. Each terminal type is distinct, though many are similar. TERMCAP may denote the location of a termcap database. If it is not an absolute pathname, e.g., begins with a `/', @TSET@ removes the variable from the environment before looking for the terminal description. FILES /etc/ttys system port name to terminal type mapping database (BSD versions only). /usr/share/terminfo terminal capability database SEE ALSO csh(1), sh(1), stty(1), curs_terminfo(3X), tty(4), terminfo(5), ttys(5), environ(7) This describes ncurses version 5.7 (patch 20081102). @TSET@(1)
@TSET@, reset - terminal initialization
@TSET@ [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal] reset [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]
null
null
chgrp
The chgrp utility sets the group ID of the file named by each file operand to the group ID specified by the group operand. The following options are available: -H If the -R option is specified, symbolic links on the command line are followed and hence unaffected by the command. (Symbolic links encountered during traversal are not followed.) -L If the -R option is specified, all symbolic links are followed. -P If the -R option is specified, no symbolic links are followed. This is the default. Use -h to change the group ID of a symbolic link. -R Change the group ID of the file hierarchies rooted in the files, instead of just the files themselves. Beware of unintentionally matching the “..” hard link to the parent directory when using wildcards like “.*”. -f The force option ignores errors, except for usage errors and does not query about strange modes (unless the user does not have proper permissions). -h If the file is a symbolic link, the group ID of the link itself is changed rather than the file that is pointed to. -n Interpret the group ID as numeric, avoiding the name lookup. -v Cause chgrp to be verbose, showing files as the group is modified. If the -v flag is specified more than once, chgrp will print the filename, followed by the old and new numeric group ID. -x File system mount points are not traversed. The -H, -L and -P options are ignored unless the -R option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. The group operand can be either a group name from the group database, or a numeric group ID. If a group name is also a numeric group ID, the operand is used as a group name. The user invoking chgrp must belong to the specified group and be the owner of the file, or be the super-user. If chgrp receives a SIGINFO signal (see the status argument for stty(1)), then the current filename as well as the old and new group names are displayed. FILES /etc/group group ID file EXIT STATUS The chgrp utility exits 0 on success, and >0 if an error occurs. COMPATIBILITY In previous versions of this system, symbolic links did not have groups. The -v and -x options are non-standard and their use in scripts is not recommended. SEE ALSO chown(2), fts(3), group(5), passwd(5), symlink(7), chown(8) STANDARDS The chgrp utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible. macOS 14.5 January 7, 2017 macOS 14.5
chgrp – change group
chgrp [-fhnvx] [-R [-H | -L | -P]] group file ...
null
null
cu
The cu command is used to call up another system and act as a dial in terminal. It can also do simple file transfers with no error checking. cu takes a single argument, besides the options. If the argument is the string "dir" cu will make a direct connection to the port. This may only be used by users with write access to the port, as it permits reprogramming the modem. Otherwise, if the argument begins with a digit, it is taken to be a phone number to call. Otherwise, it is taken to be the name of a system to call. The -z or --system option may be used to name a system beginning with a digit, and the -c or --phone option may be used to name a phone number that does not begin with a digit. cu locates a port to use in the UUCP configuration files. If a simple system name is given, it will select a port appropriate for that system. The -p, --port, -l, --line, -s and --speed options may be used to control the port selection. When a connection is made to the remote system, cu forks into two processes. One reads from the port and writes to the terminal, while the other reads from the terminal and writes to the port. cu provides several commands that may be used during the conversation. The commands all begin with an escape character, initially ~ (tilde). The escape character is only recognized at the beginning of a line. To send an escape character to the remote system at the start of a line, it must be entered twice. All commands are either a single character or a word beginning with % (percent sign). cu recognizes the following commands: ~. Terminate the conversation. ~! command Run command in a shell. If command is empty, starts up a shell. ~$ command Run command, sending the standard output to the remote system. ~| command Run command, taking the standard input from the remote system. ~+ command Run command, taking the standard input from the remote system and sending the standard output to the remote system. ~#, ~%break Send a break signal, if possible. ~c directory, ~%cd directory Change the local directory. ~> file Send a file to the remote system. This just dumps the file over the communication line. It is assumed that the remote system is expecting it. ~< Receive a file from the remote system. This prompts for the local file name and for the remote command to execute to begin the file transfer. It continues accepting data until the contents of the eofread variable are seen. ~p from to, ~%put from to Send a file to a remote Unix system. This runs the appropriate commands on the remote system. ~t from to, ~%take from to Retrieve a file from a remote Unix system. This runs the appropriate commands on the remote system. ~s variable value Set a cu variable to the given value. If value is not given, the variable is set to true. ~! variable Set a cu variable to false. ~z Suspend the cu session. This is only supported on some systems. On systems for which ^Z may be used to suspend a job, ~^Z will also suspend the session. ~%nostop Turn off XON/XOFF handling. ~%stop Turn on XON/XOFF handling. ~v List all the variables and their values. ~? List all commands. cu also supports several variables. They may be listed with the ~v command, and set with the ~s or ~! commands. escape The escape character. Initially ~ (tilde). delay If this variable is true, cu will delay for a second after recognizing the escape character before printing the name of the local system. The default is true. eol The list of characters which are considered to finish a line. The escape character is only recognized after one of these is seen. The default is carriage return, ^U, ^C, ^O, ^D, ^S, ^Q, ^R. binary Whether to transfer binary data when sending a file. If this is false, then newlines in the file being sent are converted to carriage returns. The default is false. binary-prefix A string used before sending a binary character in a file transfer, if the binary variable is true. The default is ^V. echo-check Whether to check file transfers by examining what the remote system echoes back. This probably doesn't work very well. The default is false. echonl The character to look for after sending each line in a file. The default is carriage return. timeout The timeout to use, in seconds, when looking for a character, either when doing echo checking or when looking for the echonl character. The default is 30. kill The character to use delete a line if the echo check fails. The default is ^U. resend The number of times to resend a line if the echo check continues to fail. The default is 10. eofwrite The string to write after sending a file with the ~> command. The default is ^D. eofread The string to look for when receiving a file with the ~< command. The default is $, which is intended to be a typical shell prompt. verbose Whether to print accumulated information during a file transfer. The default is true.
cu - Call up another system
cu [ options ] [ system | phone | "dir" ]
The following options may be given to cu. -e, --parity=even Use even parity. -o, --parity=odd Use odd parity. --parity=none Use no parity. No parity is also used if both -e and -o are given. -h, --halfduplex Echo characters locally (half-duplex mode). --nostop Turn off XON/XOFF handling (it is on by default). -E char, --escape char Set the escape character. Initially ~ (tilde). To eliminate the escape character, use -E ''. -z system, --system system The system to call. -c phone-number, --phone phone-number The phone number to call. -p port, --port port Name the port to use. -a port Equivalent to --port port. -l line, --line line Name the line to use by giving a device name. This may be used to dial out on ports that are not listed in the UUCP configuration files. Write access to the device is required. -s speed, --speed speed The speed (baud rate) to use. -# Where # is a number, equivalent to --speed #. -n, --prompt Prompt for the phone number to use. -d Enter debugging mode. Equivalent to --debug all. -x type, --debug type Turn on particular debugging types. The following types are recognized: abnormal, chat, handshake, uucp-proto, proto, port, config, spooldir, execute, incoming, outgoing. Only abnormal, chat, handshake, port, config, incoming and outgoing are meaningful for cu. Multiple types may be given, separated by commas, and the --debug option may appear multiple times. A number may also be given, which will turn on that many types from the foregoing list; for example, --debug 2 is equivalent to --debug abnormal,chat. --debug all may be used to turn on all debugging options. -I file, --config file Set configuration file to use. This option may not be available, depending upon how cu was compiled. -v, --version Report version information and exit. --help Print a help message and exit. BUGS This program does not work very well. AUTHOR Ian Lance Taylor <ian@airs.com> Taylor UUCP 1.07 cu(1)
null
printenv
The printenv utility prints out the names and values of the variables in the environment, with one name/value pair per line. If name is specified, only its value is printed. Some shells may provide a builtin printenv command which is similar or identical to this utility. Consult the builtin(1) manual page. EXIT STATUS The printenv utility exits 0 on success, and >0 if an error occurs. SEE ALSO csh(1), env(1), sh(1), environ(7) STANDARDS The printenv utility is provided for compatibility with earlier BSD and FreeBSD releases and is not specified by any standards. The functionality of printenv can be duplicated with the echo(1) and env(1) utilities. HISTORY The printenv command appeared in 3.0BSD. macOS 14.5 May 12, 2003 macOS 14.5
printenv – print out the environment
printenv [name]
null
null
yamlpp-load-dump5.30
null
null
null
null
null
unvis
unvis is the inverse function of vis(1). It reverts a visual representation of data back to its original form on standard output. The options are as follows: -e Don't decode \ escaped sequences. -H Decode entity references and numeric character references from RFC 1866. (VIS_HTTP1866) -h Decode using the URI encoding from RFC 1808. (VIS_HTTP1808) -m Decode using mime style. (VIS_MIMESTYLE) Mixing -h or -H with -m is not supported. SEE ALSO vis(1), unvis(3), vis(3) HISTORY The unvis command appears in 4.4BSD. macOS 14.5 November 27, 2010 macOS 14.5
unvis – revert a visual representation of data back to original form
unvis [-e] [-Hh | -m] [file ...]
null
null
shasum5.30
Running shasum is often the quickest way to compute SHA message digests. The user simply feeds data to the script through files or standard input, and then collects the results from standard output. The following command shows how to compute digests for typical inputs such as the NIST test vector "abc": perl -e "print qq(abc)" | shasum Or, if you want to use SHA-256 instead of the default SHA-1, simply say: perl -e "print qq(abc)" | shasum -a 256 Since shasum mimics the behavior of the combined GNU sha1sum, sha224sum, sha256sum, sha384sum, and sha512sum programs, you can install this script as a convenient drop-in replacement. Unlike the GNU programs, shasum encompasses the full SHA standard by allowing partial-byte inputs. This is accomplished through the BITS option (-0). The following example computes the SHA-224 digest of the 7-bit message 0001100: perl -e "print qq(0001100)" | shasum -0 -a 224 AUTHOR Copyright (C) 2003-2018 Mark Shelor <mshelor@cpan.org>. SEE ALSO shasum is implemented using the Perl module Digest::SHA. perl v5.30.3 2024-04-13 SHASUM(1)
shasum - Print or Check SHA Checksums
Usage: shasum [OPTION]... [FILE]... Print or check SHA checksums. With no FILE, or when FILE is -, read standard input. -a, --algorithm 1 (default), 224, 256, 384, 512, 512224, 512256 -b, --binary read in binary mode -c, --check read SHA sums from the FILEs and check them --tag create a BSD-style checksum -t, --text read in text mode (default) -U, --UNIVERSAL read in Universal Newlines mode produces same digest on Windows/Unix/Mac -0, --01 read in BITS mode ASCII '0' interpreted as 0-bit, ASCII '1' interpreted as 1-bit, all other characters ignored The following five options are useful only when verifying checksums: --ignore-missing don't fail or report status for missing files -q, --quiet don't print OK for each successfully verified file -s, --status don't output anything, status code shows success --strict exit non-zero for improperly formatted checksum lines -w, --warn warn about improperly formatted checksum lines -h, --help display this help and exit -v, --version output version information and exit When verifying SHA-512/224 or SHA-512/256 checksums, indicate the algorithm explicitly using the -a option, e.g. shasum -a 512224 -c checksumfile The sums are computed as described in FIPS PUB 180-4. When checking, the input should be a former output of this program. The default mode is to print a line with checksum, a character indicating type (`*' for binary, ` ' for text, `U' for UNIVERSAL, `^' for BITS), and name for each FILE. The line starts with a `\' character if the FILE name contains either newlines or backslashes, which are then replaced by the two-character sequences `\n' and `\\' respectively. Report shasum bugs to mshelor@cpan.org
null
null
atq
The at and batch utilities read commands from standard input or a specified file which are to be executed at a later time, using sh(1). at executes commands at a specified time; atq lists the user's pending jobs, unless the user is the superuser; in that case, everybody's jobs are listed; atrm deletes jobs; batch executes commands when system load levels permit; in other words, when the load average drops below 1.5 times number of active CPUs, or the value specified in the invocation of atrun. The at utility allows some moderately complex time specifications. It accepts times of the form HHMM or HH:MM to run a job at a specific time of day. (If that time is already past, the next day is assumed.) As an alternative, the following keywords may be specified: midnight, noon, or teatime (4pm) and time-of-day may be suffixed with AM, PM, or UTC for running in the morning, the evening, or in UTC time. The day on which the job is to be run may also be specified by giving a date in the form month-name day with an optional year, or giving a date of the forms DD.MM.YYYY, DD.MM.YY, MM/DD/YYYY, MM/DD/YY, MMDDYYYY, or MMDDYY. The specification of a date must follow the specification of the time of day. Time can also be specified as: [now] + count time-units, where the time- units can be minutes, hours, days, weeks, months or years and at may be told to run the job today by suffixing the time with today and to run the job tomorrow by suffixing the time with tomorrow. The shortcut next can be used instead of + 1. For example, to run a job at 4pm three days from now, use at 4pm + 3 days, to run a job at 10:00am on July 31, use at 10am Jul 31 and to run a job at 1am tomorrow, use at 1am tomorrow. The at utility also supports the POSIX time format (see -t option). For both at and batch, commands are read from standard input or the file specified with the -f option and executed. The working directory, the environment (except for the variables TERM, TERMCAP, DISPLAY and _) and the umask are retained from the time of invocation. An at or batch command invoked from a su(1) shell will retain the current userid. The user will be mailed standard error and standard output from his commands, if any. Mail will be sent using the command sendmail(8). If at is executed from a su(1) shell, the owner of the login shell will receive the mail. The superuser may use these commands in any case. For other users, permission to use at is determined by the files /usr/lib/cron/at.allow and /usr/lib/cron/at.deny. If the file /usr/lib/cron/at.allow exists, only usernames mentioned in it are allowed to use at. In these two files, a user is considered to be listed only if the user name has no blank or other characters before it on its line and a newline character immediately after the name, even at the end of the file. Other lines are ignored and may be used for comments. If /usr/lib/cron/at.allow does not exist, /usr/lib/cron/at.deny is checked, every username not mentioned in it is then allowed to use at. If neither exists, only the superuser is allowed use of at. This is the default configuration. IMPLEMENTATION NOTES Note that at is implemented through the launchd(8) daemon periodically invoking atrun(8), which is disabled by default. See atrun(8) for information about enabling atrun.
at, batch, atq, atrm – queue, examine or delete jobs for later execution
at [-q queue] [-f file] [-mldbv] time at [-q queue] [-f file] [-mldbv] -t [[CC]YY]MMDDhhmm[.SS] at -c job [job ...] at -l [job ...] at -l -q queue at -r job [job ...] atq [-q queue] [-v] atrm job [job ...] batch [-q queue] [-f file] [-mv] [time]
-q queue Use the specified queue. A queue designation consists of a single letter; valid queue designations range from a to z and A to Z. The a queue is the default for at and the b queue for batch. Queues with higher letters run with increased niceness. If a job is submitted to a queue designated with an uppercase letter, it is treated as if it had been submitted to batch at that time. If atq is given a specific queue, it will only show jobs pending in that queue. -m Send mail to the user when the job has completed even if there was no output. -f file Read the job from file rather than standard input. -l With no arguments, list all jobs for the invoking user. If one or more job numbers are given, list only those jobs. -d Is an alias for atrm (this option is deprecated; use -r instead). -b Is an alias for batch. -v For atq, shows completed but not yet deleted jobs in the queue; otherwise shows the time the job will be executed. -c Cat the jobs listed on the command line to standard output. -r Remove the specified jobs. -t Specify the job time using the POSIX time format. The argument should be in the form [[CC]YY]MMDDhhmm[.SS] where each pair of letters represents the following: CC The first two digits of the year (the century). YY The second two digits of the year. MM The month of the year, from 1 to 12. DD the day of the month, from 1 to 31. hh The hour of the day, from 0 to 23. mm The minute of the hour, from 0 to 59. SS The second of the minute, from 0 to 60. If the CC and YY letter pairs are not specified, the values default to the current year. If the SS letter pair is not specified, the value defaults to 0. FILES /usr/lib/cron/jobs directory containing job files /usr/lib/cron/spool directory containing output spool files /var/run/utmpx login records /usr/lib/cron/at.allow allow permission control /usr/lib/cron/at.deny deny permission control /usr/lib/cron/jobs/.lockfile job-creation lock file SEE ALSO nice(1), sh(1), umask(2), compat(5), atrun(8), cron(8), launchd(8), sendmail(8) AUTHORS At was mostly written by Thomas Koenig <ig25@rz.uni-karlsruhe.de>. The time parsing routines are by David Parsons <orc@pell.chi.il.us>, with minor enhancements by Joe Halpin <joe.halpin@attbi.com>. BUGS If the file /var/run/utmpx is not available or corrupted, or if the user is not logged on at the time at is invoked, the mail is sent to the userid found in the environment variable LOGNAME. If that is undefined or empty, the current userid is assumed. The at and batch utilities as presently implemented are not suitable when users are competing for resources. If this is the case, another batch system such as nqs may be more suitable. Specifying a date past 2038 may not work on some systems. macOS 14.5 August 11, 2018 macOS 14.5
null
seq
The seq utility prints a sequence of numbers, one per line (default), from first (default 1), to near last as possible, in increments of incr (default 1). When first is larger than last, the default incr is -1. All numbers are interpreted as floating point. Normally integer values are printed as decimal integers. The seq utility accepts the following options: -f format, --format format Use a printf(3) style format to print each number. Only the A, a, E, e, F, f, G, g, and % conversion characters are valid, along with any optional flags and an optional numeric minimum field width or precision. The format can contain character escape sequences in backslash notation as defined in ANSI X3.159-1989 (“ANSI C89”). The default is %g. -s string, --separator string Use string to separate numbers. The string can contain character escape sequences in backslash notation as defined in ANSI X3.159-1989 (“ANSI C89”). The default is \n. -t string, --terminator string Use string to terminate sequence of numbers. The string can contain character escape sequences in backslash notation as defined in ANSI X3.159-1989 (“ANSI C89”). This option is useful when the default separator does not contain a \n. -w, --fixed-width Equalize the widths of all numbers by padding with zeros as necessary. This option has no effect with the -f option. If any sequence numbers will be printed in exponential notation, the default conversion is changed to %e. EXIT STATUS The seq utility exits 0 on success, and >0 if an error occurs.
seq – print sequences of numbers
seq [-w] [-f format] [-s string] [-t string] [first [incr]] last
null
Generate a sequence from 1 to 3 (included) with a default increment of 1: # seq 1 3 1 2 3 Generate a sequence from 3 to 1 (included) with a default increment of -1: # seq 3 1 3 2 1 Generate a sequence from 0 to 0.1 (included) with an increment of 0.05 and padding with leading zeroes. # seq -w 0 .05 .1 0.00 0.05 0.10 Generate a sequence from 1 to 3 (included) with a default increment of 1, a custom separator string and a custom terminator: # seq -s "-->" -t "[end of list]\n" 1 3 1-->2-->3-->[end of list] Generate a sequence from 1 to 2 (included) with an increment of 0.2 and print the results with two digits after the decimal point (using a printf(3) style format): # seq -f %.2f 1 0.2 2 1.00 1.20 1.40 1.60 1.80 2.00 SEE ALSO jot(1), printf(1), printf(3) HISTORY The seq command first appeared in Version 8 AT&T UNIX. A seq command appeared in NetBSD 3.0, and was ported to FreeBSD 9.0. This command was based on the command of the same name in Plan 9 from Bell Labs and the GNU core utilities. The GNU seq command first appeared in the 1.13 shell utilities release. BUGS The -w option does not handle the transition from pure floating point to exponent representation very well. The seq command is not bug for bug compatible with other implementations. macOS 14.5 June 20, 2020 macOS 14.5
fc
Shell builtin commands are commands that can be executed within the running shell's process. Note that, in the case of csh(1) builtin commands, the command is executed in a subshell if it occurs as any component of a pipeline except the last. If a command specified to the shell contains a slash ‘/’, the shell will not execute a builtin command, even if the last component of the specified command matches the name of a builtin command. Thus, while specifying “echo” causes a builtin command to be executed under shells that support the echo builtin command, specifying “/bin/echo” or “./echo” does not. While some builtin commands may exist in more than one shell, their operation may be different under each shell which supports them. Below is a table which lists shell builtin commands, the standard shells that support them and whether they exist as standalone utilities. Only builtin commands for the csh(1) and sh(1) shells are listed here. Consult a shell's manual page for details on the operation of its builtin commands. Beware that the sh(1) manual page, at least, calls some of these commands “built-in commands” and some of them “reserved words”. Users of other shells may need to consult an info(1) page or other sources of documentation. Commands marked “No**” under External do exist externally, but are implemented as scripts using a builtin command of the same name. Command External csh(1) sh(1) ! No No Yes % No Yes No . No No Yes : No Yes Yes @ No Yes Yes [ Yes No Yes { No No Yes } No No Yes alias No** Yes Yes alloc No Yes No bg No** Yes Yes bind No No Yes bindkey No Yes No break No Yes Yes breaksw No Yes No builtin No No Yes builtins No Yes No case No Yes Yes cd No** Yes Yes chdir No Yes Yes command No** No Yes complete No Yes No continue No Yes Yes default No Yes No dirs No Yes No do No No Yes done No No Yes echo Yes Yes Yes echotc No Yes No elif No No Yes else No Yes Yes end No Yes No endif No Yes No endsw No Yes No esac No No Yes eval No Yes Yes exec No Yes Yes exit No Yes Yes export No No Yes false Yes No Yes fc No** No Yes fg No** Yes Yes filetest No Yes No fi No No Yes for No No Yes foreach No Yes No getopts No** No Yes glob No Yes No goto No Yes No hash No** No Yes hashstat No Yes No history No Yes No hup No Yes No if No Yes Yes jobid No No Yes jobs No** Yes Yes kill Yes Yes Yes limit No Yes No local No No Yes log No Yes No login Yes Yes No logout No Yes No ls-F No Yes No nice Yes Yes No nohup Yes Yes No notify No Yes No onintr No Yes No popd No Yes No printenv Yes Yes No printf Yes No Yes pushd No Yes No pwd Yes No Yes read No** No Yes readonly No No Yes rehash No Yes No repeat No Yes No return No No Yes sched No Yes No set No Yes Yes setenv No Yes No settc No Yes No setty No Yes No setvar No No Yes shift No Yes Yes source No Yes No stop No Yes No suspend No Yes No switch No Yes No telltc No Yes No test Yes No Yes then No No Yes time Yes Yes No times No No Yes trap No No Yes true Yes No Yes type No** No Yes ulimit No** No Yes umask No** Yes Yes unalias No** Yes Yes uncomplete No Yes No unhash No Yes No unlimit No Yes No unset No Yes Yes unsetenv No Yes No until No No Yes wait No** Yes Yes where No Yes No which Yes Yes No while No Yes Yes SEE ALSO csh(1), dash(1), echo(1), false(1), info(1), kill(1), login(1), nice(1), nohup(1), printenv(1), printf(1), pwd(1), sh(1), test(1), time(1), true(1), which(1), zsh(1) HISTORY The builtin manual page first appeared in FreeBSD 3.4. AUTHORS This manual page was written by Sheldon Hearn <sheldonh@FreeBSD.org>. macOS 14.5 December 21, 2010 macOS 14.5
builtin, !, %, ., :, @, [, {, }, alias, alloc, bg, bind, bindkey, break, breaksw, builtins, case, cd, chdir, command, complete, continue, default, dirs, do, done, echo, echotc, elif, else, end, endif, endsw, esac, eval, exec, exit, export, false, fc, fg, filetest, fi, for, foreach, getopts, glob, goto, hash, hashstat, history, hup, if, jobid, jobs, kill, limit, local, log, login, logout, ls-F, nice, nohup, notify, onintr, popd, printenv, printf, pushd, pwd, read, readonly, rehash, repeat, return, sched, set, setenv, settc, setty, setvar, shift, source, stop, suspend, switch, telltc, test, then, time, times, trap, true, type, ulimit, umask, unalias, uncomplete, unhash, unlimit, unset, unsetenv, until, wait, where, which, while – shell built-in commands
See the built-in command description in the appropriate shell manual page.
null
null
AssetCacheManagerUtil
AssetCacheManagerUtil controls the macOS Content Cache. AssetCacheManagerUtil must be run by root except as noted below. The options are: -a|--all Show all events, not just the end result of the specified command. -j|--json Print results in machine-parseable JSON format to stdout. -l|--linger Linger after completing command, to show other events. The commands are: activate Activates the content cache. Content caching is deactivated by default. After you activate content caching, restart devices on your network to take advantage of content caching immediately. Devices on your network will discover this content cache over time. Devices that are restarted will use this content cache immediately. deactivate Deactivates the content cache. isActivated Reports the content cache's activation status. Does not require root. canActivate Reports whether the content cache is eligible for activation. Does not require root. flushCache Flushes the content cache. flushPersonalCache Flushes all personal (iCloud) content from the content cache. flushSharedCache Flushes all shared (non-iCloud) content from the content cache. status Reports the content cache's status. Does not require root. settings Reports the content cache's settings. Does not require root. reloadSettings Forces the content cache to reload its settings. moveCacheTo path Moves the cache to path. The path must end with /Library/Application Support/Apple/AssetCache/Data. The contents of path are deleted and replaced with the cache. absorbCacheFrom path read-only|and-destroy Imports the cache from path. The path must end with either /Library/Application Support/Apple/AssetCache/Data or /Library/Server/Caching/Data. If the last argument is read-only the cache at path is not modified, otherwise it is emptied. This command only starts the absorption, which proceeds and finishes in the background. Use the log(1) command to view progress, for example: log show --predicate 'subsystem == "com.apple.AssetCache"' --style compact --last 5m SEE ALSO System Settings > Sharing > Content Caching, AssetCache(8), AssetCacheLocatorUtil(8), AssetCacheTetheratorUtil(8) macOS 10/24/16 macOS
AssetCacheManagerUtil – control the macOS Content Cache
AssetCacheManagerUtil [-a|--all] [-j|--json] [-l|--linger] command
null
null
xgettext5.34.pl
null
null
null
null
null
colldef
The colldef utility converts a collation sequence source definition into a format usable by the strxfrm() and strcoll() functions. It is used to define the many ways in which strings can be ordered and collated. The strxfrm() function transforms its first argument and places the result in its second argument. The transformed string is such that it can be correctly ordered with other transformed strings by using strcmp(), strncmp(), or memcmp(). The strcoll() function transforms its arguments and does a comparison. The colldef utility reads the collation sequence source definition from the standard input and stores the converted definition in filename. The output file produced contains the database with collating sequence information in a form usable by system commands and routines. The following options are available: -I map_dir Set directory name where charmap files can be found, current directory by default. -o out_file Set output file name, LC_COLLATE by default. The collation sequence definition specifies a set of collating elements and the rules defining how strings containing these should be ordered. This is most useful for different language definitions. The specification file can consist of three statements: charmap, substitute and order. Of these, only the order statement is required. When charmap or substitute is supplied, these statements must be ordered as above. Any statements after the order statement are ignored. Lines in the specification file beginning with a ‘#’ are treated as comments and are ignored. Blank lines are also ignored. charmap charmapfile Charmap defines where a mapping of the character and collating element symbols to the actual character encoding can be found. The format of charmapfile is shown below. Symbol names are separated from their values by TAB or SPACE characters. Symbol-value can be specified in a hexadecimal (\x??) or octal (\???) representation, and can be only one character in length. symbol-name1 symbol-value1 symbol-name2 symbol-value2 ... Symbol names cannot be specified in substitute fields. The charmap statement is optional. substitute "symbol" with "repl_string" The substitute statement substitutes the character symbol with the string repl_string. Symbol names cannot be specified in repl_string field. The substitute statement is optional. order order_list Order_list is a list of symbols, separated by semi colons, that defines the collating sequence. The special symbol ... specifies, in a short- hand form, symbols that are sequential in machine code order. An order list element can be represented in any one of the following ways: • The symbol itself (for example, a for the lower-case letter a). • The symbol in octal representation (for example, \141 for the letter a). • The symbol in hexadecimal representation (for example, \x61 for the letter a). • The symbol name as defined in the charmap file (for example, <letterA> for letterA \023 record in charmapfile). If character map name have > character, it must be escaped as />, single / must be escaped as //. • Symbols \a, \b, \f, \n, \r, \v are permitted in its usual C-language meaning. • The symbol chain (for example: abc, <letterA><letterB>c, \xf1b\xf2) • The symbol range (for example, a;...;z). • Comma-separated symbols, ranges and chains enclosed in parenthesis (for example ( sym1, sym2, ... )) are assigned the same primary ordering but different secondary ordering. • Comma-separated symbols, ranges and chains enclosed in curly brackets (for example { sym1, sym2, ... }) are assigned the same primary ordering only. The backslash character \ is used for continuation. In this case, no characters are permitted after the backslash character. DIAGNOSTICS The colldef utility exits with the following values: 0 No errors were found and the output was successfully created. !=0 Errors were found. FILES /usr/share/locale/⟨language⟩/LC_COLLATE The standard shared location for collation orders under the locale ⟨language⟩. SEE ALSO mklocale(1), setlocale(3), strcoll(3), strxfrm(3) macOS 14.5 January 27, 1995 macOS 14.5
colldef – convert collation sequence source definition
colldef [-I map_dir] [-o out_file] [filename]
null
null
net-server5.30
The net-server program gives a simple way to test out code and try port connection parameters. Though the running server can be robust enough for full tim use, it is anticipated that this binary will just be used for basic testing of net-server ports, acting as a simple echo server, or for running development scripts as CGI.
net-server - Base Net::Server starting module
net-server [base type] [net server arguments] net-server PreFork ipv '*' net-server HTTP net-server HTTP app foo.cgi net-server HTTP app foo.cgi app /=bar.cgi net-server HTTP port 8080 port 8443/ssl ipv '*' server_type PreFork --SSL_key_file=my.key --SSL_cert_file=my.crt access_log_file STDERR
"base type" The very first argument may be a Net::Server flavor. This is given as shorthand for writing out server_type "ServerFlavor". Additionally, this allows types such as HTTP and PSGI, which are not true Net::Server base types, to subclass other server types via an additional server_type argument. net-server PreFork net-server HTTP # becomes a HTTP server in the Fork flavor net-server HTTP server_type PreFork # preforking HTTP server "port" Port to bind upon. Default is 80 if running a HTTP server as root, 8080 if running a HTTP server as non-root, or 20203 otherwise. Multiple value can be given for binding to multiple ports. All of the methods for specifying port attributes enumerated in Net::Server and Net::Server::Proto are available here. net-server port 20201 net-server port 20202 net-server port 20203/IPv6 "host" Host to bind to. Default is *. Will bind to an IPv4 socket if an IPv4 address is given. Will bind to an IPv6 socket if an IPv6 address is given (requires installation of IO::Socket::INET6). If a hostname is given and "ipv" is still set to 4, an IPv4 socket will be created. If a hostname is given and "ipv" is set to 6, an IPv6 socket will be created. If a hostname is given and "ipv" is set to * (default), a lookup will be performed and any available IPv4 or IPv6 addresses will be bound. The "ipv" parameter can be set directly, or passed along in the port, or additionally can be passed as part of the hostname. net-server host localhost net-server host localhost/IPv4 There are many more options available. Please see the Net::Server documentation. AUTHOR Paul Seamons <paul@seamons.com> LICENSE This package may be distributed under the terms of either the GNU General Public License or the Perl Artistic License perl v5.30.3 2017-08-10 NET-SERVER(1)
null
jdb
The Java Debugger (JDB) is a simple command-line debugger for Java classes. The jdb command and its options call the JDB. The jdb command demonstrates the Java Platform Debugger Architecture and provides inspection and debugging of a local or remote JVM. START A JDB SESSION There are many ways to start a JDB session. The most frequently used way is to have the JDB launch a new JVM with the main class of the application to be debugged. Do this by substituting the jdb command for the java command in the command line. For example, if your application's main class is MyClass, then use the following command to debug it under the JDB: jdb MyClass When started this way, the jdb command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class's first instruction. Another way to use the jdb command is by attaching it to a JVM that's already running. Syntax for starting a JVM to which the jdb command attaches when the JVM is running is as follows. This loads in-process debugging libraries and specifies the kind of connection to be made. java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass You can then attach the jdb command to the JVM with the following command: jdb -attach 8000 8000 is the address of the running JVM. The MyClass argument isn't specified in the jdb command line in this case because the jdb command is connecting to an existing JVM instead of launching a new JVM. There are many other ways to connect the debugger to a JVM, and all of them are supported by the jdb command. The Java Platform Debugger Architecture has additional documentation on these connection options. BREAKPOINTS Breakpoints can be set in the JDB at line numbers or at the first instruction of a method, for example: • The command stop at MyClass:22 sets a breakpoint at the first instruction for line 22 of the source file containing MyClass. • The command stop in java.lang.String.length sets a breakpoint at the beginning of the method java.lang.String.length. • The command stop in MyClass.<clinit> uses <clinit> to identify the static initialization code for MyClass. When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint. For example, MyClass.myMethod(int,java.lang.String) or MyClass.myMethod(). The clear command removes breakpoints using the following syntax: clear MyClass:45. Using the clear or stop command with no argument displays a list of all breakpoints currently set. The cont command continues execution. STEPPING The step command advances execution to the next line whether it's in the current stack frame or a called method. The next command advances execution to the next line in the current stack frame. EXCEPTIONS When an exception occurs for which there isn't a catch statement anywhere in the throwing thread's call stack, the JVM typically prints an exception trace and exits. When running under the JDB, however, control returns to the JDB at the offending throw. You can then use the jdb command to diagnose the cause of the exception. Use the catch command to cause the debugged application to stop at other thrown exceptions, for example: catch java.io.FileNotFoundException or catch mypackage.BigTroubleException. Any exception that's an instance of the specified class or subclass stops the application at the point where the exception is thrown. The ignore command negates the effect of an earlier catch command. The ignore command doesn't cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger. OPTIONS FOR THE JDB COMMAND When you use the jdb command instead of the java command on the command line, the jdb command accepts many of the same options as the java command. The following options are accepted by the jdb command: -help Displays a help message. -sourcepath dir1:dir2:... Uses the specified path to search for source files in the specified path. If this option is not specified, then use the default path of dot (.). -attach address Attaches the debugger to a running JVM with the default connection mechanism. -listen address Waits for a running JVM to connect to the specified address with a standard connector. -listenany Waits for a running JVM to connect at any available address using a standard connector. -launch Starts the debugged application immediately upon startup of the jdb command. The -launch option removes the need for the run command. The debugged application is launched and then stopped just before the initial application class is loaded. At that point, you can set any necessary breakpoints and use the cont command to continue execution. -listconnectors Lists the connectors available in this JVM. -connect connector-name:name1=value1.... Connects to the target JVM with the named connector and listed argument values. -dbgtrace [flags] Prints information for debugging the jdb command. -tclient Runs the application in the Java HotSpot VM client. -trackallthreads Track all threads as they are created, including virtual threads. See Working With Virtual Threads below. -tserver Runs the application in the Java HotSpot VM server. -Joption Passes option to the JDB JVM, where option is one of the options described on the reference page for the Java application launcher. For example, -J-Xms48m sets the startup memory to 48 MB. See Overview of Java Options in java. The following options are forwarded to the debuggee process: -Roption Passes option to the debuggee JVM, where option is one of the options described on the reference page for the Java application launcher. For example, -R-Xms48m sets the startup memory to 48 MB. See Overview of Java Options in java. -v or -verbose[:class|gc|jni] Turns on the verbose mode. -Dname=value Sets a system property. -classpath dir Lists directories separated by colons in which to look for classes. -X option A nonstandard target JVM option. Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM that it's to debug. WORKING WITH VIRTUAL THREADS Often virtual theads are created in such large numbers and frequency that they can overwhelm a debugger. For this reason by default JDB does not keep track of virtual threads as they are created. It will only keep track of virtual threads that an event has arrived on, such as a breakpoint event. The -trackallthreads option can be used to make JDB track all virtual threads as they are created. When JDB first connects, it requests a list of all known threads from the Debug Agent. By default the debug agent does not return any virtual threads in this list, once again because the list could be so large that it overwhelms the debugger. The Debug Agent has an includevirtualthreads option that can be enabled to change this behavior so all known virtual threads will be included in the list. The JDB -trackallthreads option will cause JDB to automatically enable the Debug Agent's includevirtualthreads option when JDB launches an application to debug. However, keep in mind that the Debug Agent may not know about any virtual threads that were created before JDB attached to the debugged application. JDK 22 2024 JDB(1)
jdb - find and fix bugs in Java platform programs
jdb [options] [classname] [arguments]
This represents the jdb command-line options. See Options for the jdb command. classname This represents the name of the main class to debug. arguments This represents the arguments that are passed to the main() method of the class.
null
perl5.30
Perl officially stands for Practical Extraction and Report Language, except when it doesn't. Perl was originally a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It quickly became a good language for many system management tasks. Over the years, Perl has grown into a general-purpose programming language. It's widely used for everything from quick "one-liners" to full-scale application development. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). It combines (in the author's opinion, anyway) some of the best features of sed, awk, and sh, making it familiar and easy to use for Unix users to whip up quick solutions to annoying problems. Its general-purpose programming facilities support procedural, functional, and object- oriented programming paradigms, making Perl a comfortable language for the long haul on major projects, whatever your bent. Perl's roots in text processing haven't been forgotten over the years. It still boasts some of the most powerful regular expressions to be found anywhere, and its support for Unicode text is world-class. It handles all kinds of structured text, too, through an extensive collection of extensions. Those libraries, collected in the CPAN, provide ready-made solutions to an astounding array of problems. When they haven't set the standard themselves, they steal from the best -- just like Perl itself. AVAILABILITY Perl is available for most operating systems, including virtually all Unix-like platforms. See "Supported Platforms" in perlport for a listing. ENVIRONMENT See perlrun. AUTHOR Larry Wall <larry@wall.org>, with the help of oodles of other folks. If your Perl success stories and testimonials may be of help to others who wish to advocate the use of Perl in their applications, or if you wish to simply express your gratitude to Larry and the Perl developers, please write to perl-thanks@perl.org . FILES "@INC" locations of perl libraries "@INC" above is a reference to the built-in variable of the same name; see perlvar for more information. SEE ALSO http://www.perl.org/ the Perl homepage http://www.perl.com/ Perl articles (O'Reilly) http://www.cpan.org/ the Comprehensive Perl Archive http://www.pm.org/ the Perl Mongers DIAGNOSTICS Using the "use strict" pragma ensures that all variables are properly declared and prevents other misuses of legacy Perl features. The "use warnings" pragma produces some lovely diagnostics. One can also use the -w flag, but its use is normally discouraged, because it gets applied to all executed Perl code, including that not under your control. See perldiag for explanations of all Perl's diagnostics. The "use diagnostics" pragma automatically turns Perl's normally terse warnings and errors into these longer forms. Compilation errors will tell you the line number of the error, with an indication of the next token or token type that was to be examined. (In a script passed to Perl via -e switches, each -e is counted as one line.) Setuid scripts have additional constraints that can produce error messages such as "Insecure dependency". See perlsec. Did we mention that you should definitely consider using the use warnings pragma? BUGS The behavior implied by the use warnings pragma is not mandatory. Perl is at the mercy of your machine's definitions of various operations such as type casting, atof(), and floating-point output with sprintf(). If your stdio requires a seek or eof between reads and writes on a particular stream, so does Perl. (This doesn't apply to sysread() and syswrite().) While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still a few arbitrary limits: a given variable name may not be longer than 251 characters. Line numbers displayed by diagnostics are internally stored as short integers, so they are limited to a maximum of 65535 (higher numbers usually being affected by wraparound). You may submit your bug reports (be sure to include full configuration information as output by the myconfig program in the perl source tree, or by "perl -V") to <https://github.com/Perl/perl5/issues>. Perl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that. NOTES The Perl motto is "There's more than one way to do it." Divining how many more is left as an exercise to the reader. The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why. perl v5.30.3 2020-05-14 PERL(1)
perl - The Perl 5 language interpreter
perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ] [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ] [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ] [ -C [number/list] ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]... For more information on these options, you can run "perldoc perlrun". GETTING HELP The perldoc program gives you access to all the documentation that comes with Perl. You can get more documentation, tutorials and community support online at <http://www.perl.org/>. If you're new to Perl, you should start by running "perldoc perlintro", which is a general intro for beginners and provides some background to help you navigate the rest of Perl's extensive documentation. Run "perldoc perldoc" to learn more things you can do with perldoc. For ease of access, the Perl manual has been split up into several sections. Overview perl Perl overview (this section) perlintro Perl introduction for beginners perlrun Perl execution and options perltoc Perl documentation table of contents Tutorials perlreftut Perl references short introduction perldsc Perl data structures intro perllol Perl data structures: arrays of arrays perlrequick Perl regular expressions quick start perlretut Perl regular expressions tutorial perlootut Perl OO tutorial for beginners perlperf Perl Performance and Optimization Techniques perlstyle Perl style guide perlcheat Perl cheat sheet perltrap Perl traps for the unwary perldebtut Perl debugging tutorial perlfaq Perl frequently asked questions perlfaq1 General Questions About Perl perlfaq2 Obtaining and Learning about Perl perlfaq3 Programming Tools perlfaq4 Data Manipulation perlfaq5 Files and Formats perlfaq6 Regexes perlfaq7 Perl Language Issues perlfaq8 System Interaction perlfaq9 Networking Reference Manual perlsyn Perl syntax perldata Perl data structures perlop Perl operators and precedence perlsub Perl subroutines perlfunc Perl built-in functions perlopentut Perl open() tutorial perlpacktut Perl pack() and unpack() tutorial perlpod Perl plain old documentation perlpodspec Perl plain old documentation format specification perlpodstyle Perl POD style guide perldiag Perl diagnostic messages perldeprecation Perl deprecations perllexwarn Perl warnings and their control perldebug Perl debugging perlvar Perl predefined variables perlre Perl regular expressions, the rest of the story perlrebackslash Perl regular expression backslash sequences perlrecharclass Perl regular expression character classes perlreref Perl regular expressions quick reference perlref Perl references, the rest of the story perlform Perl formats perlobj Perl objects perltie Perl objects hidden behind simple variables perldbmfilter Perl DBM filters perlipc Perl interprocess communication perlfork Perl fork() information perlnumber Perl number semantics perlthrtut Perl threads tutorial perlport Perl portability guide perllocale Perl locale support perluniintro Perl Unicode introduction perlunicode Perl Unicode support perlunicook Perl Unicode cookbook perlunifaq Perl Unicode FAQ perluniprops Index of Unicode properties in Perl perlunitut Perl Unicode tutorial perlebcdic Considerations for running Perl on EBCDIC platforms perlsec Perl security perlmod Perl modules: how they work perlmodlib Perl modules: how to write and use perlmodstyle Perl modules: how to write modules with style perlmodinstall Perl modules: how to install from CPAN perlnewmod Perl modules: preparing a new module for distribution perlpragma Perl modules: writing a user pragma perlutil utilities packaged with the Perl distribution perlfilter Perl source filters perldtrace Perl's support for DTrace perlglossary Perl Glossary Internals and C Language Interface perlembed Perl ways to embed perl in your C or C++ application perldebguts Perl debugging guts and tips perlxstut Perl XS tutorial perlxs Perl XS application programming interface perlxstypemap Perl XS C/Perl type conversion tools perlclib Internal replacements for standard C library functions perlguts Perl internal functions for those doing extensions perlcall Perl calling conventions from C perlmroapi Perl method resolution plugin interface perlreapi Perl regular expression plugin interface perlreguts Perl regular expression engine internals perlapi Perl API listing (autogenerated) perlintern Perl internal functions (autogenerated) perliol C API for Perl's implementation of IO in Layers perlapio Perl internal IO abstraction interface perlhack Perl hackers guide perlsource Guide to the Perl source tree perlinterp Overview of the Perl interpreter source and how it works perlhacktut Walk through the creation of a simple C code patch perlhacktips Tips for Perl core C code hacking perlpolicy Perl development policies perlgit Using git with the Perl repository Miscellaneous perlbook Perl book information perlcommunity Perl community information perldoc Look up Perl documentation in Pod format perlhist Perl history records perldelta Perl changes since previous version perl5302delta Perl changes in version 5.30.2 perl5301delta Perl changes in version 5.30.1 perl5300delta Perl changes in version 5.30.0 perl5282delta Perl changes in version 5.28.2 perl5281delta Perl changes in version 5.28.1 perl5280delta Perl changes in version 5.28.0 perl5263delta Perl changes in version 5.26.3 perl5262delta Perl changes in version 5.26.2 perl5261delta Perl changes in version 5.26.1 perl5260delta Perl changes in version 5.26.0 perl5244delta Perl changes in version 5.24.4 perl5243delta Perl changes in version 5.24.3 perl5242delta Perl changes in version 5.24.2 perl5241delta Perl changes in version 5.24.1 perl5240delta Perl changes in version 5.24.0 perl5224delta Perl changes in version 5.22.4 perl5223delta Perl changes in version 5.22.3 perl5222delta Perl changes in version 5.22.2 perl5221delta Perl changes in version 5.22.1 perl5220delta Perl changes in version 5.22.0 perl5203delta Perl changes in version 5.20.3 perl5202delta Perl changes in version 5.20.2 perl5201delta Perl changes in version 5.20.1 perl5200delta Perl changes in version 5.20.0 perl5184delta Perl changes in version 5.18.4 perl5182delta Perl changes in version 5.18.2 perl5181delta Perl changes in version 5.18.1 perl5180delta Perl changes in version 5.18.0 perl5163delta Perl changes in version 5.16.3 perl5162delta Perl changes in version 5.16.2 perl5161delta Perl changes in version 5.16.1 perl5160delta Perl changes in version 5.16.0 perl5144delta Perl changes in version 5.14.4 perl5143delta Perl changes in version 5.14.3 perl5142delta Perl changes in version 5.14.2 perl5141delta Perl changes in version 5.14.1 perl5140delta Perl changes in version 5.14.0 perl5125delta Perl changes in version 5.12.5 perl5124delta Perl changes in version 5.12.4 perl5123delta Perl changes in version 5.12.3 perl5122delta Perl changes in version 5.12.2 perl5121delta Perl changes in version 5.12.1 perl5120delta Perl changes in version 5.12.0 perl5101delta Perl changes in version 5.10.1 perl5100delta Perl changes in version 5.10.0 perl589delta Perl changes in version 5.8.9 perl588delta Perl changes in version 5.8.8 perl587delta Perl changes in version 5.8.7 perl586delta Perl changes in version 5.8.6 perl585delta Perl changes in version 5.8.5 perl584delta Perl changes in version 5.8.4 perl583delta Perl changes in version 5.8.3 perl582delta Perl changes in version 5.8.2 perl581delta Perl changes in version 5.8.1 perl58delta Perl changes in version 5.8.0 perl561delta Perl changes in version 5.6.1 perl56delta Perl changes in version 5.6 perl5005delta Perl changes in version 5.005 perl5004delta Perl changes in version 5.004 perlexperiment A listing of experimental features in Perl perlartistic Perl Artistic License perlgpl GNU General Public License Language-Specific perlcn Perl for Simplified Chinese (in EUC-CN) perljp Perl for Japanese (in EUC-JP) perlko Perl for Korean (in EUC-KR) perltw Perl for Traditional Chinese (in Big5) Platform-Specific perlaix Perl notes for AIX perlamiga Perl notes for AmigaOS perlandroid Perl notes for Android perlbs2000 Perl notes for POSIX-BC BS2000 perlce Perl notes for WinCE perlcygwin Perl notes for Cygwin perldos Perl notes for DOS perlfreebsd Perl notes for FreeBSD perlhaiku Perl notes for Haiku perlhpux Perl notes for HP-UX perlhurd Perl notes for Hurd perlirix Perl notes for Irix perllinux Perl notes for Linux perlmacos Perl notes for Mac OS (Classic) perlmacosx Perl notes for Mac OS X perlnetware Perl notes for NetWare perlopenbsd Perl notes for OpenBSD perlos2 Perl notes for OS/2 perlos390 Perl notes for OS/390 perlos400 Perl notes for OS/400 perlplan9 Perl notes for Plan 9 perlqnx Perl notes for QNX perlriscos Perl notes for RISC OS perlsolaris Perl notes for Solaris perlsymbian Perl notes for Symbian perlsynology Perl notes for Synology perltru64 Perl notes for Tru64 perlvms Perl notes for VMS perlvos Perl notes for Stratus VOS perlwin32 Perl notes for Windows Stubs for Deleted Documents perlboot perlbot perlrepository perltodo perltooc perltoot On a Unix-like system, these documentation files will usually also be available as manpages for use with the man program. Some documentation is not available as man pages, so if a cross- reference is not found by man, try it with perldoc. Perldoc can also take you directly to documentation for functions (with the -f switch). See "perldoc --help" (or "perldoc perldoc" or "man perldoc") for other helpful options perldoc has to offer. In general, if something strange has gone wrong with your program and you're not sure where you should look for help, try making your code comply with use strict and use warnings. These will often point out exactly where the trouble is.
null
null
wish
Wish is a simple program consisting of the Tcl command language, the Tk toolkit, and a main program that reads commands from standard input or from a file. It creates a main window and then processes Tcl commands. If wish is invoked with arguments, then the first few arguments, ?-encoding name? ?fileName? specify the name of a script file, and, optionally, the encoding of the text data stored in that script file. A value for fileName is recognized if the appropriate argument does not start with “-”. If there are no arguments, or the arguments do not specify a fileName, then wish reads Tcl commands interactively from standard input. It will continue processing commands until all windows have been deleted or until end-of-file is reached on standard input. If there exists a file “.wishrc” in the home directory of the user, wish evaluates the file as a Tcl script just before reading the first command from standard input. If arguments to wish do specify a fileName, then fileName is treated as the name of a script file. Wish will evaluate the script in fileName (which presumably creates a user interface), then it will respond to events until all windows have been deleted. Commands will not be read from standard input. There is no automatic evaluation of “.wishrc” when the name of a script file is presented on the wish command line, but the script file can always source it if desired. Note that on Windows, the wishversion.exe program varies from the tclshversion.exe program in an additional important way: it does not connect to a standard Windows console and is instead a windowed program. Because of this, it additionally provides access to its own console command. OPTION PROCESSING Wish automatically processes all of the command-line options described in the OPTIONS summary above. Any other command-line arguments besides these are passed through to the application using the argc and argv variables described later. APPLICATION NAME AND CLASS The name of the application, which is used for purposes such as send commands, is taken from the -name option, if it is specified; otherwise it is taken from fileName, if it is specified, or from the command name by which wish was invoked. In the last two cases, if the name contains a “/” character, then only the characters after the last slash are used as the application name. The class of the application, which is used for purposes such as specifying options with a RESOURCE_MANAGER property or .Xdefaults file, is the same as its name except that the first letter is capitalized. VARIABLES Wish sets the following Tcl variables: argc Contains a count of the number of arg arguments (0 if none), not including the options described above. argv Contains a Tcl list whose elements are the arg arguments that follow a -- option or do not match any of the options described in OPTIONS above, in order, or an empty string if there are no such arguments. argv0 Contains fileName if it was specified. Otherwise, contains the name by which wish was invoked. geometry If the -geometry option is specified, wish copies its value into this variable. If the variable still exists after fileName has been evaluated, wish uses the value of the variable in a wm geometry command to set the main window's geometry. tcl_interactive Contains 1 if wish is reading commands interactively (fileName was not specified and standard input is a terminal-like device), 0 otherwise. SCRIPT FILES If you create a Tcl script in a file whose first line is #!/usr/local/bin/wish then you can invoke the script file directly from your shell if you mark it as executable. This assumes that wish has been installed in the default location in /usr/local/bin; if it is installed somewhere else then you will have to modify the above line to match. Many UNIX systems do not allow the #! line to exceed about 30 characters in length, so be sure that the wish executable can be accessed with a short file name. An even better approach is to start your script files with the following three lines: #!/bin/sh # the next line restarts using wish \ exec wish "$0" "$@" This approach has three advantages over the approach in the previous paragraph. First, the location of the wish binary does not have to be hard-wired into the script: it can be anywhere in your shell search path. Second, it gets around the 30-character file name limit in the previous approach. Third, this approach will work even if wish is itself a shell script (this is done on some systems in order to handle multiple architectures or operating systems: the wish script selects one of several binaries to run). The three lines cause both sh and wish to process the script, but the exec is only executed by sh. sh processes the script first; it treats the second line as a comment and executes the third line. The exec statement cause the shell to stop processing and instead to start up wish to reprocess the entire script. When wish starts up, it treats all three lines as comments, since the backslash at the end of the second line causes the third line to be treated as part of the comment on the second line. The end of a script file may be marked either by the physical end of the medium, or by the character, “\032” (“\u001a”, control-Z). If this character is present in the file, the wish application will read text up to but not including the character. An application that requires this character in the file may encode it as “\032”, “\x1a”, or “\u001a”; or may generate it by use of commands such as format or binary. PROMPTS When wish is invoked interactively it normally prompts for each command with “% ”. You can change the prompt by setting the variables tcl_prompt1 and tcl_prompt2. If variable tcl_prompt1 exists then it must consist of a Tcl script to output a prompt; instead of outputting a prompt wish will evaluate the script in tcl_prompt1. The variable tcl_prompt2 is used in a similar way when a newline is typed but the current command is not yet complete; if tcl_prompt2 is not set then no prompt is output for incomplete commands. KEYWORDS shell, toolkit Tk 8.0 wish(1)
wish - Simple windowing shell
wish ?-encoding name? ?fileName arg arg ...?
-encoding name Specifies the encoding of the text stored in │ fileName. This option is only recognized prior to │ the fileName argument. -colormap new Specifies that the window should have a new private colormap instead of using the default colormap for the screen. -display display Display (and screen) on which to display window. -geometry geometry Initial geometry to use for window. If this option is specified, its value is stored in the geometry global variable of the application's Tcl interpreter. -name name Use name as the title to be displayed in the window, and as the name of the interpreter for send commands. -sync Execute all X server commands synchronously, so that errors are reported immediately. This will result in much slower execution, but it is useful for debugging. -use id Specifies that the main window for the application is to be embedded in the window whose identifier is id, instead of being created as an independent toplevel window. Id must be specified in the same way as the value for the -use option for toplevel widgets (i.e. it has a form like that returned by the winfo id command). Note that on some platforms this will only work correctly if id refers to a Tk frame or toplevel that has its -container option enabled. -visual visual Specifies the visual to use for the window. Visual may have any of the forms supported by the Tk_GetVisual procedure. -- Pass all remaining arguments through to the script's argv variable without interpreting them. This provides a mechanism for passing arguments such as -name to a script instead of having wish interpret them. ______________________________________________________________________________
null
uname
The uname command writes the name of the operating system implementation to standard output. When options are specified, strings representing one or more system characteristics are written to standard output. The options are as follows: -a Behave as though the options -m, -n, -r, -s, and -v were specified. -m Write the type of the current hardware platform to standard output. (make(1) uses it to set the MACHINE variable.) -n Write the name of the system to standard output. -o This is a synonym for the -s option, for compatibility with other systems. -p Write the type of the machine processor architecture to standard output. (make(1) uses it to set the MACHINE_ARCH variable.) -r Write the current release level of the operating system to standard output. -s Write the name of the operating system implementation to standard output. -v Write the version level of this release of the operating system to standard output. If the -a flag is specified, or multiple flags are specified, all output is written on a single line, separated by spaces. ENVIRONMENT An environment variable composed of the string UNAME_ followed by any flag to the uname utility (except for -a) will allow the corresponding data to be set to the contents of the environment variable. The -m, -n, -r, -s, and -v variables additionally have long aliases that have historically been honored on MacOS, “UNAME_MACHINE”, “UNAME_NODENAME”, “UNAME_RELEASE”, “UNAME_SYSNAME”, and “UNAME_VERSION” respectively. These names have a higher priority than their shorter counterparts described in the previous paragraph. See uname(3) for more information. EXIT STATUS The uname utility exits 0 on success, and >0 if an error occurs.
uname – display information about the system
uname [-amnoprsv]
null
The hardware platform (-m) can be different from the machine's processor architecture (-p), e.g., on 64-bit PowerPC, -m would return powerpc and -p would return powerpc64. SEE ALSO hostname(1), machine(1), sw_vers(1), sysctl(3), uname(3), sysctl(8) STANDARDS The uname command is expected to conform to the IEEE Std 1003.2 (“POSIX.2”) specification. HISTORY The uname command appeared in PWB UNIX 1.0, however 4.4BSD was the first Berkeley release with the uname command. The -K and -U extension flags appeared in FreeBSD 10.0. The -b extension flag appeared in FreeBSD 13.0. macOS 14.5 November 13, 2020 macOS 14.5
hpmdiagnose
Use hpmdiagnose to collect diagnostic information to help with investigation of USB-C issues. macOS December 6, 2016 macOS
hpmdiagnose - collects diagnostic information to help troubleshoot USB-C issues.
hpmdiagnose
null
null
timer_analyser.d
null
null
null
null
null
jstack
The jstack command prints Java stack traces of Java threads for a specified Java process. For each Java frame, the full class name, method name, byte code index (BCI), and line number, when available, are printed. C++ mangled names aren't demangled. To demangle C++ names, the output of this command can be piped to c++filt. When the specified process is running on a 64-bit JVM, you might need to specify the -J-d64 option, for example: jstack -J-d64 pid. Note: This command is unsupported and might not be available in future releases of the JDK. In Windows Systems where the dbgeng.dll file isn't present, the Debugging Tools for Windows must be installed so that these tools work. The PATH environment variable needs to contain the location of the jvm.dll that is used by the target process, or the location from which the core dump file was produced. OPTIONS FOR THE JSTACK COMMAND -l The long listing option prints additional information about locks. -h or -help Prints a help message. JDK 22 2024 JSTACK(1)
jstack - print Java stack traces of Java threads for a specified Java process
Note: This command is experimental and unsupported. jstack [options] pid
This represents the jstack command-line options. See Options for the jstack Command. pid The process ID for which the stack trace is printed. The process must be a Java process. To get a list of Java processes running on a machine, use either the ps command or, if the JVM processes are not running in a separate docker instance, the jps command.
null
parl
This stand-alone command offers roughly the same feature as "perl -MPAR", except that it takes the pre-loaded .par files via "-Afoo.par" instead of "-MPAR=foo.par". Additionally, it lets you convert a CPAN distribution to a PAR distribution, as well as manipulate such distributions. For more information about PAR distributions, see PAR::Dist. You can use it to run .par files: # runs script/run.pl in archive, uses its lib/* as libraries % parl myapp.par run.pl # runs run.pl or script/run.pl in myapp.par % parl otherapp.pl # also runs normal perl scripts However, if the .par archive contains either main.pl or script/main.pl, it is used instead: % parl myapp.par run.pl # runs main.pl, with 'run.pl' as @ARGV Finally, the "-O" option makes a stand-alone binary executable from a PAR file: % parl -B -Omyapp myapp.par % ./myapp # run it anywhere without perl binaries With the "--par-options" flag, generated binaries can act as "parl" to pack new binaries: % ./myapp --par-options -Omyap2 myapp.par # identical to ./myapp % ./myapp --par-options -Omyap3 myap3.par # now with different PAR For an explanation of stand-alone executable format, please see par.pl. SEE ALSO PAR, PAR::Dist, par.pl, pp AUTHORS Audrey Tang <cpan@audreyt.org> You can write to the mailing list at <par@perl.org>, or send an empty mail to <par-subscribe@perl.org> to participate in the discussion. Please submit bug reports to <bug-par-packer@rt.cpan.org>. COPYRIGHT Copyright 2002-2009 by Audrey Tang <cpan@audreyt.org>. Neither this program nor the associated pp program impose any licensing restrictions on files generated by their execution, in accordance with the 8th article of the Artistic License: "Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package." Therefore, you are absolutely free to place any license on the resulting executable, as long as the packed 3rd-party libraries are also available under the Artistic License. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See LICENSE. perl v5.34.0 2020-03-08 PARL(1)
parl - Binary PAR Loader
(Please see pp for convenient ways to make self-contained executables, scripts or PAR archives from perl programs.) To make a PAR distribution from a CPAN module distribution: % parl -p # make a PAR dist under the current path % parl -p Foo-0.01 # assume unpacked CPAN dist in Foo-0.01/ To manipulate a PAR distribution: % parl -i Foo-0.01-i386-freebsd-5.8.0.par # install % parl -i http://foo.com/Foo-0.01 # auto-appends archname + perlver % parl -i cpan://AUTRIJUS/PAR-0.74 # uses CPAN author directory % parl -u Foo-0.01-i386-freebsd-5.8.0.par # uninstall % parl -s Foo-0.01-i386-freebsd-5.8.0.par # sign % parl -v Foo-0.01-i386-freebsd-5.8.0.par # verify To use Hello.pm from ./foo.par: % parl -A./foo.par -MHello % parl -A./foo -MHello # the .par part is optional Same thing, but search foo.par in the @INC; % parl -Ifoo.par -MHello % parl -Ifoo -MHello # ditto Run test.pl or script/test.pl from foo.par: % parl foo.par test.pl # looks for 'main.pl' by default, # otherwise run 'test.pl' To make a self-containing executable containing a PAR file : % parl -O./foo foo.par % ./foo test.pl # same as above To embed the necessary non-core modules and shared objects for PAR's execution (like "Zlib", "IO", "Cwd", etc), use the -b flag: % parl -b -O./foo foo.par % ./foo test.pl # runs anywhere with core modules installed If you also wish to embed core modules along, use the -B flag instead: % parl -B -O./foo foo.par % ./foo test.pl # runs anywhere with the perl interpreter This is particularly useful when making stand-alone binary executables; see pp for details.
null
null