summaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAgeFilesLines
* doc: time zone conversion examplePaul Eggert2023-05-071-0/+10
| | | | | * doc/coreutils.texi (Examples of date): Give time zone conversion example.
* doc: new subsection for date format specsPaul Eggert2023-05-071-12/+19
| | | | | | * doc/coreutils.texi (Date format specifiers): New subsection, which groups the date format specifiers without otherwise changing contents.
* doc: provide more info on the default 32-bit cksum digestPádraig Brady2023-04-301-3/+7
| | | | | * doc/coreutils.texi (cksum invocation): Say that the default digest format is 32-bit and based on the Ethernet standard CRC.
* cp,mv: add --update=none to always skip existing filesPádraig Brady2023-04-081-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Add --update=none which is equivalent to the --no-clobber behavior from before coreutils 9.2. I.e. existing files are unconditionally skipped, and them not being replaced does not affect the exit status. * src/copy.h [enum Update_type]: A new type to support parameters to the --update command line option. [enum Interactive]: Add I_ALWAYS_SKIP. * src/copy.c: Treat I_ALWAYS_SKIP like I_ALWAYS_NO (-n), except that we don't fail when skipping. * src/system.h (emit_update_parameters_note): A new function to output the description of the new --update parameters. * src/cp.c (main): Parse --update arguments, ensuring that -n takes precedence if specified. (usage): Describe the new option. Also allude that -u is related in the -n description. * src/mv.c: Accept the new --update parameters and update usage() accordingly. * doc/coreutils.texi (cp invocation): Describe the new --update parameters. Also reference --update from the --no-clobber description. (mv invocation): Likewise. * tests/mv/update.sh: Test the new parameters. * NEWS: Mention the new feature. Addresses https://bugs.gnu.org/62572
* split: support split -n on larger pipe inputPaul Eggert2023-03-071-2/+4
| | | | | | | | | * bootstrap.conf (gnulib_modules): Add free-posix, tmpfile. * src/split.c (copy_to_tmpfile): New function. (input_file_size): Use it to split larger files when sizes cannot easily be determined via fstat or lseek. See Bug#61386#235. * tests/split/l-chunk.sh: Mark tests of /dev/zero as very expensive since they exhaust /tmp.
* du: --apparent counts only symlinks and regularPaul Eggert2023-03-041-0/+3
| | | | | | | | Problem reported by Christoph Anton Mitterer (Bug#61884). * src/du.c (process_file): When counting apparent sizes, count only usable st_size members. * tests/du/apparent.sh: New file. * tests/local.mk (all_root_tests): Add it.
* split: split more evenly with -nPaul Eggert2023-03-041-4/+4
| | | | | | | | * src/split.c (bytes_split): New arg REM_BYTES. Use this to split more evenly. All callers changed. (lines_chunk_split, bytes_chunk_extract): Be consistent with new byte_split. * tests/split/b-chunk.sh, tests/split/l-chunk.sh: Test new behavior.
* doc: tee -p: clarify operationPádraig Brady2023-02-281-3/+3
| | | | | | | | | | * src/tee.c (usage): Change from describing one (non pipe) aspect to the more general point of being the option to use if working with pipes, and referencing the more detailed info below. * doc/coreutils.texi (tee invocation): s/standard/appropriate/ since the standard operation with pipes is to exit immediately upon write error. s/early/immediately/ as it's ambiguous as to what "early" is in relation to.
* tee: enhance -p mode using iopoll() to detect broken pipe outputsCarl Edquist2023-02-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If input is intermittent (a tty, pipe, or socket), and all remaining outputs are pipes (eg, >(cmd) process substitutions), exit early when they have all become broken pipes (and thus future writes will fail), without waiting for more input to become available, as future write attempts to these outputs will fail (SIGPIPE/EPIPE). Only provide this enhancement when pipe errors are ignored (-p mode). Note that only one output needs to be monitored at a time with iopoll(), as we only want to exit early if _all_ outputs have been removed. * src/tee.c (pipe_check): New global for iopoll mode. (main): enable pipe_check for -p, as long as output_error ignores EPIPE, and input is suitable for iopoll(). (get_next_out): Helper function for finding next valid output. (fail_output, tee_files): Break out write failure/output removal logic to helper function. (tee_files): Add out_pollable array to track which outputs are suitable for iopoll() (ie, that are pipes); track first output index that is still valid; add iopoll() broken pipe detection before calling read(), removing an output that becomes a broken pipe. * src/local.mk (src_tee_SOURCES): include src/iopoll.c. * NEWS: Mention tee -p enhancement in Improvements. * doc/coreutils.texi: Mention the new early exit behavior in the nopipe modes for the tee -p option. Suggested-by: Arsen Arsenović <arsen@aarsen.me>
* cp,install,mv: add --debug to explain how a file is copiedPádraig Brady2023-02-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How a file is copied is dependent on the sparseness of the file, what file system it is on, what file system the destination is on, the attributes of the file, and whether they're being copied or not. Also the --reflink and --sparse options directly impact the operation. Given it's hard to reason about the combination of all of the above, the --debug option is useful for users to directly identify if copy offloading, reflinking, or sparse detection are being used. It will also be useful for tests to directly query if these operations are supported. The new output looks as follows: $ src/cp --debug src/cp file.sparse 'src/cp' -> 'file.sparse' copy offload: yes, reflink: unsupported, sparse detection: no $ truncate -s+1M file.sparse $ src/cp --debug file.sparse file.sparse.cp 'file.sparse' -> 'file.sparse.cp' copy offload: yes, reflink: unsupported, sparse detection: SEEK_HOLE $ src/cp --reflink=never --debug file.sparse file.sparse.cp 'file.sparse' -> 'file.sparse.cp' copy offload: avoided, reflink: no, sparse detection: SEEK_HOLE * doc/coreutils.texi (cp invocation): Describe the --debug option. (mv invocation): Likewise. (install invocation): Likewise. * src/copy.h: Add a new DEBUG member to cp_options, to control whether to output debug info or not. * src/copy.c (copy_debug): A new global structure to unconditionally store debug into from the last copy_reg operations. (copy_debug_string, emit_debug): New functions to print debug info. * src/cp.c: if ("--debug") x->debug=true; * src/install.c: Likewise. * src/mv.c: Likewise. * tests/cp/debug.sh: Add a new test. * tests/local.mk: Reference the new test. * NEWS: Mention the new feature.
* doc: fix some spelling mistakesChuanGang Jiang2023-02-211-5/+5
| | | | | | | | | | * doc/coreutils.texi: s/functionalty/functionality/, s/sychronize/synchronize/, s/millsecond/millisecond/ s/paramter/parameters/ * init.cfg: s/parmeters/parameters/ * scripts/build-older-versions/README.older-versions: s/vesion/version/ * tests/misc/env-S-script.sh: s/paramaters/parameters/ Fixes https://bugs.gnu.org/61681
* cksum: add --raw option to output a binary digestPádraig Brady2023-02-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | --raw output is the most composable format, and also is a robust way to discard the file name without parsing (escaped) output. Examples: $ cksum --raw -a crc "$afile" | basenc --base16 4ACFC4F0 $ cksum --raw -a crc "$afile" | basenc --base2msbf 01001010110011111100010011110000 $ cksum --raw -a sha256 "$bfile" | basenc --base32 AAAAAAAADHLGRHAILLQWLAY6SNH7OY5OI2RKNQLSWPY3MCUM4JXQ==== * doc/coreutils.texi (cksum invocation): Describe the new feature. * src/digest.c (output_file): Inspect the new RAW_DIGEST global, and output the bytes directly if set. * src/cksum.c (output_crc): Likewise. * src/sum.c (output_bsd, output_sysv): Likewise. * tests/misc/cksum-raw.sh: A new test. * tests/local.mk: Reference the new test. * NEWS: Mention the new feature.
* cksum: accept new option: --base64 (-b)Jim Meyering2023-01-311-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/digest.c [HASH_ALGO_CKSUM]: Include "base64.h" [HASH_ALGO_CKSUM] (base64_digest): New global. [HASH_ALGO_CKSUM] (enum BASE64_DIGEST_OPTION): New enum. [HASH_ALGO_CKSUM] (long_options): Add "base64". (valid_digits): Rename from hex_digits, now taking an input length argument. Adjust callers. (bsd_split_3): Rename arg from hex_digits to digest. Add new *d_len parameter for length of extracted digest. Move "i" declaration down to first use. (split_3): Rename arg from hex_digits to digest. Add new *d_len parameter for length of extracted digest. Instead of relying on "known" length of digest to find the following must-be-whitespace byte, search for the first whitespace byte. [HASH_ALGO_CKSUM] (output_file): Handle base64_digest. [HASH_ALGO_CKSUM] (main): Set base64_digest. [HASH_ALGO_CKSUM] (b64_equal): New function. (hex_equal): New function, factored out of digest_check. (digest_check) Factored part into b64_equal and hex_equal. Rename local hex_digest to digest. * tests/misc/cksum-base64.pl: Add tests. * tests/local.mk (all_tests): Add to the list. * cfg.mk (_cksum): Define. (exclude_file_name_regexp--sc_prohibit_test_backticks): Exempt new test. (exclude_file_name_regexp--sc_long_lines): Likewise. * doc/coreutils.texi (cksum invocation): Document it. (md5sum invocation) [--check]: Mention digest encoding auto-detect. * NEWS (New Features): Mention this.
* doc: document --preserve=mode betterPaul Eggert2023-01-311-1/+8
| | | | * doc/coreutils.texi: Spruce up cp --preserve=mode doc.
* cp,mv: skipping due to -u is success, not failurePaul Eggert2023-01-311-3/+4
| | | | | | | | | | This reverts the previous change, so that when a file is skipped due to -u, this is not considered a failure. * doc/coreutils.texi: Document this. * src/copy.c (copy_internal): If --update says to skip, treat this as success instead of failure. * tests/mv/update.sh, tests/cp/slink-2-slink.sh: Revert previous change, to match reverted behavior.
* cp,ln,mv: when skipping exit with nonzero statusPaul Eggert2023-01-311-11/+13
| | | | | | | | | | | * NEWS, doc/coreutils.texi: Document this. * src/copy.c (copy_internal): * src/ln.c (do_link): Return false when skipping action due to --interactive or --no-clobber. * tests/cp/cp-i.sh, tests/cp/preserve-link.sh: * tests/cp/slink-2-slink.sh, tests/mv/i-1.pl, tests/mv/i-5.sh: * tests/mv/mv-n.sh, tests/mv/update.sh: Adjust expectations of exit status to match revised behavior.
* mv: new option --no-copyPaul Eggert2023-01-271-12/+15
| | | | | | | | | | | Wishlist item from Mike Frysinger (Bug#61050). * src/copy.c (copy_internal): Do not fall back on copying if x->no_copy. * src/copy.h (struct cp_options): New member no_copy. * src/mv.c (NO_COPY_OPTION): New constant. (long_options, usage, main): Support --no-copy. * tests/mv/no-copy.sh: New test. * tests/local.mk (all_tests): Add it.
* all: further adjustments for new Ronna, Quetta SI prefixesPádraig Brady2023-01-061-0/+7
| | | | | | | | | | | | | | * src/dd.c (parse_integer): Support Q,R suffixes. * src/od.c (main): Likewise. * src/split.c (main): Likewise. * src/stdbuf.c (parse_size): Likewise. * src/truncate.c (main): Likewise. * src/sort.c (specify_size_size): Likewise. Also line length syntax check fix. * tests/misc/numfmt.pl: Adust top end large number checks to the new largest values. * doc/coreutils.texi (numfmt invocation): Add a numfmt example. * NEWS: Tweak to aid searchability.
* numfmt: add support for new SI prefixesPaul Eggert2023-01-051-10/+31
| | | | | | | | | | | | | | | | | | | | | * src/dd, src/head.c, src/od.c, src/sort.c, src/stdbuf.c, src/tail.c: (usage): * src/system.h (emit_size_note): Mention new SI prefixes. * src/du.c (main): * src/head.c (head_file): * src/numfmt.c (suffix_power, suffix_power_char, prepare_padded_number): * src/shred.c (main): * src/sort.c (unit_order): * src/tail.c (parse_options): Support new SI prefixes. * src/numfmt.c (MAX_ACCEPTABLE_DIGITS): Increase to 33. (zero_and_valid_suffixes, valid_suffixes): New constants, with new SI prefixes. (valid_suffix, unit_to_umax): Use them. (prepare_padded_number): Diagnose "999Q" instead of "999Y". * tests/misc/numfmt.pl, tests/misc/sort.pl: Adjust tests to match new max.
* maint: update all copyright year number rangesPádraig Brady2023-01-014-4/+4
| | | | | | | | | | Update to latest gnulib with new copyright year. Run "make update-copyright" and then... * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Manually update copyright year, until we fully sync with gnulib at a later stage. * tests/sample-test: Adjust to use the single most recent year.
* doc: improve doc of du with CoW etcPaul Eggert2022-12-261-10/+38
| | | | | Problem reported by Krzysztof Żelechowski (Bug#60335). * doc/coreutils.texi (du invocation): Reword.
* doc: improve du --threshold wordingPaul Eggert2022-12-261-7/+4
| | | | * doc/coreutils.texi (du invocation): Reword.
* doc: timezone -> time zonePaul Eggert2022-12-061-1/+1
|
* doc: improve date -I docPaul Eggert2022-12-051-9/+12
| | | | | | Suggested by Marc Chantreux (bug#59827). * doc/coreutils.texi (Options for date): Give formats for -I, like we already do for --rfc-3339.
* doc: tee: make -p decription more completePádraig Brady2022-11-291-2/+8
| | | | | | * doc/coreutils.texi (tee invocation): Give a more cohesive description of the -p option, and how it differs from the default operation.
* doc: more dash fixesPaul Eggert2022-11-152-76/+78
| | | | | | | | * doc/coreutils.texi, doc/sort-version.texi: Prefer on "x -- y" to "x---y" in prose, as the result is more readable in Emacs. Fix some instances of unescaped ‘-’ that should be minus, not hyphen. Fix some other instances that should be en dash. No spaces around en dash when it’s a range.
* maint: avoid misquoting of some --long-options in texiPádraig Brady2022-11-151-80/+86
| | | | | | | | * cfg.mk (sc_texi_long_option_escaped): A new check to avoid future instances of this. * doc/coreutils.texi (Common options): Rearrange this menu to be less repetitive in each description, and avoid long lines. Addresses https://bugs.gnu.org/59262
* doc: fix markupPaul Eggert2022-11-141-28/+28
| | | | | | | Problem reported by Antonio Diaz Diaz (bug#59262). * doc/coreutils.texi: Use markup in menus to prevent ‘--’ from turning into an em dash, and to be more consistent.
* doc: printf: make "java" encoding example more standardPádraig Brady2022-10-281-2/+2
| | | | | | | | | | | Note using iconv(1) rather than recode(1) is not appropriate for this example, as the required functionality is only available on libiconv's iconv implementation, which is not installed on most systems. * doc/coreutils.texi (printf invocation): Use env rather than /usr/local/bin for the printf command. Escape '%' so more robust. Also use a locale that exists on modern systems.
* doc: move description of printf options to better locationPádraig Brady2022-10-281-4/+4
| | | | | * doc/coreutils.texi (printf invocation): Move the description of accepted options from the middle of the unicode discussion.
* printf: with \U, support all valid unicode pointsPádraig Brady2022-10-281-7/+7
| | | | | | | | | | | | | Previously this was restricted to the C99 universal character subset, which restricted most values <= 0x9F, as that simplifies the C lexer. However printf(1) doesn't need this restriction. Note also the bash builtin printf already supports all values <= 0x9F. * src/printf.c (main): Relax the restriction on points <= 0x9F. * doc/coreutils.texi (printf invocation): Adjust description. * tests/misc/printf-cov.pl: Adjust accordingly. Add new cases. * NEWS: Mention the change in behavior. Reported at https://bugs.debian.org/1022857
* doc: basenc: reference from base{32,64} docsPádraig Brady2022-10-261-0/+3
| | | | | | | | * doc/coreutils.texi (base32 invocation): Reference basenc to improve discoverability. (base64 invocation): Likewise. * man/base32.x: Likewise. * man/base64.x: Likewise.
* doc: sort: mention --version useful for IPv4 addressesPádraig Brady2022-09-301-2/+4
| | | | | | | * doc/coreutils.texi (sort invocation): Mention in the multi invocation sort example that the -V GNU extension could be used to sort IPv4 addresses, and thus simplify to a single invocation.
* doc: be more consistent when documenting exit statusPádraig Brady2022-09-281-4/+8
| | | | | | | | | | | | | | | | | * src/system.h (emit_exec_status): A new function to output standard "Exit status:" info for commands that exec others. * doc/coreutils.texi (Exit status): Add "ls" and "runcon" to the list of commands with non standard exit status. * src/numfmt.c (main): Call initialize_exit_failure() explicitly to better indicate this utility may exit with something other than EXIT_FAILURE. * src/timeout.c (usage): Use more consistent capitalization. * src/chroot.c: Call emit_exec_status(). * src/env.c: Likewise. * src/nice.c: Likewise. * src/nohup.c: Likewise. * src/runcon.c: Likewise. * src/stdbuf.c: Likewise.
* wc: add --total={auto,never,always,only} optionPádraig Brady2022-09-261-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | without this option, control of when the total is output is quite awkward. Consider trying to suppress the total line, which could be achieved with something like: wc-no-total() { wc "$@" /dev/null | head -n-2; } As well as being non obvious, it's also non general. It would give a non failure, but zero count if passed a file on stdin. Also it doesn't work in conjunction with the --files0-from option, which would need to be handled differently with something like: { find files -print0; printf '%s\0' /dev/null; } | wc --files0-from=- | head -n2 Also getting just the total can be awkward as file names are only suppressed when processing stdin, and also a total line is only printed if processing more than one file. For completness this might be achieved currently with: wc-only-total() { wc "$@" | tail -n1 | sed 's/^ *//; s/ [^ 0-9]*$//' } * src/wc.c: Add new --total option. * tests/misc/wc-total.sh: New test suite for the new option. * tests/local.mk: Reference the new test. * doc/coreutils.texi (wc invocation): Document the new option. * THANKS.in: Add suggestor. * NEWS: Mention the new feature.
* doc: fix typo in previous changePaul Eggert2022-09-201-1/+1
|
* doc: warn about tabs command (bug#57946)Paul Eggert2022-09-201-0/+9
|
* all: prefer HTTPS to HTTPStefan Kangas2022-09-181-2/+2
| | | | | | | | | | | | | | | * README-hacking: * README-prereq: * THANKS.in: * doc/sort-version.texi (Other version/natural sort implementations): * gl/lib/rand-isaac.c: * gl/tests/test-rand-isaac.c: * src/operand2sig.c (operand2sig): * src/remove.c (nonexistent_file_errno): * tests/misc/env-signal-handler.sh: * tests/misc/sort-debug-warn.sh (LC_ALL): Prefer HTTPS to HTTP. Addresses https://bugs.gnu.org/56512 Copyright-paperwork-exempt: yes
* doc: shred: minor fixÁlvar Ibeas2022-09-131-1/+1
| | | | | | * doc/coreutils.texi: Fix wording. Copyright-paperwork-exempt: yes
* doc: stty: clarify that [-]drain is treated as an optionPádraig Brady2022-08-311-0/+2
| | | | | | | * doc/coreutils.texi (stty invocation): Say that "drain" is treated as an option, rather than a line setting, and so option processing rules apply to it. Reported in https://bugs.debian.org/1018803
* comm: fix NUL --output-delimiter with --totalPádraig Brady2022-08-271-1/+2
| | | | | | | | | | | * src/comm.c (compare_files): Handle the single character --output-delimeter case separately so that NUL is appropriately handled. * doc/coreutils.texi (comm invocation): Fix the description of --output-delimiter to say an empty delimeter is treated as a NUL separator, rather than being disallowed. * tests/misc/comm.pl: Add a test case. Reported at https://bugs.debian.org/1014008
* runcon: distinguish runcon specific errors in exit statusPádraig Brady2022-08-271-1/+2
| | | | | | | | | * src/runcon.c: Use EXIT_CANCELED (125) instead of EXIT_FAILURE (1), so that errors specific to runcon can be distinguished, from those of the invoked program. * doc/coreutils.texi (runcon invocation): Fix the Exit status description to say we return 125 (not 127) for internal errors. * tests/misc/runcon-no-reorder.sh: Add a test case.
* ls: support explicit --time=modification selectionPádraig Brady2022-08-131-0/+11
| | | | | | | | * src/ls.c [time_args]: Add support for explicit 'mtime' or 'modification' arguments to --time. * tests/misc/ls-time.sh: Add explicit --time=mtime usage. * doc/coreutils.texi (ls invocation): Describe --time=mtime. * NEWS: Mention the new feature.
* doc: ls: clarify description of timestampsPádraig Brady2022-08-121-1/+2
| | | | | | | | | * src/ls.c (usage): Don't mention "modification" in the description of ctime (-c), as it's confusing with mtime. Mention "metadata" when discussing "change" time to disambiguate from data change time. * doc/coreutils.texi (ls invocation): State that --time=creation falls back to using mtime where not available.
* doc: cp: fix --reflink=when typo in texinfoPierre Marsais2022-08-011-1/+1
| | | | | | | | This behaviour is correctly documented when doing `cp --help`. There is no `--reflink=when` option. * doc/coreutils.texi (cp invocation): Fix document stating that `--reflink` is equivalent to `--reflink=always`.
* doc: uniq: clarify -f operationPádraig Brady2022-08-011-3/+4
| | | | | * doc/coreutils.texi (uniq invocation): State that leading blanks are part of the field, and also that -f is one based.
* doc: env: clarify that empty signal args are ignoredPádraig Brady2022-07-261-7/+9
| | | | | | | | | | | | | | | | | It's useful to treat empty and missing arguments differently. Missing means all signals, while empty means no signals and so is a no-op. It's useful to treat empty arguments like this, so that dynamically specified arguments like the following are supported env --ignore-signals "$SIGS_TO_IGNORE" Note `env --ignore-signals=` is treated as an empty argument. * doc/coreutils.texi (env invocation): Empty args are treated differently to missing arguments, so call that out explicitly. * src/env.c (usage): Likewise. Addresses https://bugs.debian.org/1016049
* doc: date: clarify which options are mutually exclusivePádraig Brady2022-07-241-0/+4
| | | | | | | | * src/date.c (usage): Specify that --date, --file, --reference, and --resolution are mutually exclusive. This is also useful documentation to group similar options. * doc/coreutils.texi (Options for date): Likewise. Addresses https://bugs.gnu.org/55401
* dd: doc improvement (Bug#54586)Paul Eggert2022-07-061-2/+11
| | | | | * doc/coreutils.texi (dd invocation): Explain fdatasync and fsync better.
* build: update gnulib submodule to latestPaul Eggert2022-06-031-0/+2
| | | | | * bootstrap: Copy from latest Gnulib. * tests/misc/ls-misc.pl (v_files): Adjust to new Gnulib behavior.