uutils Coreutils Documentation
uutils is an attempt at writing universal (as in cross-platform) CLI utilities in Rust. It is available for Linux, Windows, Mac and other platforms.
The API reference for uucore, the library of functions shared between various
utils, is hosted at docs.rs.
uutils is licensed under the MIT License.
Useful links
Note: This manual is automatically generated from the source code and is a work in progress.
Installation
This is a list of uutils packages in various distributions and package managers. Note that these are packaged by third-parties and the packages might contain patches.
You can also build uutils from source.
Cargo
# Unix like
cargo install coreutils --features unix --locked
# Windows
cargo install coreutils --features windows --locked
Linux
Alpine
apk update uutils-coreutils
Note: Requires the
edgerepository.
Arch
pacman -S uutils-coreutils
Debian
apt install rust-coreutils
# To use it:
export PATH=/usr/lib/cargo/bin/coreutils:$PATH
Fedora
dnf install uutils-coreutils
# To use it:
export PATH=/usr/libexec/uutils-coreutils:$PATH
Gentoo
emerge -pv sys-apps/uutils-coreutils
Manjaro
pacman -S uutils-coreutils
# or
pamac install uutils-coreutils
NixOS
nix-env -iA nixos.uutils-coreutils
OpenMandriva Lx
dnf install uutils-coreutils
RHEL/AlmaLinux/CENTOS Stream/Rocky Linux/EPEL 9
# Install EPEL 9 - Specific For RHEL please check codeready-builder-for-rhel-9 First then install epel
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
# Install Core Utils
dnf install uutils-coreutils
# To use it:
export PATH=/usr/libexec/uutils-coreutils:$PATH
Ubuntu
apt install rust-coreutils
# To use it:
export PATH=/usr/lib/cargo/bin/coreutils:$PATH
AUR
Build main branch from source or Binaries from main branch
git clone https://aur.archlinux.org/uutils-coreutils-git --depth=1
cd uutils-coreutils-git
makepkg -si
MacOS
Homebrew
brew install uutils-coreutils
MacPorts
port install coreutils-uutils
FreeBSD
pkg install rust-coreutils
Windows
Winget
winget install uutils.coreutils
Scoop
scoop install uutils-coreutils
MSYS2
MSYS2 package (Windows native)
Alternative installers
Conda
conda install -c conda-forge uutils-coreutils
Yocto
The uutils-coreutils recipe is provided as part of the meta-openembedded yocto layer.
Clone poky and meta-openembedded, add
meta-openembedded/meta-oe as layer in your build/conf/bblayers.conf file,
and then either call bitbake uutils-coreutils, or use
PREFERRED_PROVIDER_coreutils = "uutils-coreutils" in your build/conf/local.conf file and
then build your usual yocto image.
Build from source
Building
There are currently two methods to build the uutils binaries: either Cargo or GNU Make.
Building the full package, including all documentation, requires both Cargo and GNU Make on a Unix platform.
For either method, we first need to fetch the repository:
git clone https://github.com/uutils/coreutils
cd coreutils
Cargo
Building uutils using Cargo is easy because the process is the same as for every other Rust program:
cargo build --release
Replace --release with --profile=release-small to optimize binary size.
This command builds the most portable common core set of uutils into a multicall (BusyBox-type) binary, named ‘coreutils’, on most Rust-supported platforms.
Additional platform-specific uutils are often available. Building these expanded sets of uutils for a platform (on that platform) is as simple as specifying it as a feature:
cargo build --release --features windows
# or ...
cargo build --release --features unix
# or ...
cargo build --release --target wasm32-wasip1 --no-default-features --features feat_wasm
To build SELinux-specific features, including chcon and runcon, ensure that libselinux
and libclang are installed on your system. Then, run the following command:
cargo build --release --features unix,feat_selinux
To speed up the checksum utilities (md5sum, sha1sum, sha224sum, sha256sum,
sha384sum, sha512sum, and cksum) by using OpenSSL’s libcrypto instead of
the pure-Rust digest crates, enable the openssl feature:
cargo build --release --features openssl
By default OpenSSL is built from source and statically linked into the
binary, so no runtime dependency on system libcrypto/libssl is added. To link
against the system libcrypto instead, set OPENSSL_NO_VENDOR=1 at build time.
If both static and dynamic libcrypto are installed, also set OPENSSL_STATIC=0 to link dynamically.
The speedup is largest on CPUs without SHA-NI hardware acceleration.
aws-lc backend is used on MSVC. Setting AWS_LC_SYS_NO_JITTER_ENTROPY=1
at build time is recommended to reduce size of binary.
If you don’t want to build every utility available on your platform into the final binary, you can also specify which ones you want to build manually. For example:
cargo build --features "base32 cat echo rm" --no-default-features
If you want to build the utilities as individual binaries, that is also possible:
cargo build --release --bins --workspace --exclude coreutils --exclude uu_runcon --exclude uu_chcon
Each utility is contained in its own package within the main repository, named “uu_UTILNAME”. To
build selected individual utilities, use the --package [aka -p] option. For example:
cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rm
GNU Make
Building using make is a simple process as well.
To simply build all available utilities (with debug profile):
make
In release mode:
make PROFILE=release
To build all but a few of the available utilities:
make SKIP_UTILS='UTILITY_1 UTILITY_2'
To build only a few of the available utilities:
make UTILS='UTILITY_1 UTILITY_2'
Installation
Install with Cargo
Likewise, installing can simply be done using:
cargo install --path . --locked
This command will install uutils into Cargo’s bin folder (e.g.
$HOME/.cargo/bin).
This does not install files necessary for shell completion or manpages. For
manpages or shell completion to work, use GNU Make or see
Manually install shell completions/Manually install manpages.
Install with GNU Make
To install all available utilities (PROFILE=release by default):
make install
To install using sudo switch -E must be used:
sudo -E make install
To install all but a few of the available utilities:
make SKIP_UTILS='UTILITY_1 UTILITY_2' install
To install only a few of the available utilities:
make UTILS='UTILITY_1 UTILITY_2' install
To install every program with a prefix (e.g. uu-echo uu-cat):
make PROG_PREFIX=uu- install
To install the multicall binary:
make MULTICALL=y install
Set install parent directory (default value is /usr/local):
# DESTDIR is also supported
make PREFIX=/my/path install
Installing with make installs shell completions for all installed utilities
for bash, fish and zsh. Completions for elvish and powershell can also
be generated; See Manually install shell completions.
To skip installation of completions and manpages:
make COMPLETIONS=n MANPAGES=n install
Manually install shell completions
The uudoc binary generates completions for the bash, elvish,
fish, powershell and zsh shells to stdout.
Install uudoc by
cargo install --bin uudoc --features uudoc --path .
Then use the installed binary:
uudoc completion <utility> <shell>
So, to install completions for ls on bash to
/usr/local/share/bash-completion/completions/ls, run:
uudoc completion ls bash > /usr/local/share/bash-completion/completions/ls.bash
Completion for prefixed cp with uu- on zsh is generated by
env PROG_PREFIX=uu- uudoc completion cp zsh
Manually install manpages
To generate manpages, the syntax is:
uudoc manpage <utility>
So, to install the manpage for ls to /usr/local/share/man/man1/ls.1 run:
uudoc manpage ls > /usr/local/share/man/man1/ls.1
Un-installation
Un-installation differs depending on how you have installed uutils. If you used Cargo to install, use Cargo to uninstall. If you used GNU Make to install, use Make to uninstall.
Uninstall with Cargo
To uninstall uutils:
cargo uninstall coreutils
Uninstall with GNU Make
To uninstall all utilities:
make uninstall
To uninstall every program with a set prefix:
make PROG_PREFIX=uu- uninstall
To uninstall the multicall binary:
make MULTICALL=y uninstall
To uninstall from a custom parent directory:
# DESTDIR is also supported
make PREFIX=/my/path uninstall
Platform support
uutils aims to be as “universal” as possible, meaning that we try to support many platforms. However, it is infeasible for us to guarantee that every platform works. Just like Rust itself, we therefore have multiple tiers of platform support, with different guarantees. We support two tiers of platforms:
- Tier 1: All applicable utils are compiled and tested in CI for these platforms.
- Tier 2: These platforms are supported but not actively tested. We do accept fixes for these platforms.
Note: The tiers are dictated by our CI. We would happily accept a job in the CI for testing more platforms, bumping those platforms to tier 1.
Platforms per tier
The platforms in tier 1 and the platforms that we test in CI are listed below.
| Operating system | Tested targets |
|---|---|
| Linux | x86_64-unknown-linux-gnu x86_64-unknown-linux-musl arm-unknown-linux-gnueabihf i686-unknown-linux-gnu aarch64-unknown-linux-gnu |
| macOS | x86_64-apple-darwin aarch64-apple-darwin |
| Windows | i686-pc-windows-msvc x86_64-pc-windows-gnu x86_64-pc-windows-msvc |
| FreeBSD | x86_64-unknown-freebsd |
| OpenBSD | x86_64-unknown-openbsd |
| Android | x86_64-linux-android |
| wasm32 | wasm32-wasip1 wasm32-wasip2 |
The platforms in tier 2 are more vague, but include:
- untested variations of the platforms above,
- Redox OS,
- and BSDs such as NetBSD & DragonFlyBSD.
Utility compatibility per platform
Not all utils work on every platform. For instance, chgrp is not supported on
Windows, because Windows does not have the concept of groups. Below is a full table
detailing which utilities are supported for the tier 1 platforms.
Note that for some utilities, not all functionality is supported on each platform. This is documented per utility.
| util | Linux | macOS | Windows | FreeBSD | Android |
|---|---|---|---|---|---|
| arch | ✓ | ✓ | ✓ | ✓ | ✓ |
| b2sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| base32 | ✓ | ✓ | ✓ | ✓ | ✓ |
| base64 | ✓ | ✓ | ✓ | ✓ | ✓ |
| basename | ✓ | ✓ | ✓ | ✓ | ✓ |
| basenc | ✓ | ✓ | ✓ | ✓ | ✓ |
| cat | ✓ | ✓ | ✓ | ✓ | ✓ |
| chcon | ✓ | ||||
| chgrp | ✓ | ✓ | ✓ | ✓ | |
| chmod | ✓ | ✓ | ✓ | ✓ | |
| chown | ✓ | ✓ | ✓ | ✓ | |
| chroot | ✓ | ✓ | ✓ | ✓ | |
| cksum | ✓ | ✓ | ✓ | ✓ | ✓ |
| comm | ✓ | ✓ | ✓ | ✓ | ✓ |
| cp | ✓ | ✓ | ✓ | ✓ | ✓ |
| csplit | ✓ | ✓ | ✓ | ✓ | ✓ |
| cut | ✓ | ✓ | ✓ | ✓ | ✓ |
| date | ✓ | ✓ | ✓ | ✓ | ✓ |
| dd | ✓ | ✓ | ✓ | ✓ | ✓ |
| df | ✓ | ✓ | ✓ | ✓ | ✓ |
| dir | ✓ | ✓ | ✓ | ✓ | ✓ |
| dircolors | ✓ | ✓ | ✓ | ✓ | ✓ |
| dirname | ✓ | ✓ | ✓ | ✓ | ✓ |
| du | ✓ | ✓ | ✓ | ✓ | ✓ |
| echo | ✓ | ✓ | ✓ | ✓ | ✓ |
| env | ✓ | ✓ | ✓ | ✓ | ✓ |
| expand | ✓ | ✓ | ✓ | ✓ | ✓ |
| expr | ✓ | ✓ | ✓ | ✓ | ✓ |
| factor | ✓ | ✓ | ✓ | ✓ | ✓ |
| false | ✓ | ✓ | ✓ | ✓ | ✓ |
| fmt | ✓ | ✓ | ✓ | ✓ | ✓ |
| fold | ✓ | ✓ | ✓ | ✓ | ✓ |
| groups | ✓ | ✓ | ✓ | ✓ | |
| head | ✓ | ✓ | ✓ | ✓ | ✓ |
| hostid | ✓ | ✓ | ✓ | ✓ | ✓ |
| hostname | ✓ | ✓ | ✓ | ✓ | ✓ |
| id | ✓ | ✓ | ✓ | ✓ | |
| install | ✓ | ✓ | ✓ | ✓ | |
| join | ✓ | ✓ | ✓ | ✓ | ✓ |
| kill | ✓ | ✓ | ✓ | ✓ | ✓ |
| link | ✓ | ✓ | ✓ | ✓ | ✓ |
| ln | ✓ | ✓ | ✓ | ✓ | ✓ |
| logname | ✓ | ✓ | ✓ | ✓ | |
| ls | ✓ | ✓ | ✓ | ✓ | ✓ |
| md5sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| mkdir | ✓ | ✓ | ✓ | ✓ | ✓ |
| mkfifo | ✓ | ✓ | ✓ | ✓ | |
| mknod | ✓ | ✓ | ✓ | ✓ | |
| mktemp | ✓ | ✓ | ✓ | ✓ | ✓ |
| more | ✓ | ✓ | ✓ | ✓ | ✓ |
| mv | ✓ | ✓ | ✓ | ✓ | ✓ |
| nice | ✓ | ✓ | ✓ | ✓ | ✓ |
| nl | ✓ | ✓ | ✓ | ✓ | ✓ |
| nohup | ✓ | ✓ | ✓ | ✓ | ✓ |
| nproc | ✓ | ✓ | ✓ | ✓ | ✓ |
| numfmt | ✓ | ✓ | ✓ | ✓ | ✓ |
| od | ✓ | ✓ | ✓ | ✓ | ✓ |
| paste | ✓ | ✓ | ✓ | ✓ | ✓ |
| pathchk | ✓ | ✓ | ✓ | ✓ | ✓ |
| pinky | ✓ | ✓ | ✓ | ||
| pr | ✓ | ✓ | ✓ | ✓ | ✓ |
| printenv | ✓ | ✓ | ✓ | ✓ | ✓ |
| printf | ✓ | ✓ | ✓ | ✓ | ✓ |
| ptx | ✓ | ✓ | ✓ | ✓ | ✓ |
| pwd | ✓ | ✓ | ✓ | ✓ | ✓ |
| readlink | ✓ | ✓ | ✓ | ✓ | ✓ |
| realpath | ✓ | ✓ | ✓ | ✓ | ✓ |
| rm | ✓ | ✓ | ✓ | ✓ | ✓ |
| rmdir | ✓ | ✓ | ✓ | ✓ | ✓ |
| runcon | ✓ | ||||
| seq | ✓ | ✓ | ✓ | ✓ | ✓ |
| sha1sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| sha224sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| sha256sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| sha384sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| sha512sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| shred | ✓ | ✓ | ✓ | ✓ | ✓ |
| shuf | ✓ | ✓ | ✓ | ✓ | ✓ |
| sleep | ✓ | ✓ | ✓ | ✓ | ✓ |
| sort | ✓ | ✓ | ✓ | ✓ | ✓ |
| split | ✓ | ✓ | ✓ | ✓ | ✓ |
| stat | ✓ | ✓ | ✓ | ✓ | |
| stdbuf | ✓ | ✓ | ✓ | ✓ | ✓ |
| stty | ✓ | ✓ | ✓ | ✓ | |
| sum | ✓ | ✓ | ✓ | ✓ | ✓ |
| sync | ✓ | ✓ | ✓ | ✓ | ✓ |
| tac | ✓ | ✓ | ✓ | ✓ | ✓ |
| tail | ✓ | ✓ | ✓ | ✓ | ✓ |
| tee | ✓ | ✓ | ✓ | ✓ | ✓ |
| test | ✓ | ✓ | ✓ | ✓ | ✓ |
| timeout | ✓ | ✓ | ✓ | ✓ | ✓ |
| touch | ✓ | ✓ | ✓ | ✓ | ✓ |
| tr | ✓ | ✓ | ✓ | ✓ | ✓ |
| true | ✓ | ✓ | ✓ | ✓ | ✓ |
| truncate | ✓ | ✓ | ✓ | ✓ | ✓ |
| tsort | ✓ | ✓ | ✓ | ✓ | ✓ |
| tty | ✓ | ✓ | ✓ | ✓ | ✓ |
| uname | ✓ | ✓ | ✓ | ✓ | ✓ |
| unexpand | ✓ | ✓ | ✓ | ✓ | ✓ |
| uniq | ✓ | ✓ | ✓ | ✓ | ✓ |
| unlink | ✓ | ✓ | ✓ | ✓ | ✓ |
| uptime | ✓ | ✓ | ✓ | ✓ | ✓ |
| users | ✓ | ✓ | ✓ | ||
| vdir | ✓ | ✓ | ✓ | ✓ | ✓ |
| wc | ✓ | ✓ | ✓ | ✓ | ✓ |
| who | ✓ | ✓ | ✓ | ||
| whoami | ✓ | ✓ | ✓ | ✓ | ✓ |
| yes | ✓ | ✓ | ✓ | ✓ | ✓ |
Contributing to coreutils
Hi! Welcome to uutils/coreutils!
Thanks for wanting to contribute to this project! This document explains everything you need to know to contribute. Before you start make sure to also check out these documents:
- Our community’s CODE_OF_CONDUCT.md.
- DEVELOPMENT.md for setting up your development environment.
- Our Review Guidelines for what we expect from a pull request and how reviews are done.
Now follows a very important warning:
Warning
uutils is original code and cannot contain any code from GNU or other implementations. This means that we cannot accept any changes based on the GNU source code. To make sure that cannot happen, you cannot link to the GNU source code either. It is however possible to look at other implementations under a BSD or MIT license like Apple’s implementation or OpenBSD.
Finally, feel free to join our Discord!
Getting Oriented
uutils is a big project consisting of many parts. Here are the most important parts for getting started:
src/uu: The code for all utilitiessrc/uucore: Crate containing all the shared code between the utilities.tests/by-util: The tests for all utilities.src/bin/coreutils.rs: Code for the multicall binary.docs: the documentation for the websitetests/uutests/: Crate implementing the various functions to test uutils commands.fuzz/: The differential fuzzers.
Each utility is defined as a separate crate. The structure of each of these crates is as follows:
Cargo.tomlsrc/main.rs: contains only a single macro callsrc/<util name>.rs: the actual code for the utilitylocales/en-US.ftl: the util’s stringslocales/fr-FR.ftl: French translation of the util’s strings
We have separate repositories for crates that we maintain but also publish for use by others:
Design Goals
We have the following goals with our development:
- Compatible: The utilities should be a drop-in replacement for the GNU coreutils.
- Cross-platform: All utilities should run on as many of the supported platforms as possible.
- Reliable: The utilities should never unexpectedly fail.
- Performant: Our utilities should be written in fast idiomatic Rust. We aim to match or exceed the performance of the GNU utilities.
- Well-tested: We should have a lot of tests to be able to guarantee reliability and compatibility. Code coverage should not regress; new behavior should come with tests that cover it.
How to Help
There are several ways to help and writing code is just one of them. Reporting issues and writing documentation are just as important as writing code.
Reference version of GNU coreutils
We try to stay compatible with the latest stable release of GNU coreutils, and sometimes backport changes from GNU’s master branch as well.
Since many Linux distributions ship an older GNU coreutils, Canonical provides a more recent build you can use to compare our utilities against upstream before filing a bug report. A few caveats:
- The package is PATCHED, so it may differ from upstream.
- NEVER install this package on your system — it isn’t meant for daily use. Instead, manually download and extract the tarball and run it from there.
- Bug reports and fixes for this package itself are not accepted here.
Reporting Issues
We can’t fix bugs we don’t know about, so good issues are super helpful! Here are some tips for writing good issues:
- Confirm the bug is in coreutils; some tools (e.g.,
find,sed) are maintained in separate repositories under the uutils project. - If you find a bug, make sure it’s still a problem on the
mainbranch. - Search through the existing issues to see whether it has already been reported.
- Make sure to include all relevant information, such as:
- Which version or commit hash of uutils did you check?
- Which version of GNU coreutils are you comparing with?
- Did you test against the latest version of GNU coreutils?
- What platform are you on?
- Provide a way to reliably reproduce the issue.
- Be as specific as possible!
- Please provide the output with LANG=C, except for locale-related bugs.
Writing Documentation
There’s never enough documentation. If you come across any documentation that could be improved, feel free to submit a PR for it!
Writing Code
If you want to submit a PR, make sure that you’ve discussed the solution with the maintainers beforehand. We want to avoid situations where you put a lot of work into a fix that we can’t merge! If there’s no issue for what you’re trying to fix yet, make one before you start working on the PR.
Generally, we try to follow what GNU is doing in terms of options and behavior.
It is recommended to look at the GNU coreutils manual
(on the web,
or locally using info <utility>). It is more in depth than the man pages and
provides a good description of available features and their implementation
details. But remember, you cannot look at the GNU source code!
Also remember that we can only merge PRs which pass our test suite, follow rustfmt, and do not have any warnings from clippy. See DEVELOPMENT.md for more information. Be sure to also read about our Rust style.
Our Rust Style
We want uutils to be written in idiomatic Rust, so here are some guidelines to follow. Some of these are aspirational, meaning that we don’t do them correctly everywhere in the code. If you find violations of the advice below, feel free to submit a patch!
Don’t panic!
The coreutils should be very reliable. This means that we should never panic!.
Therefore, you should avoid using println!, .unwrap() and panic!. Sometimes the use of
unreachable! can be justified with a comment explaining why that code is
unreachable.
Don’t exit
We want uutils to be embeddable in other programs. This means that no function
in uutils should exit the program. Doing so would also lead to code with more
confusing control flow. Avoid therefore std::process::exit and similar
functions which exit the program early.
unsafe
uutils cannot be entirely safe, because we have to call out to libc and do
syscalls. However, we still want to limit our use of unsafe. We generally only
accept unsafe for FFI, with very few exceptions. Note that performance is very
rarely a valid argument for using unsafe.
If you still need to write code with unsafe, make sure to read the
Rustonomicon and annotate the
calls with // SAFETY: comments explaining why the use of unsafe is sound.
Macros
Macros can be a great tool, but they are also usually hard to understand. They should be used sparingly. Make sure to explore simpler options before you reach for a solution involving macros.
str, OsStr & Path
Rust has many string-like types, and sometimes it’s hard to choose the right
one. It’s tempting to use str (and String) for everything, but that is not
always the right choice for uutils, because we need to support invalid UTF-8,
just like the GNU coreutils. For example, paths on Linux might not be valid
UTF-8! Whenever we are dealing with paths, we should therefore stick with
OsStr and Path. Make sure that you only convert to str/String if you
know that something is always valid UTF-8. If you need more operations on
OsStr, you can use the bstr crate.
Doc-comments
We use rustdoc for our documentation, so it’s best to follow rustdoc’s guidelines. Make sure that your documentation is not just repeating the name of the function, but actually giving more useful information. Rustdoc recommends the following structure:
[short sentence explaining what it is]
[more detailed explanation]
[at least one code example that users can copy/paste to try it]
[even more advanced explanations if necessary]
Other comments
Comments should be written to explain the code, not to describe the code. Try to focus on explaining why the code is the way it is. If you feel like you have to describe the code, that’s usually a sign that you could improve the naming of variables and functions.
If you edit a piece of code, make sure to update any comments that need to change as a result. The only thing worse than having no comments is having outdated comments!
Tests use #[rstest]
Tests use rstest with #[case(...)] for
parameterized test cases. Prefer #[rstest] over writing multiple near-identical
#[test] functions when a test has multiple cases. Plain #[test] is fine for
single-case tests; there is no need to convert existing tests.
AI policy
AI-assisted contributions are allowed, but the same standards apply as for any other patch. If you use an AI tool to help write a change, you are still responsible for it: you should understand every line you submit and be able to explain and justify the change in review. Be especially careful that the output is not derived from GNU coreutils or other GPL code - AI assistants are trained on GPL sources and can reproduce them verbatim, which this project cannot accept. Keep patches small and focused so they are easy to review, and self-review the diff carefully before opening a pull request - reviewers are there to double-check a human’s work, not an LLM’s output.
Git Etiquette
To ensure easy collaboration, we have guidelines for using Git and GitHub.
Commits
- Make small and atomic commits.
- Keep a clean history of commits.
- Write informative commit messages.
- Annotate your commit message with the component you’re editing. For example:
cp: do not overwrite on with -ioruucore: add support for FreeBSD. - Do not unnecessarily move items around in the code. This makes the changes much harder to review. If you do need to move things around, do that in a separate commit.
Commit messages
You can read this section in the Git book to learn how to write good commit messages.
In addition, here are a few examples for a summary line when committing to uutils:
- commit for a single utility
nohup: cleanup and refactor
- commit for a utility’s tests
tests/rm: test new feature
Beyond changes to an individual utility or its tests, other summary lines for non-utility modules include:
README: add help
uucore: add new modules
uutils: add new utility
gitignore: add temporary files
PRs
- Make the titles of PRs descriptive.
- This means describing the problem you solve. For example, do not write
Fix #1234, butls: fix version sort order. - You can prefix the title with the utility the PR concerns.
- This means describing the problem you solve. For example, do not write
- Keep PRs small and self-contained. A set of small PRs is much more likely to
get merged quickly than one large PR. If you have a large change to submit,
consider using
gh stackto split it into a series of stacked PRs that are easier to review. - Make sure the CI passes (up to intermittently failing tests).
- You know your code best, that’s why it’s best if you can solve merge conflicts
on your branch yourself.
- It’s up to you whether you want to use
git merge mainorgit rebase main. - Feel free to ask for help with merge conflicts.
- It’s up to you whether you want to use
- You do not need to ping maintainers to request a review immediately after submission. If you do not get a response to your patch within a few days, it is fine to request a review.
- If after a week your patch has still not been reviewed, we recommend that you ping the maintainers on our Discord channel in
#coreutils-chat.
- If after a week your patch has still not been reviewed, we recommend that you ping the maintainers on our Discord channel in
- If a CI job fails and you believe it is a flaky or intermittent failure, you
can comment
/rerunon the PR to re-run the failed jobs of every failed workflow, or/rerun <workflow name>(e.g./rerun GnuTests) to re-run only one of them. This works even without write access to the repository.
Platforms
We take pride in supporting many operating systems and architectures. Any code
you contribute must at least compile without warnings for all platforms in the
CI. However, you can use #[cfg(...)] attributes to create platform dependent
features.
Improving the GNU compatibility
Please make sure you have installed GNU utils and prerequisites and can execute commands described in Comparing with GNU section of DEVELOPMENT.md
The Python script ./util/remaining-gnu-error.py shows the list of failing
tests in the CI.
To improve the GNU compatibility, the following process is recommended:
- Identify a test (the smaller, the better) on a program that you understand or
is easy to understand. You can use the
./util/remaining-gnu-error.pyscript to help with this decision. - Build both the GNU and Rust coreutils using:
bash util/build-gnu.sh - Run the test with
bash util/run-gnu-test.sh <your test> - Start to modify
<your test>to understand what is wrong. Examples:- Add
set -vto have the bash verbose mode - Add
echo $?where needed - When the variable
failis used in the test,echo $failto see when the test started to fail - Bump the content of the output (ex:
cat err) - …
- Add
- Or, if the test is simple, extract the relevant information to create a new test case running both GNU & Rust implementation
- Start to modify the Rust implementation to match the expected behavior
- Add a test to make sure that we don’t regress (our test suite is super quick)
Code coverage
To generate code coverage report locally please follow Code coverage report section of DEVELOPMENT.md
Other implementations
The Coreutils have different implementations, with different levels of completions:
However, when reimplementing the tools/options in Rust, don’t read their source codes when they are using reciprocal licenses (ex: GNU GPL, GNU LGPL, etc).
Licensing
uutils is distributed under the terms of the MIT License; see the LICENSE file
for details. This is a permissive license, which allows the software to be used
with few restrictions.
Copyrights in the uutils project are retained by their contributors, and no copyright assignment is required to contribute.
If you wish to add or change dependencies as part of a contribution to the
project, a tool like cargo-license can be used to show their license details.
The following types of license are acceptable:
- MIT License
- Dual- or tri-license with an MIT License option (“Apache-2.0 or MIT” is a popular combination)
- “MIT equivalent” license (2-clause BSD, 3-clause BSD, ISC)
- License less restrictive than the MIT License (CC0 1.0 Universal)
- Apache License version 2.0
Licenses we will not use:
- An ambiguous license, or no license
- Strongly reciprocal licenses (GNU GPL, GNU LGPL)
If you wish to add a reference but it doesn’t meet these requirements, please raise an issue to describe the dependency.
Setting up your local development environment
For contributing rules and best practices please refer to CONTRIBUTING.md
Before you start
For this guide we assume that you already have a GitHub account and have git and your favorite code editor or IDE installed and configured.
Before you start working on coreutils, please follow these steps:
- Fork the coreutils repository to your GitHub account. Tip: See this GitHub guide for more information on this step.
- Clone that fork to your local development environment:
git clone https://github.com/YOUR-GITHUB-ACCOUNT/coreutils
cd coreutils
Tools
You will need the tools mentioned in this section to build and test your code changes locally. This section will explain how to install and configure these tools. We also have an extensive CI that uses these tools and will check your code before it can be merged. The next section Testing will explain how to run those checks locally to avoid waiting for the CI.
As an alternative to host installation of the tools, you can open the project with the provided development container configuration. For more information about development containers, see the Visual Studio Code Dev Containers documentation.
Rust toolchain
If you’re using rustup to install and manage your Rust toolchains, clippy and rustfmt are usually already installed. If you are using one of the alternative methods, please make sure to install them manually. See following sub-sections for their usage: clippy rustfmt.
Tip You might also need to add ‘llvm-tools’ component if you are going to generate code coverage reports locally:
rustup component add llvm-tools-preview
GNU utils and prerequisites
If you are developing on Linux, most likely you already have all/most GNU utilities and prerequisites installed.
To make sure, please check GNU coreutils README-prereq.
You will need these to run uutils against the GNU test suite locally.
For MacOS and Windows platform specific setup please check MacOS GNU utils and Windows GNU utils sections respectfully.
prek hooks
A configuration for prek is provided in the repository. It reads the existing
.pre-commit-config.yaml natively and allows automatically checking every git
commit you make to ensure it compiles, and passes clippy and rustfmt
without warnings.
To use the provided hook:
- Install
prek - Run
prek installwhile in the repository directory
Your git commits will then automatically be checked. If a check fails, an error
message will explain why, and your commit will be canceled. You can then make
the suggested changes, and run git commit ... again.
clippy
cargo clippy --workspace --all-targets --all-features
rustfmt
cargo fmt --all
cargo-deny
This project uses cargo-deny to detect duplicate dependencies, checks licenses, etc. To run it locally, first install it and then run with:
cargo deny --all-features check all
Markdown linter
We use markdownlint to lint the Markdown files in the repository.
Spell checker
We use cspell as spell checker for all files in the project. If you are using
VS Code, you can install the
code spell checker
extension to enable spell checking within your editor. Otherwise, you can
install cspell separately.
If you want to make the spell checker ignore a word, you can add
#![allow(unused)]
fn main() {
// spell-checker:ignore word_to_ignore
}
at the top of the file.
Testing
This section explains how to run our CI checks locally.
Testing can be done using either Cargo or make.
Testing with Cargo
Just like with building, we follow the standard procedure for testing using Cargo:
cargo test
By default, cargo test only runs the common programs. To run also platform
specific tests, run:
cargo test --features unix
If you would prefer to test a select few utilities:
cargo test --features "chmod mv tail" --no-default-features
If you also want to test the core utilities:
cargo test -p uucore -p coreutils
# or
cargo test --all-features -p uucore
Running the complete test suite might take a while. We use nextest in the CI and you might want to try it out locally. It can speed up the execution time of the whole test run significantly if the cpu has multiple cores.
cargo nextest run --features unix --no-fail-fast
To debug:
rust-gdb --args target/debug/coreutils ls
(gdb) b ls.rs:79
(gdb) run
Testing with GNU Make
To simply test all available utilities:
make test
To test all but a few of the available utilities:
make SKIP_UTILS='UTILITY_1 UTILITY_2' test
To test only a few of the available utilities:
make UTILS='UTILITY_1 UTILITY_2' test
To include tests for unimplemented behavior:
make UTILS='UTILITY_1 UTILITY_2' SPEC=y test
To run tests with nextest just use the nextest target. Note you’ll need to
install nextest first. The nextest target accepts the
same arguments like the default test target, so it’s possible to pass arguments to nextest run
via CARGOFLAGS:
make CARGOFLAGS='--no-fail-fast' UTILS='UTILITY_1 UTILITY_2' nextest
Run Busybox Tests
This testing functionality is only available on Unix-like operating systems and
requires make.
To run busybox tests for all utilities for which busybox has tests
make busytest
To run busybox tests for a few of the available utilities
make UTILS='UTILITY_1 UTILITY_2' busytest
To pass an argument like “-v” to the busybox test runtime
make UTILS='UTILITY_1 UTILITY_2' RUNTEST_ARGS='-v' busytest
Comparing with GNU
To run uutils against the GNU test suite locally, run the following commands:
bash util/build-gnu.sh
# Build uutils with release optimizations
env PROFILE=release bash util/build-gnu.sh
# Build uutils with SELinux
env SELINUX_ENABLED=1 bash util/build-gnu.sh
bash util/run-gnu-test.sh
# To run a single test:
bash util/run-gnu-test.sh tests/touch/not-owner.sh # for example
# To run several tests:
bash util/run-gnu-test.sh tests/touch/not-owner.sh tests/rm/no-give-up.sh # for example
# If this is a perl (.pl) test, to run in debug:
DEBUG=1 bash util/run-gnu-test.sh tests/misc/sm3sum.pl
Tip: First time you run bash util/build-gnu.sh command, it will provide instructions on how to checkout GNU coreutils repository at the correct release tag. Please follow those instructions and when done, run bash util/build-gnu.sh command again.
You also need to install quilt, a tool used to manage a stack of patches for modifying GNU tests.
On FreeBSD, you need to install packages for GNU coreutils and sed (used in shell scripts instead of system commands):
pkg install coreutils gsed
Code coverage report
Code coverage report can be generated using grcov.
To generate gcov-based coverage report
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
export RUSTDOCFLAGS="-Cpanic=abort"
export RUSTUP_TOOLCHAIN="nightly"
cargo build <options...> # e.g., --features feat_os_unix
cargo test <options...> # e.g., --features feat_os_unix test_pathchk
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing --ignore build.rs --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?\#\[derive\()" -o ./target/debug/coverage/
# open target/debug/coverage/index.html in browser
if changes are not reflected in the report then run cargo clean and run the above commands.
Tips for setting up on Mac
C Compiler and linker
On MacOS you’ll need to install C compiler & linker:
xcode-select --install
MacOS GNU utils
On MacOS you will need to install Homebrew and use it to install the following Homebrew formulas:
brew install \
coreutils \
autoconf \
gettext \
texinfo \
xz \
automake \
gnu-sed \
m4 \
bison \
prek \
findutils
After installing these Homebrew formulas, please make sure to add the following lines to your zsh or bash rc file, i.e. ~/.profile or ~/.zshrc or ~/.bashrc …
(assuming Homebrew is installed at default location /opt/homebrew):
eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/opt/homebrew/opt/bison/bin:$PATH"
export PATH="/opt/homebrew/opt/findutils/libexec/gnubin:$PATH"
Last step is to link Homebrew coreutils version of timeout to /usr/local/bin (as admin user):
sudo ln -s /opt/homebrew/bin/timeout /usr/local/bin/timeout
Do not forget to either source updated rc file or restart you terminal session to update environment variables.
Tips for setting up on Windows
MSVC build tools
On Windows you’ll need the MSVC build tools for Visual Studio 2013 or later.
If you are using rustup-init.exe to install Rust toolchain, it will guide you through the process of downloading and installing these prerequisites.
Otherwise please follow this guide.
Windows GNU utils
If you have used Git for Windows to install git on you Windows system you might already have some GNU core utilities installed as part of “GNU Bash” included in Git for Windows package, but it is not a complete package. This article provides instruction on how to add more to it.
Alternatively you can install Cygwin and/or use WSL2 to get access to all GNU core utilities on Windows.
Preparing a new release
- Modify
util/update-version.sh(FROM & TO) and run it - Submit a new PR with these changes and wait for it to be merged
- Tag the new release
git tag -a X.Y.Zandgit push --tags - Once the CI is green, a new release will be automatically created in draft mode. Reuse this release and make sure that assets have been added.
- Write the release notes (it takes time) following previous examples
- Run
util/publish.sh --do-itto publish the new release to crates.io
Contributor Covenant Code of Conduct
Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
Our Standards
Examples of behavior that contributes to a positive environment for our community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at sylvestre@debian.org. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
1. Correction
Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
2. Warning
Community Impact: A violation through a single incident or series of actions.
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
3. Temporary Ban
Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
4. Permanent Ban
Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
Consequence: A permanent ban from any sort of public interaction within the community.
Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by Mozilla’s code of conduct enforcement ladder.
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
Localization (L10n) in uutils coreutils
This guide explains how localization (L10n) is implemented in the Rust-based coreutils project, detailing the use of Fluent files, runtime behavior, and developer integration.
Architecture Overview
English (US) locale files (en-US.ftl) are embedded directly in the binary, ensuring that English always works regardless of how the software is installed. Other language locale files are loaded from the filesystem at runtime.
Source Repository Structure
- Main repository: Contains English (
en-US.ftl) locale files embedded in binaries - Translation repository: uutils/coreutils-l10n contains all other language translations
- Online Translation: weblate/rust-coreutils to translate the strings.
Fluent File Layout
Each utility has its own set of translation files under:
src/uu/<utility>/locales/<locale>.ftl
Examples:
src/uu/ls/locales/en-US.ftl # Embedded in binary
src/uu/ls/locales/fr-FR.ftl # Loaded from filesystem
These files follow Fluent syntax and contain localized message patterns.
The French translation is the only locale other than English to be part of the tree. The goal is to be able to run tests with a different locale to verify that they work.
Initialization
Localization must be explicitly initialized at runtime using:
setup_localization(path)
This is typically done:
- In
src/bin/coreutils.rsfor multi-call binaries - In
src/uucore/src/lib.rsfor single-call utilities
The string parameter determines the lookup path for Fluent files. English always works because it’s embedded, but other languages need their .ftl files to be available at runtime.
Locale Detection
Locale selection is automatic and performed via:
fn detect_system_locale() -> Result<LanguageIdentifier, LocalizationError>
It reads the LANG environment variable (e.g., fr-FR.UTF-8), strips encoding, and parses the identifier.
If parsing fails or LANG is not set, it falls back to:
const DEFAULT_LOCALE: &str = "en-US";
You can override the locale at runtime by running:
LANG=ja-JP ./target/debug/ls
Retrieving Messages
We have a single macro to handle translations. It can be used in two ways:
translate!(id: &str) -> String
Returns the message from the current locale bundle.
let msg = translate!("id-greeting");
If not found, falls back to en-US. If still missing, returns the ID itself.
translate!(id: &str, args: key-value pairs) -> String
Supports variable interpolation and pluralization.
let msg = translate!(
"error-io",
"error" => std::io::Error::last_os_error()
);
Fluent message example:
error-io = I/O error occurred: { $error }
Variables must match the Fluent placeholder keys ($error, $name, $count, etc.).
Fluent Syntax Example
id-greeting = Hello, world!
welcome = Welcome, { $name }!
count-files = You have { $count ->
[one] { $count } file
*[other] { $count } files
}
Use plural rules and inline variables to adapt messages dynamically.
Testing Localization
Run all localization-related unit tests with:
cargo test --lib -p uucore
Tests include:
- Loading bundles
- Plural logic
- Locale fallback
- Fluent parse errors
- Thread-local behavior
- …
Thread-local Storage
Localization is stored per thread using a OnceLock.
Each thread must call setup_localization() individually.
Initialization is one-time-only per thread — re-initialization results in an error.
Development vs Release Mode
During development (cfg(debug_assertions)), paths are resolved relative to the crate source:
$CARGO_MANIFEST_DIR/../uu/<utility>/locales/
In release mode, paths are resolved relative to the executable:
<executable_dir>/locales/<utility>/
<prefix>/share/locales/<utility>/
~/.local/share/coreutils/locales/<utility>/
~/.cargo/share/coreutils/locales/<utility>/
/usr/share/coreutils/locales/<utility>/
If external locale files aren’t found, the system falls back to embedded English locales.
Unicode Isolation Handling
By default, the Fluent system wraps variables with Unicode directional isolate characters (U+2068, U+2069) to protect against visual reordering issues in bidirectional text (e.g., mixing Arabic and English).
In this implementation, isolation is disabled via:
bundle.set_use_isolating(false);
This improves readability in CLI environments by preventing extraneous characters around interpolated values:
Correct (as rendered):
"Welcome, Alice!"
Fluent default (disabled here):
"\u{2068}Alice\u{2069}"
Embedded English Locales
English locale files are always embedded directly in the binary during the build process. This ensures that:
- English always works regardless of installation method (e.g.,
cargo install) - No runtime dependency on external
.ftlfiles for English - Fallback behavior when other language files are missing
The embedded English locales are generated at build time and included in the binary, providing a reliable fallback while still supporting full localization for other languages when their .ftl files are available.
GNU Test Coverage
uutils is actively tested against the GNU coreutils test suite. The results below are automatically updated every day.
Coverage per category
Click on the categories to see the names of the tests. Green indicates a passing test, yellow indicates a skipped test and red means that the test either failed or resulted in an error.
Progress over time
Extensions over GNU
Though the main goal of the project is compatibility, uutils supports a few features that are not supported by GNU coreutils. We take care not to introduce features that are incompatible with the GNU coreutils. Below is a list of uutils extensions.
General
GNU coreutils provides two ways to define short options taking an argument:
$ ls -w 80
$ ls -w80
We support a third way:
$ ls -w=80
With GNU coreutils, --help usually prints the help message and --version prints the version.
We also commonly provide short options: -h for help and -V for version.
coreutils
Our coreutils calls utility by coreutils utility-name and has --list to run against busybox test suite.
Our coreutils is called as utility-name if its binary name ends with utility-name to support prefixed names.
Longer name is prioritized e.g. sum with the prefix ck is called as cksum.
On Linux with glibc, a symlink alias such as
dummy -> true -> coreutils selects true from the alias’s immediate target.
base32/base64/basenc
Just like on macOS, base32/base64/basenc provides -D to decode data.
cp
cp can display a progress bar when the -g/--progress flag is set.
du
du allows birth and creation as values for the --time argument to show the creation time. It
also provides a -v/--verbose flag.
env
GNU env allows the empty string to be used as an environment variable name.
This is unsupported by uutils, which will show a warning for any such
assignment.
expand
expand offers the -U/--no-utf8 option to interpret input files as 8-bit ASCII instead of UTF-8.
fmt
fmt has additional flags for prefixes: -P/--skip-prefix, -x/--exact-prefix, and
-X/--exact-skip-prefix. With -m/--preserve-headers, an attempt is made to detect and preserve
mail headers in the input. -q/--quick breaks lines more quickly. And -T/--tab-width defines the
number of spaces representing a tab when determining the line length.
id
id has three additional flags:
-Pdisplays the id as a password file entry-pmakes the output human-readable-Adisplays the process audit user ID
install
install offers FreeBSD’s -U unprivileged option to not change the owner, the group, or the file flags of the destination.
join
join accepts -n/--numeric-sort to compare join fields by numerical value,
the same way sort -n orders them. This lets it join files sorted with sort -n,
and keys such as 1 and 01 are considered equal.
ls
GNU ls provides two ways to use a long listing format: -l and --format=long. We support a
third way: --long.
GNU ls --sort=VALUE only supports special non-default sort orders.
We support --sort=name, which makes it possible to override an earlier value.
more
We provide a simple implementation of more, which is not part of GNU
coreutils. We do not aim for full compatibility with the more utility from
util-linux. Features from more modern pagers (like less and bat) are
therefore welcomed.
mv
mv can display a progress bar when the -g/--progress flag is set.
printf
printf uses arbitrary precision decimal numbers to parse and format floating point
numbers. GNU coreutils uses long double, whose actual size may be double precision
64-bit float
(e.g 32-bit arm), extended precision 80-bit float
(x86(-64)), or
quadruple precision 128-bit float (e.g. arm64).
Practically, this means that printing a number with high precision will remain exact:
printf "%.48f\n" 0.1
0.100000000000000000000000000000000000000000000000 << uutils on all platforms
0.100000000000000000001355252715606880542509316001 << GNU coreutils on x86(-64)
0.100000000000000000000000000000000004814824860968 << GNU coreutils on arm64
0.100000000000000005551115123125782702118158340454 << GNU coreutils on armv7 (32-bit)
Hexadecimal floats
For hexadecimal float format (%a), POSIX only states that one hexadecimal number
should be present left of the decimal point (0xh.hhhhp±d [1]), but does not say how
many bits should be included (between 1 and 4). On x86(-64), the first digit always
includes 4 bits, so its value is always between 0x8 and 0xf, while on other
architectures, only 1 bit is included, so the value is always 0x1.
However, the first digit will of course be 0x0 if the number is zero. Also,
rounding numbers may cause the first digit to be 0x1 on x86(-64) (e.g.
0xf.fffffffp-5 rounds to 0x1.00p-1), or 0x2 on other architectures.
We chose to replicate x86-64 behavior on all platforms.
Additionally, the default precision of the hexadecimal float format (%a without
any specifier) is expected to be “sufficient for exact representation of the value” [1].
This is not possible in uutils as we store arbitrary precision numbers that may be
periodic in hexadecimal form (0.1 = 0xc.ccc...p-7), so we revert
to the number of digits that would be required to exactly print an
extended precision 80-bit float,
emulating GNU coreutils behavior on x86(-64). An 80-bit float has 64 bits in its
integer and fractional part, so 16 hexadecimal digits are printed in total (1 digit
before the decimal point, 15 after).
Practically, this means that the default hexadecimal floating point output is identical to x86(-64) GNU coreutils:
printf "%a\n" 0.1
0xc.ccccccccccccccdp-7 << uutils on all platforms
0xc.ccccccccccccccdp-7 << GNU coreutils on x86-64
0x1.999999999999999999999999999ap-4 << GNU coreutils on arm64
0x1.999999999999ap-4 << GNU coreutils on armv7 (32-bit)
We can print an arbitrary number of digits if a larger precision is requested,
and the leading digit will still be in the 0x8-0xf range:
printf "%.32a\n" 0.1
0xc.cccccccccccccccccccccccccccccccdp-7 << uutils on all platforms
0xc.ccccccccccccccd00000000000000000p-7 << GNU coreutils on x86-64
0x1.999999999999999999999999999a0000p-4 << GNU coreutils on arm64
0x1.999999999999a0000000000000000000p-4 << GNU coreutils on armv7 (32-bit)
Note: The architecture-specific behavior on non-x86(-64) platforms may change in the future.
rm
rm can display a progress bar when the -g/--progress flag is set.
seq
Unlike GNU coreutils, seq always uses arbitrary precision decimal numbers, no
matter the parameters (integers, decimal numbers, positive or negative increments,
format specified, etc.), so its output will be more correct than GNU coreutils for
some inputs (e.g. small fractional increments where GNU coreutils uses long double).
The only limitation is that the position of the decimal point is stored in a i64,
so values smaller than 10**(-263) will underflow to 0, and some values larger
than 10(2**63) may overflow to infinity.
See also comments under printf for formatting precision and differences.
seq provides -t/--terminator to set the terminator character.
sort
When sorting with -g/--general-numeric-sort, arbitrary precision decimal numbers
are parsed and compared, unlike GNU coreutils that uses platform-specific long
double floating point numbers.
Extremely large or small values can still overflow or underflow to infinity or zero,
see note in seq.
unexpand
GNU unexpand provides --first-only to convert only leading sequences of blanks. We support a
second way: -f like busybox.
With -U/--no-utf8, you can interpret input files as 8-bit ASCII rather than UTF-8.
uptime
Similar to the proc-ps implementation and unlike GNU/Coreutils, uptime provides:
-s/--sinceto show since when the system is up-p/--prettyto display uptime in a pretty-printed format
Error diagnostics
GNU coreutils reports every error as a single line on stderr. That line
answers what went wrong, but Not where. For utilities whose arguments form
a small language of their own - a test expression, a chmod mode, a sort
key - the interesting question is usually which argument, or which character
inside an argument, broke the parse.
When stderr is a terminal, uutils renders these errors as a compiler-style report instead: the command line is echoed back as a source line, and a caret points at the part that is at fault, often with a line of advice. Everywhere else - a script, a pipe, a test harness - the plain one-line message is kept, so nothing that reads stderr can tell the difference.
Before and after
Each utility below shows the plain one-line message first - what uutils prints when stderr is not a terminal, and in most cases exactly what GNU prints - then the report rendered on a terminal, colors included.
test
Before:
$ test 7 -eq zap
test: invalid integer 'zap'
After:
$ test 7 -eq zap test: invalid integer 'zap' ╭─[ test:1:7 ] │ 1 │ 7 -eq zap │ ─── │ │ Help: -eq, -ne, -lt, -le, -gt and -ge compare integers; use =, !=, < or > to compare strings │ -eq equal, -ne not equal, -lt less than, -le less than or equal, -gt greater than, -ge greater than or equal ───╯
cut
A list of ranges is often long, and only one item in it is wrong:
Before:
$ cut -f 1,4-2,9-12 notes.txt
cut: invalid decreasing range
After:
$ cut -f 1,4-2,9-12 notes.txt cut: invalid decreasing range ╭─[ cut:1:10 ] │ 1 │ cut -f 1,4-2,9-12 notes.txt │ ─┬─ │ ╰─── this range ends before it starts │ │ Help: a list is N, N-M, N- or -M, separated by commas, as in -f1,4-6,9- ───╯
expr
Before:
$ expr 9 + foo
expr: non-integer argument
After:
$ expr 9 + foo expr: non-integer argument ╭─[ expr:1:5 ] │ 1 │ 9 + foo │ ─── │ │ Help: arithmetic operators need integers; use = or != to compare strings instead ───╯
chmod
The caret can point inside an argument, at the exact character that broke the parse:
Before:
$ chmod 'g+rw?x' notes.txt
chmod: invalid operator (expected +, -, or =, but found ?)
After:
$ chmod 'g+rw?x' notes.txt chmod: invalid operator (expected +, -, or =, but found ?) ╭─[ chmod:1:5 ] │ 1 │ g+rw?x notes.txt │ ─ │ │ Help: a mode is either octal, as in 644, or clauses such as u+rwx,go-w ───╯
tr
Before:
$ tr 'qw[y-b]' x
tr: range-endpoints of 'y-b' are in reverse collating sequence order
After:
$ tr 'qw[y-b]' x tr: range-endpoints of 'y-b' are in reverse collating sequence order ╭─[ tr:1:7 ] │ 1 │ tr qw[y-b] x │ ─┬─ │ ╰─── did you mean 'b-y'? │ │ Help: a range goes from the lower character to the higher one, as in a-z ───╯
csplit
A pattern is a small language of its own, and the regex engine already knows which character of it it choked on - so the caret can say so too:
Before:
$ csplit notes.txt '/a{2,1}/'
csplit: '/a{2,1}/': invalid pattern
After:
$ csplit notes.txt '/a{2,1}/' csplit: '/a{2,1}/': invalid pattern ╭─[ csplit:1:20 ] │ 1 │ csplit notes.txt /a{2,1}/ │ ──┬── │ ╰──── invalid repetition count range, the start must be <= the end │ │ Help: a pattern is a line number N, /REGEXP/[OFFSET] or %REGEXP%[OFFSET], each optionally followed by {N} or {*} ───╯
The label is quoted from the regex engine rather than translated, since that is the only place the wording exists.
sort
Before:
$ sort -k2.3x notes.txt
sort: stray character in field spec: invalid field specification '2.3x'
After:
$ sort -k2.3x notes.txt sort: stray character in field spec: invalid field specification '2.3x' ╭─[ sort:1:11 ] │ 1 │ sort -k2.3x notes.txt │ ─ │ │ Help: a key is FIELD[.CHAR][OPTS][,FIELD[.CHAR][OPTS]], as in -k2.3,4nr ───╯
numfmt
Before:
$ numfmt --format=%q 1000
numfmt: invalid format '%q', directive must be %[0]['][-][N][.][N]f
After:
$ numfmt --format=%q 1000 numfmt: invalid format '%q', directive must be %[0]['][-][N][.][N]f ╭─[ numfmt:1:18 ] │ 1 │ numfmt --format=%q 1000 │ ┬ │ ╰── f is the only conversion numfmt has; %d, %e, %g and the other C conversions are not accepted │ │ Help: a format is [PREFIX]%[0]['][-][WIDTH][.PRECISION]f[SUFFIX], as in "%'-10.2f" ───╯
printf
Before:
$ printf %5.2c q
printf: %5.2c: invalid conversion specification
After:
$ printf %5.2c q printf: %5.2c: invalid conversion specification ╭─[ printf:1:8 ] │ 1 │ printf %5.2c q │ ───── │ │ Help: %d, %s, %x, %f and the other C conversions are accepted, plus %b and %q; a literal % is written %% ───╯
The same goes for a broken escape: printf 'a\xzb' puts the caret under the
\x that is missing its hexadecimal digits.
env
env -S takes a whole command line and splits it as a shell would. Its
messages name an offset, which is precisely the thing a caret can show
instead:
Before:
$ env -S 'echo ${1FOO}'
env: only ${VARNAME} expansion is supported, error at: ${1FOO}
After:
$ env -S 'echo ${1FOO}' env: only ${VARNAME} expansion is supported, error at: ${1FOO} ╭─[ env:1:14 ] │ 1 │ env -S 'echo ${1FOO}' │ ─┬─ │ ╰─── a variable name cannot start with a digit │ │ Help: only $NAME and ${NAME} are expanded; the other shell forms are not ───╯
Note that the -S string holds spaces, so it is echoed back quoted - and the
caret still points inside it.
head
A SIZE is a number and a unit, and the caret says which of the two was rejected:
Before:
$ head -c 1fb notes.txt
head: invalid number of bytes: '1fb'
After:
$ head -c 1fb notes.txt head: invalid number of bytes: '1fb' ╭─[ head:1:10 ] │ 1 │ head -c 1fb notes.txt │ ─┬ │ ╰── not a known unit │ │ Help: a size is a number and an optional unit: K, M, G and so on for 1024, KB, MB, GB for 1000 ───╯
dd
Every dd operand is a KEY=VALUE pair, and a value can be a comma-separated
list of flags, so there are three things the caret can pick out: the key, the
whole value, or one flag inside the list. A flag is underlined where it sits
in the list rather than wherever its text first turns up, and the advice names
the flags that operand accepts:
Before:
$ dd conv=ucase,zap
dd: invalid conversion: 'zap'
After:
$ dd conv=ucase,zap dd: invalid conversion: 'zap' ╭─[ dd:1:15 ] │ 1 │ dd conv=ucase,zap │ ─┬─ │ ╰─── not a known conversion │ │ Help: conv= is one of ascii, ebcdic, ibm, lcase, ucase, block, unblock, swab, sync, noerror, sparse, excl, nocreat, notrunc, fdatasync or fsync ───╯
iflag= and oflag= are reported apart, so an output flag is no longer
blamed on the input, and each lists its own flags:
Before:
$ dd oflag=zap
dd: invalid output flag: 'zap'
After:
$ dd oflag=zap dd: invalid output flag: 'zap' ╭─[ dd:1:10 ] │ 1 │ dd oflag=zap │ ─┬─ │ ╰─── not a known output flag │ │ Help: oflag= is one of direct, directory, dsync, sync, nocache, nonblock, noatime, noctty, nofollow, append or seek_bytes ───╯
An unknown key is underlined without its value, since the value is not what was rejected:
Before:
$ dd zap=1
dd: unrecognized operand 'zap=1'
After:
$ dd zap=1 dd: unrecognized operand 'zap=1' ╭─[ dd:1:4 ] │ 1 │ dd zap=1 │ ─── │ │ Help: an operand is KEY=VALUE, as in if=file bs=4k count=10 ───╯
A number that does not fit is rejected rather than quietly clamped, and the caret covers the whole value:
Before:
$ dd count=99999999999999999999999
dd: invalid number: '99999999999999999999999': Value too large for defined data type
After:
$ dd count=99999999999999999999999 dd: invalid number: '99999999999999999999999': Value too large for defined data type ╭─[ dd:1:10 ] │ 1 │ dd count=99999999999999999999999 │ ─────────────────────── │ │ Help: a number may be followed by a multiplier: c, w, b, then K, M, G and so on for 1024, kB, MB, GB for 1000 ───╯
Compatibility
This is strictly an interactive nicety; nothing that reads our output can tell the difference:
- Reports are only rendered when stderr is a terminal, unless
UUTILS_DIAGsays otherwise (see below). In a script, a pipe, or a test harness, the utility keeps printing its plain one-line message, so existing scripts that match on stderr keep working. - A report is drawn only when the error can be tied to something on the command line. When it cannot - the error is not about any one argument, or the operand it names was rewritten or consumed before it could be located - the plain one-line message is printed instead, even at a terminal. A utility in the table below therefore reports the parse errors it can place, not every error it has.
- Exit codes are unchanged, and so is the
Try '... --help'hint: an error that is a usage error still prints it under the report. - Colors follow the usual conventions: they are used only on a terminal, and
NO_COLORdisables them. - All messages, labels and help lines are localized like the rest of uutils (see Localization).
- The rendering can be compiled out entirely: it sits behind the
feat_diagnosticscargo feature, which is on by default. Building with--no-default-features(plus afeat_os_*selection) drops the renderer and itsariadnedependency, and every utility keeps its plain one-line messages.
Turning it on and off
The default keys off stderr being a terminal, and nothing else - which is
usually what you want, but not always. UUTILS_DIAG overrides it:
| Value | Effect |
|---|---|
always | Draw the report even when stderr is a file or a pipe. |
never | Keep the plain one-line message even at a terminal. |
auto, unset, anything else | Decide from stderr, as above. |
An unrecognized value is deliberately not an error - this is the kind of variable that gets exported from a shell profile once and forgotten, and no spelling of it should be able to make a utility fail.
always is the one to reach for when the error has to leave the terminal
it happened in - a CI log, or a report to paste into a bug:
$ UUTILS_DIAG=always sort -k2.3x notes.txt 2> parse.log
Colors are a separate question, and one the terminal still answers: a report
forced into a file is written without them, so nothing has to strip escape
sequences back out. NO_COLOR is the middle setting
at a terminal - the report is still drawn, just in plain text.
Without the variable, both directions are still one command away. To get the plain line while sitting at a terminal, send stderr somewhere that is not one:
$ sort -k2.3x notes.txt 2>&1 | cat
sort: stray character in field spec: invalid field specification '2.3x'
And to get a report out of a command that has to run under a real terminal,
give it a pty with script -qec "..." /dev/null, or unbuffer from expect.
Supported utilities
| Utility | What the caret points at | Try it |
|---|---|---|
test | the argument that made the expression fail | test 7 -eq zap |
expr | the argument that made the expression fail | expr 9 + foo |
chmod | the failing clause (or character) of an invalid symbolic or octal mode | chmod 'g+rw?x' fruits.txt |
mkdir | the failing part of the mode given to -m/--mode | mkdir -m u+q mydir |
mkfifo | the failing part of the mode given to -m/--mode | mkfifo -m u+q mypipe |
mknod | the failing part of the mode given to -m/--mode | mknod -m u+q mydev c 1 3 |
install | the failing part of the mode given to -m/--mode | install -m u+q fruits.txt dest |
tr | the part of a set that is at fault (bad class, backwards range, bad repeat count, …) | tr 'qw[y-b]' x |
sort | the failing part of a -k/--key or field specification, or of the SIZE given to -S | sort -k2.3x fruits.txt |
numfmt | the failing part of a --field or --format specification | numfmt --format=%q 1000 |
printf | the failing conversion or escape in the format string | printf %5.2c q |
seq | the failing conversion in the format given to -f/--format | seq -f %5.2c 1 3 |
stat | the failing directive of a -c/--format or --printf format | stat -c %d%.3 fruits.txt |
env | the failing part of a -S/--split-string string | env -S 'echo ${1FOO}' |
dd | the failing key, value or flag of a KEY=VALUE operand | dd conv=ucase,zap |
join | the failing field of the output format given to -o | join -o 1.2,2.x fruits.txt fruits.txt |
cut | the failing range in the list given to -b, -c, -f or -F | cut -f 1,4-2 fruits.txt |
csplit | the failing pattern operand, the character of its regex that broke, or the format given to -b/-n | csplit fruits.txt '/a(b/' |
split | the failing part of the SIZE given to -b, -C or -l | split -b 7zq fruits.txt |
shred | the failing part of the SIZE given to -s/--size | shred -s 4vv fruits.txt |
head | the failing part of the SIZE given to -c or -n | head -c 1fb fruits.txt |
tail | the failing part of the SIZE given to -c or -n | tail -c 1fb fruits.txt |
truncate | the failing part of the SIZE given to -s/--size | truncate -s 10fb fruits.txt |
od | the failing part of the SIZE given to -j, -N, -S or -w | od -N 3zz fruits.txt |
du | the failing part of the SIZE given to -B/--block-size or -t/--threshold | du -B 1fb |
df | the failing part of the SIZE given to -B/--block-size | df -B 1fb |
ls | the failing part of the SIZE given to --block-size (also dir and vdir) | ls --block-size=1fb |
stdbuf | the failing part of the buffering mode given to -i, -o or -e | stdbuf -o 6pq head |
How it works
The rendering lives in uucore::features::diagnostics and is built on
ariadne. A utility that opts in:
- Takes a
Snapshotof its argument list. The snapshot joins the arguments into one line (quoting where needed, and rendering non-UTF-8 arguments the way the shell would) and remembers the byte range of each argument. - Maps its own error type to a position, and optionally a label and a line
of advice, in a small per-utility
diagnostics.rsmodule. A label is only used when it adds something the message does not say - an expectation, or a fix such as tr’sdid you mean 'b-y'?- never to restate it; with no label the span is drawn as a bare underline. Everything user-facing is passed in already localized. - Locates the argument the operand came from - with
Snapshot::index_of_valuefor an option’s value in whatever spelling it was given (-k 2.3x,-k2.3x,-rk2.3x,--key 2.3x,--key=2.3x),Snapshot::index_of_positionalfor a positional operand, or an index the utility tracked itself - and callsSnapshot::renderto point at the whole argument, orSnapshot::render_inside_atto point at a byte range inside the operand it carries. Because the argument is named rather than searched for, a file, another option, or the program name that happens to share the operand’s text can never take the caret.Snapshot::render_option_valuedoes the two steps in one, which is what most option values want.
An argument holding a space is echoed back quoted, and the caret still points inside it: the quotes only wrap the operand, so its bytes are found where they were printed and offsets count from there. An argument that could not be printed as-is - a non-UTF-8 one, or one whose quoting had to be broken up - is underlined as a whole instead, since no offset into it would line up with what the reader sees.
Callers check diagnostics::enabled() first, so the non-interactive path
costs nothing and keeps its GNU-compatible message.
Errors that come out of a shared parser are rendered by a shared helper, so that a syntax common to several utilities is explained the same way in all of them, and its labels live in the common locale strings rather than being repeated per utility. Three parsers work this way:
- Modes (
uucore::mode), forchmod,mkdir,mkfifo,mknodandinstall. - Range lists (
uucore::ranges), forcut’s-b,-cand-fand fornumfmt --field.Range::from_listreports which item of the list failed and where it sat. - Sizes (
uucore::parser::parse_size), forhead,tail,truncate,split,shred,stdbuf,sort,od,du,dfandls(withdirandvdir) today, and available to the other callers of the parser.ParseSizeError::spanworks out from the operand which of its two parts - the number or the unit - was rejected, so the error type keeps the shape its callers build by hand.
Taking modes as the worked example: the parser reports errors as a structured
ModeError carrying the byte range at fault, and its rendering places the
caret for every utility that takes a mode - ModeError::render_option_value
finds the mode as the value of -m/--mode for mkdir, mkfifo, mknod
and install, while chmod, which accepts modes clap cannot see (such as
chmod -w -r file), tracks where each mode operand sat and passes the index
to ModeError::render_at.
Multi-call binary
uutils includes a multi-call binary from which the utils can be invoked. This reduces the binary size of the binary and can be useful for portability.
The first argument of the multi-call binary is the util to run, after which the regular arguments to the util can be passed.
coreutils [util] [util options]
The --help flag will print a list of available utils.
Example
coreutils ls -l
arch
arch
Afficher l’architecture de la machine
Options
Déterminer le nom de l’architecture pour la machine actuelle.
Examples
Affiche la documentation de la commande originale :
tldr uname
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
b2sum
b2sum [OPTION]... [FICHIER]...
Afficher le BLAKE2b et la taille de chaque fichier
Options
--binary,-b--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--length,-l-
ck-common-help-length
--tag-
ck-common-help-tag
--text,-t--zero,-z-
ck-common-help-zero
Examples
Calcule la somme de contrôle BLAKE2 d’un fichier :
b2sum {{chemin/vers/fichier}}
Calcule les sommes de contrôle BLAKE2 pour plusieurs fichiers :
b2sum {{chemin/vers/fichier1 chemin/vers/fichier2 ...}} >{{chemin/vers/fichier.b2}}
Calcule la somme de contrôle BLAKE2 depuis stdin :
{{commande}} | b2sum
Lis un fichier contenant des sommes de contrôle BLAKE2 et des noms de fichier et vérifie que tous les fichiers ont des sommes de contrôle correspondantes :
b2sum --check {{chemin/vers/fichier.b2}}
Affiche un message uniquement pour les fichiers manquants ou lorsque la vérification échoue :
b2sum --check --quiet {{chemin/vers/fichier.b2}}
N’affiche un message que pour les fichiers pour lesquels la vérification a échoué, en ignorant les fichiers manquants :
b2sum --ignore-missing --check --quiet {{chemin/vers/fichier.b2}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
base32
base32 [OPTION]... [FICHIER]
encoder/décoder les données et les imprimer sur la sortie standard Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Les données sont encodées comme décrit pour l’alphabet base32 dans RFC 4648. Lors du décodage, l’entrée peut contenir des retours à la ligne en plus des octets de l’alphabet base32 formel. Utilisez –ignore-garbage pour tenter de récupérer des autres octets non-alphabétiques dans le flux encodé.
Options
--decode,-d,-D-
base-common-help-decode
--ignore-garbage,-i-
base-common-help-ignore-garbage
--wrap=<COLS>,-w <COLS>-
base-common-help-wrap
Examples
Encode un fichier :
base32 {{chemin/vers/fichier}}
Enveloppe la sortie codée à une largeur spécifique (0 désactive l’enveloppement) :
base32 {{[-w|--wrap]}} {{0|76|...}} {{chemin/vers/fichier}}
Décode un fichier :
base32 {{[-d|--decode]}} {{chemin/vers/fichier}}
Encode depuis stdin :
{{commande}} | base32
Décode depuis stdin :
{{commande}} | base32 {{[-d|--decode]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
base64
base64 [OPTION]... [FICHIER]
encoder/décoder les données et les imprimer sur la sortie standard Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Les données sont encodées comme décrit pour l’alphabet base64 dans RFC 3548. Lors du décodage, l’entrée peut contenir des retours à la ligne en plus des octets de l’alphabet base64 formel. Utilisez –ignore-garbage pour tenter de récupérer des autres octets non-alphabétiques dans le flux encodé.
Options
--decode,-d,-D-
base-common-help-decode
--ignore-garbage,-i-
base-common-help-ignore-garbage
--wrap=<COLS>,-w <COLS>-
base-common-help-wrap
Examples
Encode un fichier :
base64 {{chemin/vers/fichier}}
Enveloppe la sortie codée à une largeur spécifique (0 désactive l’enveloppement) :
base64 {{[-w|--wrap]}} {{0|76|...}} {{chemin/vers/fichier}}
Décode un fichier :
base64 {{[-d|--decode]}} {{chemin/vers/fichier}}
Encode depuis stdin :
{{commande}} | base64
Décode depuis stdin :
{{commande}} | base64 {{[-d|--decode]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
basename
basename [-z] NOM [SUFFIXE]
basename OPTION... NOM...
Affiche NOM sans les composants de répertoire précédents Si spécifié, supprime également un SUFFIXE final
Options
--multiple,-a-
support multiple arguments and treat each as a NAME
--suffix=<SUFFIX>,-s <SUFFIX>-
remove a trailing SUFFIX; implies -a
--zero,-z-
end each output line with NUL, not newline
Examples
N’affiche que le nom du fichier depuis un chemin :
basename {{chemin/vers/fichier}}
N’affiche que le nom du dernier répertoire depuis un chemin :
basename {{chemin/vers/répertoire/}}
N’affiche que le nom du fichier depuis un chemin, en ôtant un préfixe donné :
basename {{chemin/vers/fichier}} {{suffixe}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
basenc
basenc [OPTION]... [FICHIER]
Encoder/décoder des données et afficher vers la sortie standard Sans FICHIER, ou lorsque FICHIER est -, lire l’entrée standard.
Lors du décodage, l’entrée peut contenir des nouvelles lignes en plus des octets de l’alphabet formel. Utilisez –ignore-garbage pour tenter de récupérer depuis tout autre octet non-alphabétique dans le flux encodé.
Options
--decode,-d,-D-
base-common-help-decode
--ignore-garbage,-i-
base-common-help-ignore-garbage
--wrap=<COLS>,-w <COLS>-
base-common-help-wrap
--base64-
identique au programme ‘base64’
--base64url-
base64 sécurisé pour fichiers et URLs
--base32-
identique au programme ‘base32’
--base32hex-
base32 avec alphabet hexadécimal étendu
--base16-
encodage hexadécimal
--base2lsbf-
chaîne de bits avec le bit de poids faible (lsb) en premier
--base2msbf-
chaîne de bits avec le bit de poids fort (msb) en premier
--z85-
encodage de type ascii85 ;
lors de l’encodage, la longueur d’entrée doit être un multiple de 4 ;
lors du décodage, la longueur d’entrée doit être un multiple de 5 --base58-
encodage base58 visuellement non ambigu
Examples
Encode a file with Base64 encoding:
basenc --base64 {{path/to/file}}
Decode a file with Base64 encoding:
basenc {{[-d|--decode]}} --base64 {{path/to/file}}
Encode from stdin with Base32 encoding with 42 columns:
{{command}} | basenc --base32 {{[-w|--wrap]}} 42
Encode from stdin with Base32 encoding:
{{command}} | basenc --base32
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
cat
cat [OPTION]... [FICHIER]...
Concaténer les FICHIER(s), ou l’entrée standard, vers la sortie standard Si aucun FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Options
--show-all,-A-
equivalent to -vET
--number-nonblank,-b-
number nonempty output lines, overrides -n
-e-
equivalent to -vE
--show-ends,-E-
display $ at end of each line
--number,-n-
number all output lines
--squeeze-blank,-s-
suppress repeated empty output lines
-t-
equivalent to -vT
--show-tabs,-T-
display TAB characters at ^I
--show-nonprinting,-v-
use ^ and M- notation, except for LF (\n) and TAB (\t)
-u-
(ignored)
Examples
Print the contents of a file to stdout:
cat {{path/to/file}}
Concatenate several files into an output file:
cat {{path/to/file1 path/to/file2 ...}} >{{path/to/output_file}}
Append several files to an output file:
cat {{path/to/file1 path/to/file2 ...}} >>{{path/to/output_file}}
Write to a file interactively:
cat >{{path/to/file}}
Number all output lines:
cat {{[-n|--number]}} {{path/to/file}}
Display all characters, including tabs, line endings, and non-printing characters:
cat {{[-A|--show-all]}} {{path/to/file}}
Omit repeating empty lines:
cat {{[-s|--squeeze-blank]}} {{path/to/file}}
Pass file contents to another program through stdin:
cat {{path/to/file}} | {{program}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
chcon
chcon [OPTION]... CONTEXTE FICHIER...
chcon [OPTION]... [-u UTILISATEUR] [-r RÔLE] [-l PLAGE] [-t TYPE] FICHIER...
chcon [OPTION]... --reference=RFICHIER FICHIER...
Changer le contexte de sécurité SELinux de chaque FICHIER vers CONTEXTE. Avec –reference, changer le contexte de sécurité de chaque FICHIER vers celui de RFICHIER.
Options
--dereference-
Affecter la cible de chaque lien symbolique (par défaut), plutôt que le lien symbolique lui-même.
--no-dereference,-h-
Affecter les liens symboliques au lieu de tout fichier référencé.
--help-
help
--preserve-root-
Échouer lors de l’opération récursive sur ‘/’.
--no-preserve-root-
Ne pas traiter ‘/’ spécialement (par défaut).
--reference=<RFILE>-
Utiliser le contexte de sécurité de RFICHIER, plutôt que de spécifier une valeur CONTEXTE.
--user=<USER>,-u <USER>-
Définir l’utilisateur UTILISATEUR dans le contexte de sécurité cible.
--role=<ROLE>,-r <ROLE>-
Définir le rôle RÔLE dans le contexte de sécurité cible.
--type=<TYPE>,-t <TYPE>-
Définir le type TYPE dans le contexte de sécurité cible.
--range=<RANGE>,-l <RANGE>-
Définir la plage PLAGE dans le contexte de sécurité cible.
--recursive,-R-
Opérer sur les fichiers et répertoires de manière récursive.
-H-
Si un argument de ligne de commande est un lien symbolique vers un répertoire, le traverser. Valide uniquement quand -R est spécifié.
-L-
Traverser chaque lien symbolique vers un répertoire rencontré. Valide uniquement quand -R est spécifié.
-P-
Ne traverser aucun lien symbolique (par défaut). Valide uniquement quand -R est spécifié.
--verbose,-v-
Afficher un diagnostic pour chaque fichier traité.
Examples
Affiche le contexte de sécurité d’un fichier :
ls {{[-lZ|-l --context]}} {{chemin/vers/fichier}}
Change le contexte de sécurité d’un fichier cible, en utilisant un fichier de référence :
chcon --reference {{fichier_référence}} {{fichier_cible}}
Change le contexte de sécurité SELinux complet d’un fichier :
chcon {{utilisateur}}:{{role}}:{{type}}:{{range/level}} {{fichier}}
Change seulement la partie utilisateur du contexte de sécurité SELinux :
chcon {{[-u|--user]}} {{utilisateur}} {{fichier}}
Change seulement la partie role du contexte de sécurité SELinux :
chcon {{[-r|--role]}} {{role}} {{fichier}}
Change seulement la partie type du contexte de sécurité SELinux :
chcon {{[-t|--type]}} {{type}} {{fichier}}
Change seulement la partie plage/niveau du contexte de sécurité SELinux :
chcon {{[-l|--range]}} {{plage/niveau}} {{fichier}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
chgrp
chgrp [OPTION]... GROUPE FICHIER...
chgrp [OPTION]... --reference=RFICHIER FICHIER...
Changer le groupe de chaque FICHIER vers GROUPE.
Options
--help-
Afficher les informations d’aide.
--changes,-c-
comme verbeux mais rapporter seulement lors d’un changement
--silent,-f--quiet-
supprimer la plupart des messages d’erreur
--verbose,-v-
afficher un diagnostic pour chaque fichier traité
--preserve-root-
échouer à opérer récursivement sur ‘/’
--no-preserve-root-
ne pas traiter ‘/’ spécialement (par défaut)
--reference=<RFILE>-
utiliser le groupe de RFICHIER plutôt que spécifier les valeurs de GROUPE
--from=<GROUP>-
changer le groupe seulement si son groupe actuel correspond à GROUPE
--recursive,-R-
opérer sur les fichiers et répertoires récursivement
-H-
if a command line argument is a symbolic link to a directory, traverse it
-L-
traverse every symbolic link to a directory encountered
-P-
do not traverse any symbolic links (default)
--dereference-
affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
--no-dereference,-h-
affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)
Examples
Change le groupe propriétaire d’un fichier/répertoire :
chgrp {{groupe}} {{chemin/vers/fichier_ou_répertoire}}
Change récursivement le groupe propriétaire d’un répertoire et de son contenu :
chgrp {{[-R|--recursive]}} {{groupe}} {{chemin/vers/répertoire}}
Change le groupe propriétaire d’un lien symbolique :
chgrp {{[-h|--no-dereference]}} {{groupe}} {{chemin/vers/lien_symbolique}}
Modifie le groupe propriétaire d’un fichier/répertoire pour qu’il corresponde à un fichier de référence :
chgrp --reference {{chemin/vers/fichier_référence}} {{chemin/vers/fichier_ou_répertoire}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
chmod
chmod [OPTION]... MODE[,MODE]... FICHIER...
chmod [OPTION]... MODE-OCTAL FICHIER...
chmod [OPTION]... --reference=RFICHIER FICHIER...
Changer le mode de chaque FICHIER vers MODE. Avec –reference, changer le mode de chaque FICHIER vers celui de RFICHIER.
Options
--help-
Print help information.
--changes,-c-
like verbose but report only when a change is made
--quiet,--silent,-f-
suppress most error messages
--verbose,-v-
output a diagnostic for every file processed
--no-preserve-root-
do not treat ‘/’ specially (the default)
--preserve-root-
fail to operate recursively on ‘/’
--recursive,-R-
change files and directories recursively
--reference-
use RFILE’s mode instead of MODE values
-H-
if a command line argument is a symbolic link to a directory, traverse it
-L-
traverse every symbolic link to a directory encountered
-P-
do not traverse any symbolic links (default)
--dereference-
affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
--no-dereference,-h-
affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)
Chaque MODE est de la forme [ugoa]*(-+=)+|[-+=]?[0-7]+.
Examples
Donne les droits d’e[x]écution à l’[u]tilisateur auquel le fichier appartient :
chmod u+x {{chemin/vers/fichier}}
Donne à l’[u]tilisateur les droits de lecture [r] et d’écriture [w] sur un fichier/répertoire :
chmod u+rw {{chemin/vers/fichier_ou_répertoire}}
Enlève les droits d’e[x]écution pour le [g]roupe :
chmod g-x {{chemin/vers/fichier}}
Donne à tous [a] les utilisateurs les droits de lecture [r] et d’e[x]écution :
chmod a+rx {{chemin/vers/fichier}}
Donne aux autres [o] utilisateurs (qui sont dans un autre groupe) les mêmes droits que ceux du [g]roupe propriétaire :
chmod o=g {{chemin/vers/fichier}}
Retire tous les droits aux autres [o] utilisateurs :
chmod o= {{chemin/vers/fichier}}
Modifie les permissions récursivement en donnant aux membres du [g]roupe et aux autres [o] utilisateurs le droit d’écriture [w] :
chmod {{[-R|--recursive]}} g+w,o+w {{chemin/vers/répertoire}}
Donne récursivement à tous [a] les utilisateurs les droits de lecture [r] de fichiers et d’e[X]écution de sous-répertoires à l’intérieur d’un répertoire :
chmod {{[-R|--recursive]}} a+rX {{chemin/vers/répertoire}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
chown
chown [OPTION]... [PROPRIÉTAIRE][:[GROUPE]] FICHIER...
chown [OPTION]... --reference=RFICHIER FICHIER...
Changer le propriétaire et le groupe des fichiers
Options
--help-
Print help information.
--changes,-c-
like verbose but report only when a change is made
--from=<CURRENT_OWNER:CURRENT_GROUP>-
change the owner and/or group of each file only if its
current owner and/or group match those specified here.
Either may be omitted, in which case a match is not required
for the omitted attribute --preserve-root-
fail to operate recursively on ‘/’
--no-preserve-root-
do not treat ‘/’ specially (the default)
--quiet-
suppress most error messages
--recursive,-R-
operate on files and directories recursively
--reference=<RFILE>-
use RFILE’s owner and group rather than specifying OWNER:GROUP values
--silent,-f--verbose,-v-
output a diagnostic for every file processed
-H-
if a command line argument is a symbolic link to a directory, traverse it
-L-
traverse every symbolic link to a directory encountered
-P-
do not traverse any symbolic links (default)
--dereference-
affect the referent of each symbolic link (this is the default), rather than the symbolic link itself
--no-dereference,-h-
affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)
Examples
Modifie le propriétaire d’un fichier/dossier :
chown {{utilisateur}} {{chemin/vers/fichier_ou_dossier}}
Modifie l’utilisateur et le groupe propriétaire d’un fichier/dossier :
chown {{utilisateur}}:{{groupe}} {{chemin/vers/fichier_ou_dossier}}
Modifie le propriétaire et le groupe pour qu’ils aient tous les deux le nom utilisateur :
chown {{utilisateur}}: {{chemin/vers/fichier_ou_dossier}}
Modifie récursivement le propriétaire d’un dossier et de son contenu :
chown {{[-R|--recursive]}} {{utilisateur}} {{chemin/vers/dossier}}
Modifie le propriétaire d’un lien symbolique :
chown {{[-h|--no-dereference]}} {{utilisateur}} {{chemin/vers/lien_symbolique}}
Modifie le propriétaire d’un fichier / dossier pour correspondre à un fichier de référence :
chown --reference {{chemin/vers/fichier_de_référence}} {{chemin/vers/fichier_ou_dossier}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
chroot
chroot [OPTION]... NOUVRACINE [COMMANDE [ARG]...]
Exécuter COMMANDE avec le répertoire racine défini à NOUVRACINE.
Options
--groups=<GROUP1,GROUP2...>-
Liste de groupes séparés par des virgules vers lesquels basculer
--userspec=<USER:GROUP>-
Utilisateur et groupe séparés par deux-points vers lesquels basculer.
--skip-chdir-
Utiliser cette option pour ne pas changer le répertoire de travail vers / après avoir changé le répertoire racine vers nouvracine, c.-à-d., à l’intérieur du chroot.
Examples
Exécute la commande en tant que nouveau répertoire racine :
chroot {{chemin/vers/nouveau/répertoire/racine}} {{command}}
Spécifie l’utilisateur et le groupe (ID ou nom) à utiliser :
chroot --userspec={{utilisateur:groupe}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
cksum
cksum [OPTION]... [FICHIER]...
Afficher le CRC et la taille de chaque fichier
Options
--algorithm=<ALGORITHM>,-a <ALGORITHM>-
ck-common-help-algorithm
--untagged-
ck-common-help-untagged
--tag-
ck-common-help-tag-default
--length,-l-
ck-common-help-length
--raw-
ck-common-help-raw
--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--base64-
ck-common-help-base64
--text,-t--binary,-b--zero,-z-
ck-common-help-zero
--debug-
ck-common-help-debug
DIGEST détermine l’algorithme de condensé et le format de sortie par défaut :
- sysv : (équivalent à sum -s)
- bsd : (équivalent à sum -r)
- crc : (équivalent à cksum)
- crc32b : (disponible uniquement via cksum)
- md5 : (équivalent à md5sum)
- sha1 : (équivalent à sha1sum)
- sha2: (équivalent à sha{224,256,384,512}sum)
- sha3 : (disponible uniquement via cksum)
- blake2b : (équivalent à b2sum)
- sm3 : (disponible uniquement via cksum)
Examples
Display a 32-bit checksum, size in bytes, and filename:
cksum {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
comm
comm [OPTION]... FICHIER1 FICHIER2
Comparer deux fichiers triés ligne par ligne.
Lorsque FICHIER1 ou FICHIER2 (pas les deux) est -, lire l’entrée standard.
Sans options, produit une sortie à trois colonnes. La colonne un contient les lignes uniques à FICHIER1, la colonne deux contient les lignes uniques à FICHIER2, et la colonne trois contient les lignes communes aux deux fichiers.
Options
-1-
suppress column 1 (lines unique to FILE1)
-2-
suppress column 2 (lines unique to FILE2)
-3-
suppress column 3 (lines that appear in both files)
--output-delimiter=<STR>-
separate columns with STR
--zero-terminated,-z-
line delimiter is NUL, not newline
--total-
output a summary
--check-order-
check that the input is correctly sorted, even if all input lines are pairable
--nocheck-order-
do not check that the input is correctly sorted
Examples
Produce three tab-separated columns: lines only in first file, lines only in second file, and common lines:
comm {{file1}} {{file2}}
Print only lines common to both files:
comm -12 {{file1}} {{file2}}
Print only lines common to both files, reading one file from stdin:
cat {{file1}} | comm -12 - {{file2}}
Get lines only found in first file, saving the result to a third file:
comm -23 {{file1}} {{file2}} >{{file1_only}}
Print lines only found in second file, when the files aren’t sorted:
comm -13 <(sort {{file1}}) <(sort {{file2}})
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
cp
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... RÉPERTOIRE
cp [OPTION]... -t RÉPERTOIRE SOURCE...
Copier SOURCE vers DEST, ou plusieurs SOURCE(s) vers RÉPERTOIRE.
Options
--target-directory=<target-directory>,-t <target-directory>-
copier tous les arguments SOURCE dans le répertoire cible
--no-target-directory,-T-
Traiter DEST comme un fichier régulier et non comme un répertoire
--interactive,-i-
demander avant d’écraser les fichiers
--link,-l-
créer des liens durs au lieu de copier
--no-clobber,-n-
ne pas écraser un fichier qui existe déjà
--recursive,-R,-r-
copier les répertoires récursivement
--strip-trailing-slashes-
supprimer les barres obliques finales de chaque argument SOURCE
--debug-
expliquer comment un fichier est copié. Implique -v
--verbose,-v-
indiquer explicitement ce qui est fait
--symbolic-link,-s-
créer des liens symboliques au lieu de copier
--force,-f-
si un fichier de destination existant ne peut pas être ouvert, le supprimer et réessayer (cette option est ignorée lorsque l’option -n est également utilisée). Actuellement non implémenté pour Windows.
--remove-destination-
supprimer chaque fichier de destination existant avant de tenter de l’ouvrir (contraste avec –force). Sur Windows, ne fonctionne actuellement que pour les fichiers inscriptibles.
--backup=<CONTROL>-
make a backup of each existing destination file
-b-
like –backup but does not accept an argument
--suffix=<SUFFIX>,-S <SUFFIX>-
override the usual backup suffix
--update-
move only when the SOURCE file is newer than the destination file or when the destination file is missing
-u-
like –update but does not accept an argument
--reflink=<WHEN>-
contrôler les copies clone/CoW. Voir ci-dessous
--attributes-only-
Ne pas copier les données du fichier, juste les attributs
--preserve=<ATTR_LIST>-
Préserver les attributs spécifiés (par défaut : mode, propriété (unix uniquement), horodatages), si possible attributs supplémentaires : contexte, liens, xattr, all
--preserve-default-attributes,-p-
identique à –preserve=mode,ownership(unix uniquement),timestamps
--no-preserve=<ATTR_LIST>-
ne pas préserver les attributs spécifiés
--parents-
utiliser le nom complet du fichier source sous RÉPERTOIRE
--no-dereference,-P-
ne jamais suivre les liens symboliques dans SOURCE
--dereference,-L-
toujours suivre les liens symboliques dans SOURCE
-H-
suivre les liens symboliques de la ligne de commande dans SOURCE
--archive,-a-
Identique à -dR –preserve=all
-d-
identique à –no-dereference –preserve=links
--one-file-system,-x-
rester sur ce système de fichiers
--sparse=<WHEN>-
contrôler la création de fichiers épars. Voir ci-dessous
-Z-
définir le contexte de sécurité SELinux du fichier de destination au type par défaut
--context=<CTX>-
comme -Z, ou si CTX est spécifié, définir le contexte de sécurité SELinux ou SMACK à CTX
--progress,-g-
Afficher une barre de progression. Note : cette fonctionnalité n’est pas prise en charge par GNU coreutils.
--copy-contents-
Non implémenté : copier le contenu des fichiers spéciaux lors de la récursion
Ne pas copier un non-répertoire qui a une destination existante avec le même horodatage de modification ou plus récent ; à la place, ignorer silencieusement le fichier sans échec. Si les horodatages sont préservés, la comparaison est faite avec l’horodatage source tronqué aux résolutions du système de fichiers de destination et des appels système utilisés pour mettre à jour les horodatages ; cela évite le travail en double si plusieurs commandes cp -pu sont exécutées avec la même source et destination. Cette option est ignorée si l’option -n ou –no-clobber est également spécifiée. De plus, si –preserve=links est également spécifié (comme avec cp -au par exemple), cela aura la priorité ; par conséquent, selon l’ordre dans lequel les fichiers sont traités depuis la source, les fichiers plus récents dans la destination peuvent être remplacés, pour refléter les liens durs dans la source. ce qui donne plus de contrôle sur les fichiers existants dans la destination qui sont remplacés, et sa valeur peut être l’une des suivantes :
- all C’est l’opération par défaut lorsqu’une option –update n’est pas spécifiée, et entraîne le remplacement de tous les fichiers existants dans la destination.
- none Cela est similaire à l’option –no-clobber, en ce sens qu’aucun fichier dans la destination n’est remplacé, mais ignorer un fichier n’induit pas d’échec.
- older C’est l’opération par défaut lorsque –update est spécifié, et entraîne le remplacement des fichiers s’ils sont plus anciens que le fichier source correspondant.
Examples
Copier un fichier vers un autre emplacement :
cp {{chemin/vers/fichier_source.ext}} {{chemin/vers/fichier_cible.ext}}
Copier un fichier vers un autre répertoire en conservant le nom du fichier :
cp {{chemin/vers/fichier_source.ext}} {{chemin/vers/répertoire_parent_cible}}
Copier récursivement le contenu d’un répertoire vers un autre emplacement (si la destination existe, le répertoire est copié à l’intérieur) :
cp -R {{chemin/vers/répertoire_source}} {{chemin/vers/répertoire_cible}}
Copier un répertoire récursivement, en mode verbeux (affiche les fichiers au fur et à mesure de leur copie) :
cp -vR {{chemin/vers/répertoire_source}} {{chemin/vers/répertoire_cible}}
Copier les fichiers texte vers un autre emplacement, en mode interactif (demande confirmation avant d’écraser) :
cp -i {{*.txt}} {{chemin/vers/répertoire_cible}}
Déréférencer les liens symboliques avant de copier :
cp -L {{link}} {{chemin/vers/répertoire_cible}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
csplit
csplit [OPTION]... FICHIER MOTIF...
Diviser un fichier en sections déterminées par des lignes de contexte
Options
--suffix-format=<FORMAT>,-b <FORMAT>-
utiliser le FORMAT sprintf au lieu de %02d
--prefix=<PREFIX>,-f <PREFIX>-
utiliser PRÉFIXE au lieu de ‘xx’
--keep-files,-k-
ne pas supprimer les fichiers de sortie en cas d’erreurs
--suppress-matched-
supprimer les lignes correspondant au MOTIF
--digits=<DIGITS>,-n <DIGITS>-
utiliser le nombre spécifié de chiffres au lieu de 2
--quiet,--silent,-q,-s-
ne pas afficher le nombre d’octets des fichiers de sortie
--elide-empty-files,-z-
supprimer les fichiers de sortie vides
Sortir les morceaux de FICHIER séparés par MOTIF(S) dans les fichiers ‘xx00’, ‘xx01’, …, et sortir le nombre d’octets de chaque morceau sur la sortie standard.
Examples
Split a file in two parts, starting the second one at line 10:
csplit {{path/to/file}} 10
Split a file in three parts, starting the latter parts in lines 7 and 23:
csplit {{path/to/file}} 7 23
Start a new part at every 5th line (will fail if number of lines is not divisible by 5):
csplit {{path/to/file}} 5 {*}
Start a new part at every 5th line, ignoring exact-division error:
csplit {{[-k|--keep-files]}} {{path/to/file}} 5 {*}
Split a file above line 5 and use a custom prefix for the output files (default is xx):
csplit {{path/to/file}} 5 {{[-f|--prefix]}} {{prefix}}
Split a file above the first line matching a regex pattern:
csplit {{path/to/file}} /{{regex}}/
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
cut
cut OPTION... [FICHIER]...
Affiche les colonnes d’octets ou de champs spécifiées de chaque ligne de stdin ou des fichiers d’entrée
Options
--bytes=<LIST>,-b <LIST>-
filtrer les colonnes d’octets depuis la source d’entrée
--characters=<LIST>,-c <LIST>-
alias pour le mode caractère
--delimiter=<DELIM>,-d <DELIM>-
spécifier le caractère délimiteur qui sépare les champs dans la source d’entrée. Par défaut Tab.
--whitespace-delimited=<trimmed>,-w <trimmed>-
Utiliser tout nombre d’espaces (Espace, Tab) pour séparer les champs dans la source d’entrée (extension FreeBSD).
--fields=<LIST>,-f <LIST>-
filtrer les colonnes de champs depuis la source d’entrée
-F <LIST>-
comme -f, mais fusionner les délimiteurs adjacents ; le délimiteur par défaut est l’espace blanc et le délimiteur de sortie une espace
--complement-
inverser le filtre - au lieu d’afficher seulement les colonnes filtrées, afficher toutes sauf ces colonnes
--only-delimited,-s-
en mode champ, afficher seulement les lignes qui contiennent le délimiteur
--zero-terminated,-z-
au lieu de filtrer les colonnes basées sur la ligne, filtrer les colonnes basées sur \0 (caractère NULL)
--output-delimiter=<NEW_DELIM>,-O <NEW_DELIM>-
en mode champ, remplacer le délimiteur dans les lignes de sortie avec l’argument de cette option
--no-partial,-n-
avec -b, ne pas afficher de caractères multi-octets partiels
Chaque appel doit spécifier un mode (quoi utiliser pour les colonnes), une séquence (quelles colonnes afficher), et fournir une source de données
Spécifier un mode
Utilisez –bytes (-b) ou –characters (-c) pour spécifier le mode octet
Utilisez –fields (-f) pour spécifier le mode champ, où chaque ligne est divisée en champs identifiés par un caractère délimiteur. Par exemple pour un CSV typique vous pourriez utiliser ceci en combinaison avec la définition de la virgule comme délimiteur
Spécifier une séquence
Une séquence est un groupe de 1 ou plusieurs nombres ou plages inclusives séparés par des virgules.
cut -f 2,5-7 quelque_fichier.txt
affichera les 2ème, 5ème, 6ème, et 7ème champs pour chaque ligne source
Les plages peuvent s’étendre jusqu’à la fin de la ligne en excluant le second nombre
cut -f 3- quelque_fichier.txt
affichera le 3ème champ et tous les champs suivants pour chaque ligne source
Le premier nombre d’une plage peut être exclu, et ceci est effectivement identique à utiliser 1 comme premier nombre : cela fait commencer la plage à la première colonne. Les plages peuvent aussi afficher une seule colonne
cut -f 1,3-5 quelque_fichier.txt
affichera les 1er, 3ème, 4ème, et 5ème champs pour chaque ligne source
L’option –complement, quand utilisée, inverse l’effet de la séquence
cut –complement -f 4-6 quelque_fichier.txt
affichera tous les champs sauf les 4ème, 5ème, et 6ème
Spécifier une source de données
Si aucun argument de fichier source n’est spécifié, stdin est utilisé comme source de lignes à afficher
Si des arguments de fichier source sont spécifiés, stdin est ignoré et tous les fichiers sont lus consécutivement si un fichier source n’est pas lu avec succès, un avertissement sera affiché sur stderr, et le code de statut final sera 1, mais cut continuera à lire les fichiers sources suivants
Pour afficher les colonnes depuis STDIN et un argument de fichier, utilisez - (tiret) comme argument de fichier source pour représenter stdin.
Options du Mode Champ
Les champs dans chaque ligne sont identifiés par un délimiteur (séparateur)
Définir le délimiteur
Définissez le délimiteur qui sépare les champs dans le fichier en utilisant l’option –delimiter (-d). Définir le délimiteur est optionnel. Si non défini, un délimiteur par défaut de Tab sera utilisé.
Si l’option -w est fournie, les champs seront séparés par tout nombre de caractères d’espacement (Espace et Tab). Le délimiteur de sortie sera un Tab sauf si explicitement spécifié. Seulement une des options -d ou -w peut être spécifiée. Ceci est une extension adoptée de FreeBSD.
Filtrage optionnel basé sur le délimiteur
Si l’option –only-delimited (-s) est fournie, seules les lignes qui contiennent le délimiteur seront affichées
Remplacer le délimiteur
Si l’option –output-delimiter est fournie, l’argument utilisé pour elle remplacera le caractère délimiteur dans chaque ligne affichée. Ceci est utile pour transformer les données tabulaires - par ex. pour convertir un CSV en TSV (fichier séparé par tabulations)
Fins de ligne
Quand l’option –zero-terminated (-z) est utilisée, cut voit \0 (null) comme le caractère de ‘fin de ligne’ (à la fois pour lire les lignes et séparer les lignes affichées) au lieu de \n (nouvelle ligne). Ceci est utile pour les données tabulaires où certaines cellules peuvent contenir des nouvelles lignes
echo ‘ab\0cd’ | cut -z -c 1
donnera comme résultat ‘a\0c\0’
Examples
Print the fifth character on each line:
{{command}} | cut {{[-c|--characters]}} 5
Print the fifth to tenth character of each line of the specified file:
cut {{[-c|--characters]}} 5-10 {{path/to/file}}
Split each line in a file by a delimiter into fields and print fields two and six (default delimiter is TAB):
cut {{[-f|--fields]}} 2,6 {{path/to/file}}
Split each line by the specified delimiter and print all from the second field onward:
{{command}} | cut {{[-d|--delimiter]}} "{{delimiter}}" {{[-f|--fields]}} 2-
Use space as a delimiter and print only the first 3 fields:
{{command}} | cut {{[-d|--delimiter]}} " " {{[-f|--fields]}} -3
Only print lines that contain the delimiter:
{{command}} | cut {{[-d|--delimiter]}} "{{:}}" {{[-f|--fields]}} {{1}} {{[-s|--only-delimited]}}
Print specific fields of lines that use NUL to terminate lines instead of newlines:
{{find . -print0}} | cut {{[-z|--zero-terminated]}} {{[-d|--delimiter]}} "{{/}}" {{[-f|--fields]}} {{2}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
date
[OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
FORMAT contrôle la sortie. Les séquences interprétées sont :
| Séquence | Description | Exemple |
| -------- | -------------------------------------------------------------- | ---------------------- |
| %% | un % littéral | % |
| %a | nom abrégé du jour de la semaine selon la locale | dim |
| %A | nom complet du jour de la semaine selon la locale | dimanche |
| %b | nom abrégé du mois selon la locale | jan |
| %B | nom complet du mois selon la locale | janvier |
| %c | date et heure selon la locale | jeu 3 mar 23:05:25 2005|
| %C | siècle ; comme %Y, sauf qu'on omet les deux derniers chiffres | 20 |
| %d | jour du mois | 01 |
| %D | date ; identique à %m/%d/%y | 12/31/99 |
| %e | jour du mois, rempli avec des espaces ; identique à %_d | 3 |
| %F | date complète ; identique à %Y-%m-%d | 2005-03-03 |
| %g | deux derniers chiffres de l'année du numéro de semaine ISO (voir %G) | 05 |
| %G | année du numéro de semaine ISO (voir %V) ; normalement utile seulement avec %V | 2005 |
| %h | identique à %b | jan |
| %H | heure (00..23) | 23 |
| %I | heure (01..12) | 11 |
| %j | jour de l'année (001..366) | 062 |
| %k | heure, remplie avec des espaces ( 0..23) ; identique à %_H | 3 |
| %l | heure, remplie avec des espaces ( 1..12) ; identique à %_I | 9 |
| %m | mois (01..12) | 03 |
| %M | minute (00..59) | 30 |
| %n | une nouvelle ligne | \\n |
| %N | nanosecondes (000000000..999999999) | 123456789 |
| %p | équivalent locale de AM ou PM ; vide si inconnu | PM |
| %P | comme %p, mais en minuscules | pm |
| %q | trimestre de l'année (1..4) | 1 |
| %r | heure sur 12 heures selon la locale | 11:11:04 PM |
| %R | heure sur 24 heures et minute ; identique à %H:%M | 23:30 |
| %s | secondes depuis 1970-01-01 00:00:00 UTC | 1615432800 |
| %S | seconde (00..60) | 30 |
| %t | une tabulation | \\t |
| %T | heure ; identique à %H:%M:%S | 23:30:30 |
| %u | jour de la semaine (1..7) ; 1 est lundi | 4 |
| %U | numéro de semaine de l'année, avec dimanche comme premier jour de la semaine (00..53) | 10 |
| %V | numéro de semaine ISO, avec lundi comme premier jour de la semaine (01..53) | 12 |
| %w | jour de la semaine (0..6) ; 0 est dimanche | 4 |
| %W | numéro de semaine de l'année, avec lundi comme premier jour de la semaine (00..53) | 11 |
| %x | représentation de la date selon la locale | 03/03/2005 |
| %X | représentation de l'heure selon la locale | 23:30:30 |
| %y | deux derniers chiffres de l'année (00..99) | 05 |
| %Y | année | 2005 |
| %z | fuseau horaire numérique +hhmm | -0400 |
| %:z | fuseau horaire numérique +hh:mm | -04:00 |
| %::z | fuseau horaire numérique +hh:mm:ss | -04:00:00 |
| %:::z | fuseau horaire numérique avec : à la précision nécessaire | -04, +05:30 |
| %Z | abréviation alphabétique du fuseau horaire | EDT |
Par défaut, date remplit les champs numériques avec des zéros.
Les indicateurs optionnels suivants peuvent suivre '%' :
* `-` (tiret) ne pas remplir le champ
* `_` (soulignement) remplir avec des espaces
* `0` (zéro) remplir avec des zéros
* `^` utiliser des majuscules si possible
* `#` utiliser l'inverse si possible
Après tout indicateur vient une largeur de champ optionnelle, comme nombre décimal ;
puis un modificateur optionnel, qui est soit
* `E` pour utiliser les représentations alternatives de la locale si disponibles, ou
* `O` pour utiliser les symboles numériques alternatifs de la locale si disponibles.
Exemples :
Convertir les secondes depuis l'époque (1970-01-01 UTC) en date
date --date='@2147483647'
Montrer l'heure sur la côte ouest des États-Unis (utiliser tzselect(1) pour trouver TZ)
TZ='America/Los_Angeles' date
afficher ou définir la date système
Options
--date=<STRING>,-d <STRING>-
afficher l’heure décrite par CHAÎNE, pas ‘maintenant’
--file=<DATEFILE>,-f <DATEFILE>-
comme –date ; une fois pour chaque ligne de FICHIER_DATE
--iso-8601=<FMT>,-I <FMT>-
afficher la date/heure au format ISO 8601.
FMT=‘date’ pour la date seulement (par défaut),
‘hours’, ‘minutes’, ‘seconds’, ou ‘ns’
pour la date et l’heure à la précision indiquée.
Exemple : 2006-08-14T02:34:56-06:00 --resolution-
afficher la résolution disponible des horodatages
Exemple : 0.000000001 --rfc-email,-R-
afficher la date et l’heure au format RFC 5322.
Exemple : Mon, 14 Aug 2006 02:34:56 -0600 --rfc-3339=<FMT>-
afficher la date/heure au format RFC 3339.
FMT=‘date’, ‘seconds’, ou ‘ns’
pour la date et l’heure à la précision indiquée.
Exemple : 2006-08-14 02:34:56-06:00 --debug-
annoter la date analysée et avertir des usages douteux sur stderr
--reference=<FILE>,-r <FILE>-
afficher l’heure de dernière modification du FICHIER
--set=<STRING>,-s <STRING>-
définir l’heure décrite par CHAÎNE
--universal,--utc,-u-
afficher ou définir le Temps Universel Coordonné (UTC)
Examples
Display the current date using the default locale’s format:
date +%c
Display the current date in UTC, using the ISO 8601 format:
date {{[-u|--utc]}} +%Y-%m-%dT%H:%M:%SZ
Display the current date as a Unix timestamp (seconds since the Unix epoch):
date +%s
Convert a date specified as a Unix timestamp to the default format:
date {{[-d|--date]}} @{{1473305798}}
Convert a given date to the Unix timestamp format:
date {{[-d|--date]}} "{{2018-09-01 00:00}}" +%s {{[-u|--utc]}}
Display the current date using the RFC-3339 format (YYYY-MM-DD hh:mm:ss TZ) and specify its precision:
date --rfc-3339 {{date|seconds|ns}}
Set the current date using the format MMDDhhmmYYYY.ss (YYYY and .ss are optional):
sudo date {{093023592021.59}}
Display the current ISO week number:
date +%V
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
dd
dd [OPÉRANDE]...
dd OPTION
Copier, et optionnellement convertir, une ressource du système de fichiers
Options
Opérandes
-
bs=OCTETS : lire et écrire jusqu’à OCTETS octets à la fois (par défaut : 512) ; remplace ibs et obs.
-
cbs=OCTETS : la ‘taille de bloc de conversion’ en octets. S’applique aux opérations conv=block et conv=unblock.
-
conv=CONVS : une liste séparée par des virgules d’options de conversion ou (pour des raisons historiques) d’indicateurs de fichier.
-
count=N : arrêter la lecture de l’entrée après N opérations de lecture de taille ibs plutôt que de continuer jusqu’à EOF. Voir iflag=count_bytes si l’arrêt après N octets est préféré
-
ibs=N : la taille du tampon utilisé pour les lectures (par défaut : 512)
-
if=FICHIER : le fichier utilisé pour l’entrée. Quand non spécifié, stdin est utilisé à la place
-
iflag=INDICATEURS : une liste séparée par des virgules d’indicateurs d’entrée qui spécifient comment la source d’entrée est traitée. INDICATEURS peut être n’importe lequel des indicateurs d’entrée ou indicateurs généraux spécifiés ci-dessous.
-
skip=N (ou iseek=N) : ignorer N enregistrements de taille ibs dans l’entrée avant de commencer les opérations de copie/conversion. Voir iflag=seek_bytes si la recherche de N octets est préférée.
-
obs=N : la taille du tampon utilisé pour les écritures (par défaut : 512)
-
of=FICHIER : le fichier utilisé pour la sortie. Quand non spécifié, stdout est utilisé à la place
-
oflag=INDICATEURS : liste séparée par des virgules d’indicateurs de sortie qui spécifient comment la source de sortie est traitée. INDICATEURS peut être n’importe lequel des indicateurs de sortie ou indicateurs généraux spécifiés ci-dessous
-
seek=N (ou oseek=N) : recherche N enregistrements de taille obs dans la sortie avant de commencer les opérations de copie/conversion. Voir oflag=seek_bytes si la recherche de N octets est préférée
-
status=NIVEAU : contrôle si les statistiques de volume et de performance sont écrites sur stderr.
Quand non spécifié, dd affichera les statistiques à la fin. Un exemple est ci-dessous.
6+0 enregistrements en entrée 16+0 enregistrements en sortie 8192 octets (8.2 kB, 8.0 KiB) copiés, 0.00057009 s, 14.4 MB/s Les deux premières lignes sont les statistiques de 'volume' et la dernière ligne est les statistiques de 'performance'. Les statistiques de volume indiquent le nombre de lectures complètes et partielles de taille ibs, ou d'écritures de taille obs qui ont eu lieu pendant la copie. Le format des statistiques de volume est <complètes>+<partielles>. Si des enregistrements ont été tronqués (voir conv=block), les statistiques de volume contiendront le nombre d'enregistrements tronqués. Les valeurs possibles de NIVEAU sont : - progress : Afficher les statistiques de performance périodiques pendant la copie. - noxfer : Afficher les statistiques de volume finales, mais pas les statistiques de performance. - none : N'afficher aucune statistique. L'affichage des statistiques de performance est aussi déclenché par le signal INFO (quand pris en charge), ou le signal USR1. Définir la variable d'environnement POSIXLY_CORRECT à n'importe quelle valeur (y compris une valeur vide) fera ignorer le signal USR1.
Options de conversion
-
ascii : convertir d’EBCDIC vers ASCII. C’est l’inverse de l’option ebcdic. Implique conv=unblock.
-
ebcdic : convertir d’ASCII vers EBCDIC. C’est l’inverse de l’option ascii. Implique conv=block.
-
ibm : convertir d’ASCII vers EBCDIC, en appliquant les conventions pour [, ] et ~ spécifiées dans POSIX. Implique conv=block.
-
ucase : convertir de minuscules vers majuscules.
-
lcase : convertir de majuscules vers minuscules.
-
block : pour chaque nouvelle ligne inférieure à la taille indiquée par cbs=OCTETS, supprimer la nouvelle ligne et remplir avec des espaces jusqu’à cbs. Les lignes plus longues que cbs sont tronquées.
-
unblock : pour chaque bloc d’entrée de la taille indiquée par cbs=OCTETS, supprimer les espaces de fin à droite et remplacer par un caractère de nouvelle ligne.
-
sparse : tente de rechercher la sortie quand un bloc de taille obs ne contient que des zéros.
-
swab : échange chaque paire d’octets adjacents. Si un nombre impair d’octets est présent, l’octet final est omis.
-
sync : remplit chaque bloc de taille ibs avec des zéros. Si block ou unblock est spécifié, remplit avec des espaces à la place.
-
excl : le fichier de sortie doit être créé. Échoue si le fichier de sortie est déjà présent.
-
nocreat : le fichier de sortie ne sera pas créé. Échoue si le fichier de sortie n’est pas déjà présent.
-
notrunc : le fichier de sortie ne sera pas tronqué. Si cette option n’est pas présente, la sortie sera tronquée à l’ouverture.
-
noerror : toutes les erreurs de lecture seront ignorées. Si cette option n’est pas présente, dd n’ignorera que Error::Interrupted.
-
fdatasync : les données seront écrites avant la fin.
-
fsync : les données et les métadonnées seront écrites avant la fin.
Indicateurs d’entrée
- count_bytes : une valeur pour count=N sera interprétée comme des octets.
- skip_bytes : une valeur pour skip=N sera interprétée comme des octets.
- fullblock : attendre ibs octets de chaque lecture. les lectures de longueur zéro sont toujours considérées comme EOF.
Indicateurs de sortie
- append : ouvrir le fichier en mode ajout. Considérez définir conv=notrunc aussi.
- seek_bytes : une valeur pour seek=N sera interprétée comme des octets.
Indicateurs généraux
- direct : utiliser les E/S directes pour les données.
- directory : échouer sauf si l’entrée donnée (si utilisée comme iflag) ou la sortie (si utilisée comme oflag) est un répertoire.
- dsync : utiliser les E/S synchronisées pour les données.
- sync : utiliser les E/S synchronisées pour les données et les métadonnées.
- nonblock : utiliser les E/S non-bloquantes.
- noatime : ne pas mettre à jour l’heure d’accès.
- nocache : demander au système d’exploitation de supprimer le cache.
- noctty : ne pas assigner un tty de contrôle.
- nofollow : ne pas suivre les liens système.
Examples
Make a bootable USB drive from an isohybrid file (such as archlinux-xxx.iso) and show the progress:
sudo dd status=progress if={{path/to/file.iso}} of={{/dev/usb_drive}}
Clone a drive to another drive with 4 MiB block size and flush writes before the command terminates:
sudo dd bs=4M conv=fsync if={{/dev/source_drive}} of={{/dev/dest_drive}}
Generate a file with a specific number of random bytes by using kernel random driver:
dd bs={{100}} count={{1}} if=/dev/urandom of={{path/to/random_file}}
Benchmark the write performance of a disk:
dd bs={{1M}} count={{1024}} if=/dev/zero of={{path/to/file_1GB}}
Create a system backup, save it into an IMG file (can be restored later by swapping if and of), and show the progress:
sudo dd status=progress if={{/dev/drive_device}} of={{path/to/file.img}}
Check the progress of an ongoing dd operation (run this command from another shell):
progress
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
df
df [OPTION]... [FICHIER]...
afficher des informations sur le système de fichiers sur lequel chaque FICHIER réside, ou tous les systèmes de fichiers par défaut.
Options
--help-
afficher les informations d’aide.
--all,-a-
inclure les systèmes de fichiers factices
--block-size=<SIZE>,-B <SIZE>-
mettre les tailles à l’échelle par TAILLE avant de les afficher ; par ex. ‘-BM’ affiche les tailles en unités de 1 048 576 octets
--total-
produire un total général
--human-readable,-h-
afficher les tailles dans un format lisible par l’homme (par ex., 1K 234M 2G)
--si,-H-
pareillement, mais utiliser les puissances de 1000 pas 1024
--inodes,-i-
lister les informations d’inode au lieu de l’utilisation des blocs
-k-
comme –block-size=1K
-m-
like –block-size=1M
--local,-l-
limiter l’affichage aux systèmes de fichiers locaux
--no-sync-
ne pas invoquer sync avant d’obtenir les informations d’utilisation (par défaut)
--output=<FIELD_LIST>-
utiliser le format de sortie défini par LISTE_CHAMPS, ou afficher tous les champs si LISTE_CHAMPS est omise.
--portability,-P-
utiliser le format de sortie POSIX
--sync-
invoquer sync avant d’obtenir les informations d’utilisation (non-windows seulement)
--type=<TYPE>,-t <TYPE>-
limiter l’affichage aux systèmes de fichiers de type TYPE
--print-type,-T-
afficher le type de système de fichiers
--exclude-type=<TYPE>,-x <TYPE>-
limiter l’affichage aux systèmes de fichiers pas de type TYPE
Les valeurs affichées sont en unités de la première TAILLE disponible de –block-size, et des variables d’environnement DF_BLOCK_SIZE, BLOCK_SIZE et BLOCKSIZE. Sinon, les unités par défaut sont 1024 octets (ou 512 si POSIXLY_CORRECT est défini).
TAILLE est un entier et une unité optionnelle (exemple : 10M est 1010241024). Les unités sont K, M, G, T, P, E, Z, Y (puissances de 1024) ou KB, MB,… (puissances de 1000). Les unités peuvent être décimales, hexadécimales, octales, binaires.
Examples
Display all filesystems and their disk usage:
df
Display all filesystems in human-readable form:
df {{[-h|--human-readable]}}
Display the filesystem containing the specified file or directory:
df {{path/to/file_or_directory}}
Include statistics on the number of free inodes:
df {{[-i|--inodes]}}
Display filesystems but exclude the specified types:
df {{[-x|--exclude-type]}} {{squashfs}} {{[-x|--exclude-type]}} {{tmpfs}}
Display filesystem types:
df {{[-T|--print-type]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
dir
Options
--help-
ls-help-print-help
--format-
ls-help-set-display-format
-C-
ls-help-display-files-columns
--long,-l-
ls-help-display-detailed-info
-x-
ls-help-list-entries-rows
--tabsize=<COLS>,-T <COLS>-
ls-help-assume-tab-stops
-m-
ls-help-list-entries-commas
--zero-
ls-help-list-entries-nul
--dired,-D-
ls-help-generate-dired-output
--hyperlink=<WHEN>-
ls-help-hyperlink-filenames
-1-
ls-help-list-one-file-per-line
-o-
ls-help-long-format-no-group
-g-
ls-help-long-no-owner
--numeric-uid-gid,-n-
ls-help-long-numeric-uid-gid
--quoting-style-
Set quoting style
--literal,-N-
ls-help-literal-quoting-style
--escape,-b-
ls-help-escape-quoting-style
--quote-name,-Q-
ls-help-c-quoting-style
--hide-control-chars,-q-
ls-help-replace-control-chars
--show-control-chars-
ls-help-show-control-chars
--time=<field>-
ls-help-show-time-field
-c-
ls-help-time-change
-u-
ls-help-time-access
--hide=<PATTERN>-
ls-help-hide-pattern
--ignore=<PATTERN>,-I <PATTERN>-
ls-help-ignore-pattern
--ignore-backups,-B-
ls-help-ignore-backups
--sort=<field>-
ls-help-sort-by-field
-S-
ls-help-sort-by-size
-t-
ls-help-sort-by-time
-v-
ls-help-sort-by-version
-X-
ls-help-sort-by-extension
-U-
ls-help-sort-none
--dereference,-L-
ls-help-dereference-all
--dereference-command-line-symlink-to-dir-
ls-help-dereference-dir-args
--dereference-command-line,-H-
ls-help-dereference-args
--no-group,-G-
ls-help-no-group
--author-
ls-help-author
--all,-a-
ls-help-all-files
--almost-all,-A-
ls-help-almost-all
-f-
ls-help-unsorted-all
--directory,-d-
ls-help-directory
--human-readable,-h-
ls-help-human-readable
--kibibytes,-k-
ls-help-kibibytes
--si-
ls-help-si
--block-size=<BLOCK_SIZE>-
ls-help-block-size
--inode,-i-
ls-help-print-inode
--reverse,-r-
ls-help-reverse-sort
--recursive,-R-
ls-help-recursive
--width=<COLS>,-w <COLS>-
ls-help-terminal-width
--size,-s-
ls-help-allocation-size
--color-
ls-help-color-output
--indicator-style-
ls-help-indicator-style
--classify=<when>,-F <when>-
ls-help-classify
--file-type-
ls-help-file-type
-p-
ls-help-slash-directories
--time-style=<TIME_STYLE>-
ls-help-time-style
--full-time-
ls-help-full-time
--context,-Z-
ls-help-context
--group-directories-first-
ls-help-group-directories-first
Examples
Affiche la documentation de la commande originale :
tldr ls
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
dircolors
dircolors [OPTION]... [FICHIER]
Afficher les commandes pour définir la variable d’environnement LS_COLORS.
Options
--sh,--bourne-shell,-b-
output Bourne shell code to set LS_COLORS
--csh,--c-shell,-c-
output C shell code to set LS_COLORS
--print-database,-p-
print the default color database
--print-ls-colors-
output fully escaped colors for display
Si FICHIER est spécifié, le lire pour déterminer quelles couleurs utiliser pour quels types de fichiers et extensions. Sinon, une base de données précompilée est utilisée. Pour les détails sur le format de ces fichiers, exécutez ‘dircolors –print-database’
Examples
Output commands to set $LS_COLOR using default colors:
dircolors
Display each filetype with the color they would appear in ls:
dircolors --print-ls-colors
Output commands to set $LS_COLOR using colors from a file:
dircolors {{path/to/file}}
Output commands for Bourne shell:
dircolors {{[-b|--bourne-shell]}}
Output commands for C shell:
dircolors {{[-c|--c-shell]}}
View the default colors for file types and extensions:
dircolors {{[-p|--print-database]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
dirname
dirname [OPTION] NOM...
Supprimer le dernier composant du nom de fichier
Options
--zero,-z-
dirname-zero-help
Afficher chaque NOM avec son dernier composant non-slash et les slashes finaux supprimés ; si NOM ne contient pas de ‘/’, afficher ‘.’ (signifiant le répertoire courant).
Examples
Calculate the parent directory of a given path:
dirname {{path/to/file_or_directory}}
Calculate the parent directory of multiple paths:
dirname {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}
Delimit output with a NUL character instead of a newline (useful when combining with xargs):
dirname {{[-z|--zero]}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
du
du [OPTION]... [FICHIER]...
du [OPTION]... --files0-from=F
Estimer l’utilisation de l’espace disque des fichiers
Options
--help-
Afficher les informations d’aide.
--all,-a-
afficher les comptes pour tous les fichiers, pas seulement les répertoires
--apparent-size,-A-
afficher les tailles apparentes, plutôt que l’utilisation du disque bien que la taille apparente soit généralement plus petite, elle peut être plus grande en raison de trous dans les fichiers (‘sparse’), la fragmentation interne, les blocs indirects, etc.
--block-size=<SIZE>,-B <SIZE>-
mettre à l’échelle les tailles par TAILLE avant de les afficher. Par ex., ‘-BM’ affiche les tailles en unités de 1 048 576 octets. Voir le format TAILLE ci-dessous.
--bytes,-b-
équivalent à ‘–apparent-size –block-size=1’
--total,-c-
produire un total général
--max-depth=<N>,-d <N>-
afficher le total pour un répertoire (ou fichier, avec –all) seulement s’il est à N niveaux ou moins sous l’argument de ligne de commande ; –max-depth=0 est identique à –summarize
--human-readable,-h-
afficher les tailles dans un format lisible par l’homme (p. ex., 1K 234M 2G)
--inodes-
lister les informations d’utilisation des inodes au lieu de l’utilisation des blocs comme –block-size=1K
-k-
comme –block-size=1K
--count-links,-l-
compter les tailles plusieurs fois si liées en dur
--dereference,-L-
suivre tous les liens symboliques
--dereference-args,-D,-H-
suivre seulement les liens symboliques qui sont listés sur la ligne de commande
--no-dereference,-P-
ne pas suivre les liens symboliques (c’est le défaut)
-m-
comme –block-size=1M
--null,-0-
terminer chaque ligne de sortie avec un octet 0 plutôt qu’une nouvelle ligne
--separate-dirs,-S-
ne pas inclure la taille des sous-répertoires
--summarize,-s-
afficher seulement un total pour chaque argument
--si-
comme -h, mais utiliser les puissances de 1000 et non 1024
--one-file-system,-x-
ignorer les répertoires sur des systèmes de fichiers différents
--threshold=<SIZE>,-t <SIZE>-
exclure les entrées plus petites que TAILLE si positive, ou les entrées plus grandes que TAILLE si négative
--verbose,-v-
mode verbeux (option non présente dans GNU/Coreutils)
--exclude=<PATTERN>-
exclure les fichiers qui correspondent au MOTIF
--exclude-from=<FILE>,-X <FILE>-
exclure les fichiers qui correspondent à n’importe quel motif dans FICHIER
--files0-from=<FILE>-
résumer l’utilisation du périphérique des noms de fichiers terminés par NUL spécifiés dans le fichier F ; si F est -, alors lire les noms depuis l’entrée standard
--time=<WORD>-
montrer l’heure de la dernière modification de n’importe quel fichier dans le répertoire, ou n’importe lequel de ses sous-répertoires. Si MOT est donné, montrer l’heure comme MOT au lieu de l’heure de modification : atime, access, use, ctime, status, birth ou creation
--time-style=<STYLE>-
montrer les heures en utilisant le style STYLE : full-iso, long-iso, iso, +FORMAT FORMAT est interprété comme ‘date’
Les valeurs affichées sont en unités de la première TAILLE disponible de –block-size, et des variables d’environnement DU_BLOCK_SIZE, BLOCK_SIZE et BLOCKSIZE. Sinon, les unités par défaut sont 1024 octets (ou 512 si POSIXLY_CORRECT est défini).
TAILLE est un entier et une unité optionnelle (exemple : 10M est 1010241024). Les unités sont K, M, G, T, P, E, Z, Y (puissances de 1024) ou KB, MB,… (puissances de 1000). Les unités peuvent être décimales, hexadécimales, octales, binaires.
MOTIF permet des exclusions avancées. Par exemple, les syntaxes suivantes sont prises en charge : ? correspondra à un seul caractère
- correspondra à zéro ou plusieurs caractères {a,b} correspondra à a ou b
Examples
Liste les tailles d’un répertoire et de ses sous-répertoires, dans l’unité donnée (o/Kio/Mio) :
du -{{b|k|m}} {{chemin/vers/répertoire}}
Liste les tailles d’un répertoire et de ses sous-répertoires, sous une forme lisible par l’homme (c’est-à-dire en sélectionnant automatiquement l’unité appropriée pour chaque taille) :
du {{[-h|--human-readable]}} {{chemin/vers/répertoire}}
Affiche la taille d’un répertoire unique, en unités lisibles par l’homme :
du {{[-sh|--summarize --human-readable]}} {{chemin/vers/répertoire}}
Liste les tailles, en unités lisibles par l’homme, d’un répertoire et de tous les fichiers et répertoires qu’il contient :
du {{[-ah|--all --human-readable]}} {{chemin/vers/répertoire}}
Liste les tailles, en unités lisibles par l’homme, d’un répertoire et de ses sous-répertoires, jusqu’à n niveaux de profondeur :
du {{[-h|--human-readable]}} {{[-d|--max-depth]}} {{n}} {{chemin/vers/répertoire}}
Liste la taille, en unités lisibles par l’homme, de tous les fichiers .jpg dans le répertoire actuel, et affiche un total cumulatif à la fin :
du {{[-ch|--total --human-readable]}} *.jpg
Liste tous les fichiers et répertoires (y compris les fichiers cachés) dépassant un certain seuil (utile pour déterminer ce qui occupe réellement l’espace) :
du {{[-ah|--all --human-readable]}} {{[-t|--threshold]}} {{1G|1024M|1048576K}} .[^.]* *
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
echo
echo [OPTIONS]... [CHAÎNE]...
Affiche une ligne de texte
Options
-n-
do not output the trailing newline
-e-
enable interpretation of backslash escapes
-E-
disable interpretation of backslash escapes (default)
Affiche la ou les CHAÎNE(s) sur la sortie standard.
Si -e est activé, les séquences suivantes sont reconnues :
- \ barre oblique inverse
- \a alerte (BEL)
- \b retour arrière
- \c ne produit aucune sortie supplémentaire
- \e échappement
- \f saut de page
- \n nouvelle ligne
- \r retour chariot
- \t tabulation horizontale
- \v tabulation verticale
- \0NNN octet avec valeur octale NNN (1 à 3 chiffres)
- \xHH octet avec valeur hexadécimale HH (1 à 2 chiffres)
Examples
Affiche un message (les guillemets sont facultatifs) :
echo "{{Hello World}}"
Affiche un message avec des variables d’environnement :
echo "{{Ma variable PATH est $PATH}}"
Affiche un message sans retour à la ligne :
echo -n "{{Hello World}}"
Ajoute un message à un fichier :
echo "{{Hello World}}" >>{{fichier.txt}}
Active l’interprétation des spécificateurs d’échappement :
echo -e "{{Colonne 1\tColonne 2}}"
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
env
env [OPTION]... [-] [NOM=VALEUR]... [COMMANDE [ARG]...]
Définir chaque NOM à VALEUR dans l’environnement et exécuter COMMANDE
Options
--ignore-environment,-i-
start with an empty environment
--chdir=<DIR>,-C <DIR>-
change working directory to DIR
--null,-0-
end each output line with a 0 byte rather than a newline (only valid when printing the environment)
--quoting-style-
Set quoting style
--env0-from=<FILE>-
read NUL-delimited environment entries from FILE
--unset=<NAME>,-u <NAME>-
remove variable from the environment
--debug,-v-
print verbose information for each processing step
--split-string=<S>,-S <S>-
process and split S into separate arguments; used to pass multiple arguments on shebang lines
--argv0=<a>,-a <a>-
Override the zeroth argument passed to the command being executed. Without this option a default value of
commandis used. --ignore-signal=<SIG>-
set handling of SIG signal(s) to do nothing
--default-signal=<SIG>-
reset handling of SIG signal(s) to the default action
--block-signal=<SIG>-
block delivery of SIG signal(s) while running COMMAND
--list-signal-handling-
list signal handling changes requested by preceding options
Un simple - implique -i. Si aucune COMMANDE, afficher l’environnement résultant.
Examples
Affiche l’environnement :
env
Exécute le programme donné. Souvent utilisé dans les scripts après le shebang (#!) pour consulter le chemin vers le programme :
env {{programme}}
Exécute le programme donné, avec un environnement vide :
env -i {{programme}}
Supprime une variable d’environnement et execute le programme donné :
env -u {{variable}} {{programme}}
Définit ou modifie une variable d’environnement et execute le programme donné :
env {{variable}}={{valeur}} {{programme}}
Définit ou modifie plusieurs variables d’environnement et execute le programme donné :
env {{variable1}}={{valeur}} {{variable2}}={{valeur}} {{variable3}}={{valeur}} {{programme}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
expand
expand [OPTION]... [FICHIER]...
Convertir les tabulations de chaque FICHIER en espaces, en écrivant vers la sortie standard. Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Options
--initial,-i-
ne pas convertir les tabulations après les caractères non-blancs
--tabs=<N, LIST>,-t <N, LIST>-
avoir des tabulations espacées de N caractères, pas 8 ou utiliser une liste séparée par des virgules de positions de tabulation explicites
--no-utf8,-U-
interpréter le fichier d’entrée comme ASCII 8 bits plutôt que UTF-8
Examples
Convert tabs in each file to spaces, writing to stdout:
expand {{path/to/file}}
Convert tabs to spaces, reading from stdin:
expand
Do not convert tabs after non blanks:
expand {{[-i|--initial]}} {{path/to/file}}
Have tabs a certain number of characters apart, not 8:
expand {{[-t|--tabs]}} {{number}} {{path/to/file}}
Use a comma separated list of explicit tab positions:
expand {{[-t|--tabs]}} {{1,4,6}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
expr
expr [EXPRESSION]
expr [OPTIONS]
Afficher la valeur de EXPRESSION sur la sortie standard
Options
--version-
output version information and exit
--help-
display this help and exit
Afficher la valeur de EXPRESSION sur la sortie standard. Une ligne vide ci-dessous sépare les groupes de précédence croissante.
EXPRESSION peut être :
- ARG1 | ARG2: ARG1 s’il n’est ni nul ni 0, sinon ARG2
- ARG1 & ARG2: ARG1 si aucun argument n’est nul ou 0, sinon 0
- ARG1 < ARG2: ARG1 est inférieur à ARG2
- ARG1 <= ARG2: ARG1 est inférieur ou égal à ARG2
- ARG1 = ARG2: ARG1 est égal à ARG2
- ARG1 != ARG2: ARG1 est différent de ARG2
- ARG1 >= ARG2: ARG1 est supérieur ou égal à ARG2
- ARG1 > ARG2: ARG1 est supérieur à ARG2
- ARG1 + ARG2: somme arithmétique de ARG1 et ARG2
- ARG1 - ARG2: différence arithmétique de ARG1 et ARG2
- ARG1 * ARG2: produit arithmétique de ARG1 et ARG2
- ARG1 / ARG2: quotient arithmétique de ARG1 divisé par ARG2
- ARG1 % ARG2: reste arithmétique de ARG1 divisé par ARG2
- STRING : REGEXP: correspondance de motif ancré de REGEXP dans STRING
- match STRING REGEXP: identique à STRING : REGEXP
- substr STRING POS LENGTH: sous-chaîne de STRING, POS compté à partir de 1
- index STRING CHARS: index dans STRING où l’un des CHARS est trouvé, ou 0
- length STRING: longueur de STRING
-
- TOKEN: interpréter TOKEN comme une chaîne, même si c’est un mot-clé comme match ou un opérateur comme /
- ( EXPRESSION ): valeur de EXPRESSION
Attention : de nombreux opérateurs doivent être échappés ou mis entre guillemets pour les shells. Les comparaisons sont arithmétiques si les deux ARG sont des nombres, sinon lexicographiques. Les correspondances de motifs retournent la chaîne correspondant entre ( et ) ou null ; si ( et ) ne sont pas utilisés, elles retournent le nombre de caractères correspondants ou 0.
Le statut de sortie est 0 si EXPRESSION n’est ni nulle ni 0, 1 si EXPRESSION est nulle ou 0, 2 si EXPRESSION est syntaxiquement invalide, et 3 si une erreur s’est produite.
Variables d’environnement :
- EXPR_DEBUG_TOKENS=1: afficher les jetons de l’expression
- EXPR_DEBUG_RPN=1: afficher l’expression représentée en notation polonaise inverse
- EXPR_DEBUG_SYA_STEP=1: afficher chaque étape de l’analyseur
- EXPR_DEBUG_AST=1: afficher l’arbre de syntaxe abstraite représentant l’expression
Examples
Get the length of a specific string:
expr length "{{string}}"
Get the substring of a string with a specific length:
expr substr "{{string}}" {{from}} {{length}}
Match a specific substring against an anchored pattern:
expr match "{{string}}" '{{pattern}}'
Get the first char position from a specific set in a string:
expr index "{{string}}" "{{chars}}"
Calculate a specific mathematic expression:
expr {{expression1}} {{+|-|*|/|%}} {{expression2}}
Get the first expression if its value is non-zero and not null otherwise get the second one:
expr {{expression1}} \| {{expression2}}
Get the first expression if both expressions are non-zero and not null otherwise get zero:
expr {{expression1}} \& {{expression2}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
factor
factor [OPTION]... [NOMBRE]...
Afficher les facteurs premiers du/des NOMBRE(s) donné(s). Si aucun n’est spécifié, lire depuis l’entrée standard.
Options
--exponents,-h-
Afficher les facteurs sous la forme p^e
--help-
Afficher les informations d’aide.
Examples
Display the prime-factorization of a number:
factor {{number}}
Take the input from stdin if no argument is specified:
echo {{number}} | factor
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
false
Retourne immédiatement avec le code de sortie 1. Lorsqu’il est invoqué avec l’une des options reconnues, il tente d’afficher l’aide ou la version. Toute erreur d’entrée/sortie pendant cette opération est signalée, mais le programme retourne également 1.
Options
--help-
Print help information
--version-
Print version information
Examples
Return a non-zero exit code:
false
Make a command always exit with 1:
{{command}} && false
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
fmt
[OPTION]... [FICHIER]...
Reformate les paragraphes depuis l’entrée (ou l’entrée standard) vers la sortie standard.
Options
--crown-margin,-c-
First and second line of paragraph may have different indentations, in which case the first line’s indentation is preserved, and each subsequent line’s indentation matches the second line.
--tagged-paragraph,-t-
Like -c, except that the first and second line of a paragraph must have different indentation or they are treated as separate paragraphs.
--preserve-headers,-m-
Attempt to detect and preserve mail headers in the input. Be careful when combining this flag with -p.
--split-only,-s-
Split lines only, do not reflow.
--uniform-spacing,-u-
Insert exactly one space between words, and two between sentences. Sentence breaks in the input are detected as [?!.] followed by two spaces or a newline; other punctuation is not interpreted as a sentence break.
--prefix=<PREFIX>,-p <PREFIX>-
Reformat only lines beginning with PREFIX, reattaching PREFIX to reformatted lines. Unless -x is specified, leading whitespace will be ignored when matching PREFIX.
--skip-prefix=<PSKIP>,-P <PSKIP>-
Do not reformat lines beginning with PSKIP. Unless -X is specified, leading whitespace will be ignored when matching PSKIP
--exact-prefix,-x-
PREFIX must match at the beginning of the line with no preceding whitespace.
--exact-skip-prefix,-X-
PSKIP must match at the beginning of the line with no preceding whitespace.
--width=<WIDTH>,-w <WIDTH>-
Fill output lines up to a maximum of WIDTH columns, default 75. This can be specified as a negative number in the first argument.
--goal=<GOAL>,-g <GOAL>-
Goal width, default of 93% of WIDTH. Must be less than or equal to WIDTH.
--quick,-q-
Break lines more quickly at the expense of a potentially more ragged appearance.
--tab-width=<TABWIDTH>,-T <TABWIDTH>-
Treat tabs as TABWIDTH spaces for determining line length, default 8. Note that this is used only for calculating line lengths; tabs are preserved in the output.
Examples
Reformat a file:
fmt {{path/to/file}}
Reformat a file producing output lines of (at most) n characters:
fmt {{[-w|--width]}} {{n}} {{path/to/file}}
Reformat a file without joining lines shorter than the given width together:
fmt {{[-s|--split-only]}} {{path/to/file}}
Reformat a file with uniform spacing (1 space between words and 2 spaces between paragraphs):
fmt {{[-u|--uniform-spacing]}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
fold
fold [OPTION]... [FICHIER]...
Écrit chaque fichier (ou l’entrée standard si aucun fichier n’est donné) sur la sortie standard en coupant les lignes trop longues
Options
--bytes,-b-
fold-bytes-help
--characters,-c-
fold-characters-help
--spaces,-s-
fold-spaces-help
--width=<WIDTH>,-w <WIDTH>-
fold-width-help
Examples
Fold lines in a fixed width:
fold {{[-w|--width]}} {{width}} {{path/to/file}}
Count width in bytes (the default is to count in columns):
fold {{[-b|--bytes]}} {{[-w|--width]}} {{width_in_bytes}} {{path/to/file}}
Break the line after the rightmost blank within the width limit:
fold {{[-s|--spaces]}} {{[-w|--width]}} {{width}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
groups
groups [OPTION]... [NOM_UTILISATEUR]...
Affiche les groupes d’appartenance pour chaque NOM_UTILISATEUR ou, s’il n’est pas précisé, pour le processus courant (ce qui peut différer si la base de données des groupes a changé).
Options
Examples
Print group memberships for the current user:
groups
Print group memberships for a list of users:
groups {{username1 username2 ...}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
head
head [OPTION]... [FICHIER]...
Affiche les 10 premières lignes de chaque FICHIER sur la sortie standard. Avec plus d’un FICHIER, précède chacun d’un en-tête donnant le nom du fichier. Sans FICHIER, ou quand FICHIER est -, lit l’entrée standard.
Les arguments obligatoires pour les options longues sont obligatoires pour les options courtes aussi.
Options
--bytes=<[-]NUM>,-c <[-]NUM>-
print the first NUM bytes of each file;
with a leading ‘-’, print all but the last
NUM bytes of each file --lines=<[-]NUM>,-n <[-]NUM>-
print the first NUM lines instead of the first 10;
with a leading ‘-’, print all but the last
NUM lines of each file --quiet,--silent,-q-
never print headers giving file names
--verbose,-v-
always print headers giving file names
--presume-input-pipe--zero-terminated,-z-
line delimiter is NUL, not newline
Examples
Affiche les 10 premières lignes d’un fichier :
head {{chemin/vers/fichier}}
Affiche les 10 premières lignes de plusieurs fichiers :
head {{chemin/vers/fichier1 chemin/vers/fichier2 ...}}
Affiche les 5 premières lignes d’un fichier :
head {{[-5|--lines 5]}} {{chemin/vers/fichier}}
Affiche un nombre de lignes d’un fichier :
head {{[-n|--lines]}} {{nombre}} {{chemin/vers/fichier}}
Affiche un nombre spécifique d’octets à partir du début d’un fichier :
head {{[-c|--bytes]}} {{nombre}} {{chemin/vers/fichier}}
Affiche tout le contenu d’un fichier sauf un nombre de lignes à la fin :
head {{[-n|--lines]}} -{{nombre}} {{chemin/vers/fichier}}
Affiche tout le contenu d’un fichier sauf un nombre d’octets à la fin :
head {{[-c|--bytes]}} -{{nombre}} {{chemin/vers/fichier}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
hostid
hostid [OPTIONS]
Afficher l’identifiant numérique (en hexadécimal) de l’hôte actuel
Options
Examples
Display the numeric identifier for the current host in hexadecimal:
hostid
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
hostname
hostname [OPTION]... [NOM_HÔTE]
Afficher ou définir le nom d’hôte du système.
Options
--domain,-d-
Afficher le nom du domaine DNS si possible
--ip-address,-i-
Afficher la ou les adresses réseau de l’hôte
--fqdn,-f-
Afficher le FQDN (nom de domaine pleinement qualifié) (par défaut)
--short,-s-
Afficher le nom d’hôte court (la partie avant le premier point) si possible
Examples
Show current host name:
hostname
Show the network address of the host name:
hostname {{[-i|--ip-address]}}
Show the FQDN (Fully Qualified Domain Name):
hostname {{[-f|--fqdn]}}
Set current host name:
hostname {{new_hostname}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
id
id [OPTION]... [UTILISATEUR]...
Affiche les informations d’utilisateur et de groupe pour chaque UTILISATEUR spécifié, ou (si UTILISATEUR est omis) pour l’utilisateur actuel.
Options
--ignore,-a-
ignore, for compatibility with other versions
-A-
Display the process audit user ID and other process audit properties,
which requires privilege (not available on Linux). --user,-u-
Display only the effective user ID as a number.
--group,-g-
Display only the effective group ID as a number
--groups,-G-
Display only the different group IDs as white-space separated numbers,
in no particular order. -p-
Make the output human-readable. Each display is on a separate line.
--name,-n-
Display the name of the user or group ID for the -G, -g and -u options
instead of the number.
If any of the ID numbers cannot be mapped into
names, the number will be displayed as usual. -P-
Display the id as a password file entry.
--real,-r-
Display the real ID for the -G, -g and -u options instead of
the effective ID. --zero,-z-
delimit entries with NUL characters, not whitespace;
not permitted in default format --context,-Z-
print only the security context of the process
L’utilitaire id affiche les noms d’utilisateur et de groupe ainsi que leurs ID numériques du processus appelant, vers la sortie standard. Si les ID réels et effectifs sont différents, les deux sont affichés, sinon seul l’ID réel est affiché.
Si un utilisateur (nom de connexion ou ID utilisateur) est spécifié, les ID utilisateur et groupe de cet utilisateur sont affichés. Dans ce cas, les ID réels et effectifs sont supposés être identiques.
Examples
Display current user’s ID (UID), group ID (GID), and groups to which they belong:
id
Display the current user identity:
id {{[-un|--user --name]}}
Display the current user identity as a number:
id {{[-u|--user]}}
Display the current primary group identity:
id {{[-gn|--group --name]}}
Display the current primary group identity as a number:
id {{[-g|--group]}}
Display all groups the current user belongs to:
id {{[-Gn|--groups --name]}}
Display an arbitrary user’s ID (UID), group ID (GID), and groups to which they belong:
id {{username}}
Skip name lookup and specify the UID number explicitly:
id +{{uid_number}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
install
install [OPTION]... [FICHIER]...
Copier SOURCE vers DEST ou plusieurs SOURCE(s) vers le RÉPERTOIRE existant, tout en définissant les modes de permission et propriétaire/groupe
Options
--backup=<CONTROL>-
make a backup of each existing destination file
-b-
like –backup but does not accept an argument
-c-
ignored
--compare,-C-
compare each pair of source and destination files, and in some cases, do not modify the destination at all
--directory,-d-
treat all arguments as directory names. create all components of the specified directories
-D-
create all leading components of DEST except the last, then copy SOURCE to DEST
--group=<GROUP>,-g <GROUP>-
set group ownership, instead of process’s current group
--mode=<MODE>,-m <MODE>-
set permission mode (as in chmod), instead of rwxr-xr-x
--owner=<OWNER>,-o <OWNER>-
set ownership (super-user only)
--preserve-timestamps,-p-
apply access/modification times of SOURCE files to corresponding destination files
--strip,-s-
strip symbol tables
--strip-program=<PROGRAM>-
program used to strip binaries
--suffix=<SUFFIX>,-S <SUFFIX>-
override the usual backup suffix
--target-directory=<DIRECTORY>,-t <DIRECTORY>-
copy all SOURCE arguments into DIRECTORY
--no-target-directory,-T-
treat DEST as a normal file
--verbose,-v-
explain what is being done
--preserve-context,-P-
preserve security context
-Z-
set SELinux security context of destination file and each created directory to default type
--context=<CONTEXT>-
set security context of files and directories
--unprivileged,-U-
do not require elevated privileges to change the owner, the group, or the file flags of the destination
Examples
Copie des fichiers vers une destination :
install {{chemin/fichier/source}} {{chemin/repertoire/destination}}
Copie des fichiers vers une destination en mettant à jour leur propriétaire :
install --owner {{utilisateur}} {{chemin/fichier/source}} {{chemin/repertoire/destination}}
Copie des fichiers vers une destination en mettant à jour leur groupe d’appartenance :
install --group {{utilisateur}} {{chemin/fichier/source}} {{chemin/repertoire/destination}}
Copie des fichiers vers une destination en mettant à jour leur mode :
install --mode {{+x}} {{chemin/fichier/source}} {{chemin/repertoire/destination}}
Copie des fichiers en mettant à jour leur dates d’accès et de modification à partir de leurs sources respectives :
install --preserve-timestamps {{chemin/fichier/source}} {{chemin/repertoire/destination}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
join
join [OPTION]... FICHIER1 FICHIER2
Pour chaque paire de lignes d’entrée avec des champs de jointure identiques, écrire une ligne sur la sortie standard. Le champ de jointure par défaut est le premier, délimité par des espaces.
Quand FILE1 ou FILE2 (mais pas les deux) est -, lire l’entrée standard.
Options
-a <FILENUM>-
afficher aussi les lignes non appariables du fichier NUMÉRO_FICHIER, où
NUMÉRO_FICHIER est 1 ou 2, correspondant à FICHIER1 ou FICHIER2 -v <FILENUM>-
comme -a NUMÉRO_FICHIER, mais supprimer les lignes de sortie jointes
-e <EMPTY>-
remplacer les champs d’entrée manquants par VIDE
--ignore-case,-i-
ignorer les différences de casse lors de la comparaison des champs
--numeric-sort,-n-
compare join fields by numerical value, as ‘sort -n’ does
-j <FIELD>-
équivalent à ‘-1 CHAMP -2 CHAMP’
-o <FORMAT>-
obéir au FORMAT lors de la construction de la ligne de sortie
-t <CHAR>-
utiliser CHAR comme séparateur de champ d’entrée et de sortie
-1 <FIELD>-
joindre sur ce CHAMP du fichier 1
-2 <FIELD>-
joindre sur ce CHAMP du fichier 2
--check-order-
vérifier que l’entrée est correctement triée, même si toutes les lignes d’entrée sont appariables
--nocheck-order-
ne pas vérifier que l’entrée est correctement triée
--header-
traiter la première ligne de chaque fichier comme des en-têtes de champs, les imprimer sans essayer de les apparier
--zero-terminated,-z-
le délimiteur de ligne est NUL, pas de nouvelle ligne
Examples
Join two files on the first (default) field:
join {{path/to/file1}} {{path/to/file2}}
Join two files using a comma (instead of a space) as the field separator:
join -t ',' {{path/to/file1}} {{path/to/file2}}
Join field3 of file1 with field1 of file2:
join -1 {{3}} -2 {{1}} {{path/to/file1}} {{path/to/file2}}
Produce a line for each unpairable line for file1:
join -a {{1}} {{path/to/file1}} {{path/to/file2}}
Join a file from stdin:
cat {{path/to/file1}} | join - {{path/to/file2}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
kill
kill [OPTIONS]... PID...
Envoyer un signal aux processus ou lister les informations sur les signaux.
Options
--list,-l-
Lists signals
--table,-t-
Lists table of signals
--signal=<signal>,-s <signal>-
Sends given signal instead of SIGTERM
Examples
Termine un processus avec le signal SIGTERM (terminaison) par défaut :
kill {{identifiant_processus}}
Liste les noms des signaux disponibles (à utiliser sans leurs préfixes SIG) :
kill -l
Termine un processus avec le signal SIGHUP (“raccrocher”). Beaucoup de daemons se rafraîchissent au lieu de terminer :
kill {{[-1|-SIGHUP]}} {{identifiant_processus}}
Termine un processus avec le signal SIGINT (“interruption”). Généralement initié par l’utilisateur appuyant sur <Ctrl c> :
kill {{[-2|-SIGINT]}} {{identifiant_processus}}
Demande au système d’exploitation de mettre fin à un processus immédiatement (sans possibilité d’intercepter le signal) :
kill {{[-9|-SIGKILL]}} {{identifiant_processus}}
Demande au système d’exploitation de suspendre un processus jusqu’à recevoir le signal SIGCONT (“continue”) :
kill {{[-STOP|-SIGSTOP]}} {{identifiant_processus}}
Envoie le signal SIGUSR1 à tous les processus dans le groupe avec l’identifiant indiqué :
kill {{[-USR1|-SIGUSR1]}} -{{identifiant_groupe}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
link
link FILE1 FILE2
Appelle la fonction link pour créer un lien nommé FILE2 vers un FILE1 existant.
Options
Examples
Create a hard link from a new file to an existing file:
link {{path/to/existing_file}} {{path/to/new_file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
ln
ln [OPTION]... [-T] CIBLE NOM_LIEN
ln [OPTION]... CIBLE
ln [OPTION]... CIBLE... RÉPERTOIRE
ln [OPTION]... -t RÉPERTOIRE CIBLE...
Créer des liens entre fichiers
Options
--backup=<CONTROL>-
make a backup of each existing destination file
-b-
like –backup but does not accept an argument
--force,-f-
remove existing destination files
--interactive,-i-
prompt whether to remove existing destination files
--no-dereference,-n-
treat LINK_NAME as a normal file if it is a
symbolic link to a directory --logical,-L-
follow TARGETs that are symbolic links
--physical,-P-
make hard links directly to symbolic links
--symbolic,-s-
make symbolic links instead of hard links
--suffix=<SUFFIX>,-S <SUFFIX>-
override the usual backup suffix
--target-directory=<DIRECTORY>,-t <DIRECTORY>-
specify the DIRECTORY in which to create the links
--no-target-directory,-T-
treat LINK_NAME as a normal file always
--relative,-r-
create symbolic links relative to link location
--verbose,-v-
print name of each linked file
Dans la 1ère forme, créer un lien vers CIBLE avec le nom NOM_LIEN. Dans la 2ème forme, créer un lien vers CIBLE dans le répertoire courant. Dans les 3ème et 4ème formes, créer des liens vers chaque CIBLE dans RÉPERTOIRE. Créer des liens physiques par défaut, des liens symboliques avec –symbolic. Par défaut, chaque destination (nom du nouveau lien) ne doit pas déjà exister. Lors de la création de liens physiques, chaque CIBLE doit exister. Les liens symboliques peuvent contenir du texte arbitraire ; s’ils sont résolus plus tard, un lien relatif est interprété en relation avec son répertoire parent.
Examples
Crée un lien symbolique vers un fichier ou un répertoire :
ln {{[-s|--symbolic]}} {{/chemin/vers/fichier_ou_repertoire}} {{chemin/vers/lien_symbolique}}
Modifie la cible d’un lien symbolique existant :
ln {{[-sf|--symbolic --force]}} {{/chemin/vers/nouveau_fichier}} {{chemin/vers/lien_symbolique}}
Crée un lien dur vers un fichier :
ln {{/chemin/vers/fichier}} {{chemin/vers/lien_dur}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
logname
logname
Afficher le nom de connexion de l’utilisateur
Options
Examples
Display the currently logged in user’s name:
logname
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
ls
ls [OPTION]... [FICHIER]...
Liste le contenu des répertoires. Ignore les fichiers et répertoires commençant par un ‘.’ par défaut
Options
--help-
Afficher les informations d’aide.
--format-
Définir le format d’affichage.
-C-
Afficher les fichiers en colonnes.
--long,-l-
Afficher des informations détaillées.
-x-
Lister les entrées en lignes au lieu de colonnes.
--tabsize=<COLS>,-T <COLS>-
Supposer des arrêts de tabulation à chaque COLS au lieu de 8
-m-
Lister les entrées séparées par des virgules.
--zero-
Lister les entrées séparées par des caractères NUL ASCII.
--dired,-D-
générer une sortie conçue pour le mode dired (Directory Editor) d’Emacs
--hyperlink=<WHEN>-
créer des hyperliens pour les noms de fichiers QUAND
-1-
Lister un fichier par ligne.
-o-
Format long sans informations de groupe.
Identique à –format=long avec –no-group. -g-
Format long sans informations de propriétaire.
--numeric-uid-gid,-n-
-l avec des UID et GID numériques.
--quoting-style-
Set quoting style
--literal,-N-
Utiliser le style de citation littéral. Équivalent à
--quoting-style=literal --escape,-b-
Utiliser le style de citation d’échappement. Équivalent à
--quoting-style=escape --quote-name,-Q-
Utiliser le style de citation C. Équivalent à
--quoting-style=c --hide-control-chars,-q-
Remplacer les caractères de contrôle par ‘?’ s’ils ne sont pas échappés.
--show-control-chars-
Afficher les caractères de contrôle ‘tels quels’ s’ils ne sont pas échappés.
--time=<field>-
Afficher l’heure dans
<champ>:
heure d’accès (-u) : atime, access, use ;
heure de changement (-t) : ctime, status.
heure de modification : mtime, modification.
heure de création : birth, creation ; -c-
Si le format de liste long (par ex., -l, -o) est utilisé, afficher
l’heure de changement de statut (le ‘ctime’ dans l’inode) au lieu de l’heure
de modification. Lors du tri explicite par heure (–sort=time ou -t) ou lors
de l’absence de format de liste long, trier selon l’heure de changement de statut. -u-
Si le format de liste long (par ex., -l, -o) est utilisé, afficher
l’heure d’accès au statut au lieu de l’heure de modification. Lors du tri
explicite par heure (–sort=time ou -t) ou lors de l’absence de format de
liste long, trier selon l’heure d’accès. --hide=<PATTERN>-
ne pas lister les entrées implicites correspondant au MOTIF shell (surchargé par -a ou -A)
--ignore=<PATTERN>,-I <PATTERN>-
ne pas lister les entrées implicites correspondant au MOTIF shell
--ignore-backups,-B-
Ignorer les entrées qui se terminent par ~.
--sort=<field>-
Trier par
<champ>: name, none (-U), time (-t), size (-S), extension (-X) ou width -S-
Trier par taille de fichier, le plus grand en premier.
-t-
Trier par heure de modification (le ‘mtime’ dans l’inode), le plus récent en premier.
-v-
Tri naturel des numéros (de version) dans les noms de fichiers.
-X-
Trier alphabétiquement par extension d’entrée.
-U-
Ne pas trier ; lister les fichiers dans l’ordre où ils sont stockés dans le
répertoire. Ceci est particulièrement utile lors de l’affichage de très grands répertoires,
car ne pas trier peut être sensiblement plus rapide. --dereference,-L-
Lors de l’affichage d’informations de fichier pour un lien symbolique, afficher les informations pour le
fichier référencé par le lien plutôt que le lien lui-même. --dereference-command-line-symlink-to-dir-
Ne pas suivre les liens symboliques sauf quand ils pointent vers des répertoires et sont
donnés comme arguments de ligne de commande. --dereference-command-line,-H-
Ne pas suivre les liens symboliques sauf quand ils sont donnés comme arguments de ligne de commande.
--no-group,-G-
Ne pas afficher le groupe en format long.
--author-
Afficher l’auteur en format long. Sur les plateformes prises en charge,
l’auteur correspond toujours au propriétaire du fichier. --all,-a-
Ne pas ignorer les fichiers cachés (fichiers dont les noms commencent par ‘.’).
--almost-all,-A-
Dans un répertoire, ne pas ignorer tous les noms de fichiers qui commencent par ‘.’,
ignorer seulement ‘.’ et ‘..’. -f-
Liste tous les fichiers dans l’ordre du répertoire, non triés. Équivalent à -aU. Désactive –color sauf si spécifié explicitement.
--directory,-d-
Lister seulement les noms des répertoires, plutôt que le contenu des répertoires.
Ceci ne suivra pas les liens symboliques à moins qu’une des options--dereference-command-line (-H),--dereference (-L), ou--dereference-command-line-symlink-to-dirsoit spécifiée. --human-readable,-h-
Afficher les tailles de fichiers lisibles par l’homme (par ex. 1K 234M 56G).
--kibibytes,-k-
par défaut aux blocs de 1024 octets pour l’utilisation du système de fichiers ; utilisé seulement avec -s et par
totaux de répertoire --si-
Afficher les tailles de fichiers lisibles par l’homme utilisant des puissances de 1000 au lieu de 1024.
--block-size=<BLOCK_SIZE>-
dimensionner les tailles par BLOCK_SIZE lors de l’affichage
--inode,-i-
afficher le numéro d’index de chaque fichier
--reverse,-r-
Inverser quelle que soit la méthode de tri, par ex., lister les fichiers en ordre
alphabétique inverse, le plus jeune en premier, le plus petit en premier, ou autre. --recursive,-R-
Lister le contenu de tous les répertoires récursivement.
--width=<COLS>,-w <COLS>-
Supposer que le terminal a COLS colonnes de largeur.
--size,-s-
afficher la taille allouée de chaque fichier, en blocs
--color-
Colorier la sortie basée sur le type de fichier.
--indicator-style-
Ajouter un indicateur avec le style WORD aux noms d’entrée :
none (par défaut), slash (-p), file-type (–file-type), classify (-F) --classify=<when>,-F <when>-
Ajouter un caractère à chaque nom de fichier indiquant le type de fichier. Aussi, pour
les fichiers réguliers qui sont exécutables, ajouter ‘*’. Les indicateurs de type de fichier sont
‘/’ pour les répertoires, ‘@’ pour les liens symboliques, ‘|’ pour les FIFOs, ‘=’ pour les sockets,
‘>’ pour les portes, et rien pour les fichiers réguliers. when peut être omis, ou un de :
none - Ne pas classifier. C’est la valeur par défaut.
auto - Classifier seulement si la sortie standard est un terminal.
always - Toujours classifier.
Spécifier –classify et aucun when est équivalent à –classify=always. Ceci ne
suivra pas les liens symboliques listés sur la ligne de commande à moins que les
options –dereference-command-line (-H), –dereference (-L), ou
–dereference-command-line-symlink-to-dir soient spécifiées. --file-type-
Identique à –classify, mais ne pas ajouter ‘*’
-p-
Ajouter l’indicateur / aux répertoires.
--time-style=<TIME_STYLE>-
format de date/heure avec -l ; voir TIME_STYLE ci-dessous
--full-time-
comme -l –time-style=full-iso
--context,-Z-
afficher tout contexte de sécurité de chaque fichier
--group-directories-first-
grouper les répertoires avant les fichiers ; peut être augmenté avec
une option –sort, mais toute utilisation de –sort=none (-U) désactive le groupement
L’argument TIME_STYLE peut être full-iso, long-iso, iso, locale ou +FORMAT. FORMAT est interprété comme dans date. De plus, la variable d’environnement TIME_STYLE définit le style par défaut à utiliser.
Examples
Liste les fichiers, un par ligne :
ls -1
Liste tous les fichiers, ainsi que les fichiers cachés :
ls {{[-a|--all]}}
Liste tous les fichiers, avec les noms de répertoires suivis d’un / :
ls {{[-F|--classify]}}
Liste tous les fichiers avec un format détaillé (permissions, propriétaire, taille et date de modification) :
ls {{[-la|-l --all]}}
Liste les fichiers avec un format détaillé en utilisant des préfixes d’unités (KiB, MiB, GiB) :
ls {{[-lh|-l --human-readable]}}
Liste les fichiers avec un format détaillé en triant par taille décroissante :
ls {{[-lSR|-lS --recursive]}}
Liste avec un format détaillé tous les fichiers en triant par date de modification (les plus anciennes en premier) :
ls {{[-ltr|-lt --reverse]}}
Liste uniquement les répertoires :
ls {{[-d|--directory]}} */
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
md5sum
md5sum [OPTION]... [FICHIER]...
Afficher le MD5 et la taille de chaque fichier
Options
--binary,-b--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--tag-
ck-common-help-tag
--text,-t--zero,-z-
ck-common-help-zero
Examples
Calculate the MD5 checksum for one or more files:
md5sum {{path/to/file1 path/to/file2 ...}}
Calculate and save the list of MD5 checksums to a file:
md5sum {{path/to/file1 path/to/file2 ...}} >{{path/to/file.md5}}
Calculate an MD5 checksum from stdin:
{{command}} | md5sum
Read a file of MD5 checksums and filenames and verify all files have matching checksums:
md5sum {{[-c|--check]}} {{path/to/file.md5}}
Only show a message for missing files or when verification fails:
md5sum {{[-c|--check]}} --quiet {{path/to/file.md5}}
Only show a message when verification fails, ignoring missing files:
md5sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.md5}}
Check a known MD5 checksum of a file:
echo {{known_md5_checksum_of_the_file}} {{path/to/file}} | md5sum {{[-c|--check]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
mkdir
mkdir [OPTION]... RÉPERTOIRE...
Créer les RÉPERTOIRE(s) donnés s’ils n’existent pas
Options
--mode,-m-
set file mode (not implemented on windows)
--parents,-p-
make parent directories as needed
--verbose,-v-
print a message for each created directory
-Z-
set SELinux security context of each created directory to the default type
--context=<CTX>-
like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX
Chaque MODE est de la forme [ugoa]*(-+=)+|[-+=]?[0-7]+.
Examples
Crée plusieurs répertoires dans le répertoire actuel :
mkdir {{répertoire_1 répertoire_2 ...}}
Crée des répertoires récursivement (utile pour créer des répertoires imbriqués) :
mkdir {{[-p|--parents]}} {{chemin/vers/répertoire}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
mkfifo
mkfifo [OPTION]... NOM...
Créer un FIFO avec le nom donné.
Options
--mode=<MODE>,-m <MODE>-
file permissions for the fifo
-Z-
set the SELinux security context to default type
--context=<CTX>-
like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX
Examples
Create a named pipe at a given path:
mkfifo {{path/to/pipe}}
Send data through a named pipe and send the command to the background:
echo "{{Hello World}}" >{{path/to/pipe}} &
Receive data through a named pipe:
cat {{path/to/pipe}}
Share your terminal session in real-time:
mkfifo {{path/to/pipe}}; script {{[-f|--flush]}} {{path/to/pipe}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
mknod
mknod [OPTION]... NOM TYPE [MAJEUR MINEUR]
Créer le fichier spécial NOM du TYPE donné.
Options
--mode=<MODE>,-m <MODE>-
set file permission bits to MODE, not a=rw - umask
-
name of the new file
-
type of the new file (b, c, u or p)
-
major device number
-
minor device number
-Z-
set SELinux security context of the created file to the default type
--context=<CTX>-
like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX
Les arguments obligatoires pour les options longues le sont aussi pour les options courtes. -m, –mode=MODE définir les bits de permission de fichier à MODE, pas a=rw - umask
MAJEUR et MINEUR doivent tous deux être spécifiés quand TYPE est b, c, ou u, et ils doivent être omis quand TYPE est p. Si MAJEUR ou MINEUR commence par 0x ou 0X, il est interprété comme hexadécimal ; sinon, s’il commence par 0, comme octal ; sinon, comme décimal. TYPE peut être :
- b créer un fichier spécial bloc (mis en mémoire tampon)
- c, u créer un fichier spécial caractère (non mis en mémoire tampon)
- p créer un FIFO
NOTE : votre shell peut avoir sa propre version de mknod, qui remplace généralement la version décrite ici. Veuillez vous référer à la documentation de votre shell pour les détails sur les options qu’il supporte.
Examples
Create a block device:
sudo mknod {{path/to/device_file}} b {{major_device_number}} {{minor_device_number}}
Create a character device:
sudo mknod {{path/to/device_file}} c {{major_device_number}} {{minor_device_number}}
Create a FIFO (queue) device:
sudo mknod {{path/to/device_file}} p
Create a device file with default SELinux security context:
sudo mknod {{[-Z|--context]}} {{path/to/device_file}} {{type}} {{major_device_number}} {{minor_device_number}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
mktemp
mktemp [OPTION]... [MODÈLE]
Créer un fichier ou répertoire temporaire.
Options
--directory,-d-
Make a directory instead of a file
--dry-run,-u-
do not create anything; merely print a name (unsafe)
--quiet,-q-
Fail silently if an error occurs.
--suffix=<SUFFIX>-
append SUFFIX to TEMPLATE; SUFFIX must not contain a path separator. This option is implied if TEMPLATE does not end with X.
-p <DIR>-
short form of –tmpdir
--tmpdir=<DIR>-
interpret TEMPLATE relative to DIR; if DIR is not specified, use $TMPDIR ($TMP on windows) if set, else /tmp. With this option, TEMPLATE must not be an absolute name; unlike with -t, TEMPLATE may contain slashes, but mktemp creates only the final component
-t-
Generate a template (using the supplied prefix and TMPDIR (TMP on windows) if set) to create a filename template [deprecated]
Examples
Create an empty temporary file and print its absolute path:
mktemp
Use a custom directory (defaults to $TMPDIR, or /tmp):
mktemp {{[-p |--tmpdir=]}}/{{path/to/temporary_directory}}
Use a custom path template (Xs are replaced with random alphanumeric characters):
mktemp {{/tmp/example.XXXXXXXX}}
Use a custom file name template:
mktemp -t {{example.XXXXXXXX}}
Create an empty temporary file with the given suffix and print its absolute path:
mktemp --suffix {{.ext}}
Create an empty temporary directory and print its absolute path:
mktemp {{[-d|--directory]}}
Print the name of a temporary file or directory without actually creating it:
mktemp {{[-u|--dry-run]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
more
more [OPTIONS] FICHIER...
Afficher le contenu d’un fichier texte
Options
--silent,-d-
Display help instead of ringing bell when an illegal key is pressed
--logical,-f-
Count logical lines, rather than screen lines
--exit-on-eof,-e-
Exit on End-Of-File
--no-pause,-l-
Do not pause after any line containing a ^L (form feed)
--print-over,-p-
Do not scroll, clear screen and display text
--clean-print,-c-
Do not scroll, display text and clean line ends
--squeeze,-s-
Squeeze multiple blank lines into one
--plain,-u-
Suppress underlining
--lines=<number>,-n <number>-
The number of lines per screen full
--number-
Same as –lines option argument
--from-line=<number>,-F <number>-
Start displaying each file at line number
--pattern=<pattern>,-P <pattern>-
The string to be searched in each file before starting to display it
-
Path to the files to be read
Examples
Open a file:
more {{path/to/file}}
Display a specific line:
more +{{line_number}} {{path/to/file}}
Go to the next page:
<Space>
Search for a string (press <n> to go to the next match):
</>{{something}}<Enter>
Exit:
<q>
Display help about interactive commands:
<h>
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
mv
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... RÉPERTOIRE
mv [OPTION]... -t RÉPERTOIRE SOURCE...
Déplacer SOURCE vers DEST, ou plusieurs SOURCE(s) vers RÉPERTOIRE.
Options
--force,-f-
ne pas demander avant d’écraser
--interactive,-i-
demander avant d’écraser
--no-clobber,-n-
ne pas écraser un fichier existant
--strip-trailing-slashes-
supprimer toutes les barres obliques de fin de chaque argument SOURCE
--backup=<CONTROL>-
make a backup of each existing destination file
-b-
like –backup but does not accept an argument
--suffix=<SUFFIX>,-S <SUFFIX>-
override the usual backup suffix
--update-
move only when the SOURCE file is newer than the destination file or when the destination file is missing
-u-
like –update but does not accept an argument
--target-directory=<DIRECTORY>,-t <DIRECTORY>-
déplacer tous les arguments SOURCE dans RÉPERTOIRE
--no-target-directory,-T-
traiter DEST comme un fichier normal
--verbose,-v-
expliquer ce qui est fait
--progress,-g-
Afficher une barre de progression.
Note : cette fonctionnalité n’est pas prise en charge par GNU coreutils. -Z-
définir le contexte de sécurité SELinux du fichier de destination au type par défaut
--context=<CTX>-
comme -Z, ou si CTX est spécifié, définir le contexte de sécurité SELinux à CTX
--debug-
expliquer comment un fichier est copié. Implique -v
--exchange-
échanger la source et la destination (les permuter de façon atomique)
Lors de la spécification de plus d’une option parmi -i, -f, -n, seule la dernière prend effet.
Ne pas déplacer un non-répertoire qui a une destination existante avec un horodatage de modification identique ou plus récent ; au lieu de cela, ignorer silencieusement le fichier sans échouer. Si le déplacement traverse les limites du système de fichiers, la comparaison est avec l’horodatage source tronqué aux résolutions du système de fichiers de destination et des appels système utilisés pour mettre à jour les horodatages ; cela évite le travail en double si plusieurs commandes mv -u sont exécutées avec la même source et destination. Cette option est ignorée si l’option -n ou –no-clobber est également spécifiée, qui donne plus de contrôle sur quels fichiers existants dans la destination sont remplacés, et sa valeur peut être une des suivantes :
- all C’est l’opération par défaut quand une option –update n’est pas spécifiée, et résulte en tous les fichiers existants dans la destination étant remplacés.
- none C’est similaire à l’option –no-clobber, en ce que aucun fichier dans la destination n’est remplacé, mais aussi ignorer un fichier n’induit pas un échec.
- older C’est l’opération par défaut quand –update est spécifié, et résulte en des fichiers étant remplacés s’ils sont plus anciens que le fichier source correspondant.
Examples
Rename a file or directory when the target is not an existing directory:
mv {{path/to/source}} {{path/to/target}}
Move a file or directory into an existing directory:
mv {{path/to/source}} {{path/to/existing_directory}}
Move multiple files into an existing directory, keeping the filenames unchanged:
mv {{path/to/source1 path/to/source2 ...}} {{path/to/existing_directory}}
Do not prompt for confirmation before overwriting existing files:
mv {{[-f|--force]}} {{path/to/source}} {{path/to/target}}
Prompt for confirmation interactively before overwriting existing files, regardless of file permissions:
mv {{[-i|--interactive]}} {{path/to/source}} {{path/to/target}}
Do not overwrite existing files at the target:
mv {{[-n|--no-clobber]}} {{path/to/source}} {{path/to/target}}
Move files in verbose mode, showing files after they are moved:
mv {{[-v|--verbose]}} {{path/to/source}} {{path/to/target}}
Specify target directory so that you can use external tools to gather movable files:
{{find /var/log -type f -name '*.log' -print0}} | {{xargs -0}} mv {{[-t|--target-directory]}} {{path/to/target_directory}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
nice
nice [OPTION] [COMMANDE [ARG]...]
Exécute COMMANDE avec une priorité ajustée, ce qui affecte l’ordonnancement des processus. Sans COMMANDE, affiche la priorité actuelle. Les valeurs de priorité vont de -20 (plus favorable au processus) à 19 (moins favorable au processus).
Options
--adjustment,-n-
add N to the niceness (default is 10)
Examples
Print the current niceness value:
nice
Increment the current niceness value by 10:
nice nice
Launch a program with lowered priority:
nice -{{niceness_value}} {{command}}
Launch a program with heightened priority:
sudo nice --{{niceness_value}} {{command}}
Define the priority with an explicit option:
nice {{[-n|--adjustment]}} {{-20..19}} {{command}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
nl
nl [OPTION]... [FICHIER]...
Numéroter les lignes des fichiers
Options
--help-
Afficher les informations d’aide.
--body-numbering=<STYLE>,-b <STYLE>-
utiliser STYLE pour numéroter les lignes du corps
--section-delimiter=<CC>,-d <CC>-
utiliser CC pour séparer les pages logiques
--footer-numbering=<STYLE>,-f <STYLE>-
utiliser STYLE pour numéroter les lignes de pied de page
--header-numbering=<STYLE>,-h <STYLE>-
utiliser STYLE pour numéroter les lignes d’en-tête
--line-increment=<NUMBER>,-i <NUMBER>-
incrément du numéro de ligne à chaque ligne
--join-blank-lines=<NUMBER>,-l <NUMBER>-
groupe de NUMBER lignes vides comptées comme une seule
--number-format=<FORMAT>,-n <FORMAT>-
insérer les numéros de ligne selon FORMAT
--no-renumber,-p-
ne pas remettre à zéro les numéros de ligne aux pages logiques
--number-separator=<STRING>,-s <STRING>-
ajouter STRING après le numéro de ligne (éventuel)
--starting-line-number=<NUMBER>,-v <NUMBER>-
premier numéro de ligne sur chaque page logique
--number-width=<NUMBER>,-w <NUMBER>-
utiliser NUMBER colonnes pour les numéros de ligne
STYLE est l’un des suivants :
- a numéroter toutes les lignes
- t numéroter seulement les lignes non vides
- n ne numéroter aucune ligne
- pBRE numéroter seulement les lignes qui contiennent une correspondance pour l’expression régulière de base, BRE
FORMAT est l’un des suivants :
- ln justifié à gauche, sans zéros en tête
- rn justifié à droite, sans zéros en tête
- rz justifié à droite, avec zéros en tête
Examples
Number non-blank lines in a file:
nl {{path/to/file}}
Read from stdin:
{{command}} | nl
Number [a]ll body lines including blank lines or do [n]ot number body lines:
nl {{[-b|--body-numbering]}} {{a|n}} {{path/to/file}}
Number only the body lines that match a basic regex (BRE) [p]attern:
nl {{[-b|--body-numbering]}} p'FooBar[0-9]' {{path/to/file}}
Use a specific increment for line numbering:
nl {{[-i|--line-increment]}} {{increment}} {{path/to/file}}
Specify the line numbering format to [r]ight or [l]eft justified, keeping leading [z]eros or [n]ot:
nl {{[-n|--number-format]}} {{rz|ln|rn}}
Specify the line numbering’s width (6 by default):
nl {{[-w|--number-width]}} {{col_width}} {{path/to/file}}
Use a specific string to separate the line numbers from the lines (TAB by default):
nl {{[-s|--number-separator]}} {{separator}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
nohup
nohup COMMANDE [ARG]...
nohup OPTION
Exécuter COMMANDE en ignorant les signaux de raccrochage.
Options
Si l’entrée standard est un terminal, elle sera remplacée par /dev/null. Si la sortie standard est un terminal, elle sera ajoutée à nohup.out à la place, ou $HOME/nohup.out, si l’ouverture de nohup.out a échoué. Si l’erreur standard est un terminal, elle sera redirigée vers la sortie standard.
Examples
Run a process that can live beyond the terminal:
nohup {{command}} {{argument1 argument2 ...}}
Launch nohup in background mode:
nohup {{command}} {{argument1 argument2 ...}} &
Run a shell script that can live beyond the terminal:
nohup {{path/to/script.sh}} &
Run a process and write the output to a specific file:
nohup {{command}} {{argument1 argument2 ...}} >{{path/to/output_file}} &
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
nproc
nproc [OPTIONS]...
Affiche le nombre de cœurs disponibles pour le processus actuel. Si les variables d’environnement OMP_NUM_THREADS ou OMP_THREAD_LIMIT sont définies, elles détermineront respectivement la valeur minimale et maximale retournée.
Options
--all-
print the number of cores available to the system
--ignore=<N>-
ignore up to N cores
Examples
Display the number of available processing units:
nproc
Display the number of installed processing units, including any inactive ones:
nproc --all
If possible, subtract a given number of units from the returned value:
nproc --ignore {{count}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
numfmt
numfmt [OPTION]... [NOMBRE]...
Convertir les nombres vers/depuis des chaînes lisibles par l’homme
Options
--debug-
print warnings about invalid input
--grouping-
use locale-defined grouping of digits, for example 1,000,000 (which means it has no effect in the C/POSIX locale)
--delimiter=<X>,-d <X>-
use X instead of whitespace for field delimiter
--field=<FIELDS>-
replace the numbers in these input fields; see FIELDS below
--format=<FORMAT>-
use printf style floating-point FORMAT; see FORMAT below for details
--from=<UNIT>-
auto-scale input numbers to UNITs; see UNIT below
--from-unit=<N>-
specify the input unit size
--to=<UNIT>-
auto-scale output numbers to UNITs; see UNIT below
--to-unit=<N>-
the output unit size
--padding=<N>-
pad the output to N characters; positive N will right-align; negative N will left-align; padding is ignored if the output is wider than N; the default is to automatically pad if a whitespace is found
--header=<N>-
print (without converting) the first N header lines; N defaults to 1 if not specified
--round=<METHOD>-
use METHOD for rounding when scaling
--suffix=<SUFFIX>-
print SUFFIX after each formatted number, and accept inputs optionally ending with SUFFIX
--unit-separator=<STRING>-
use STRING to separate the number from any unit when printing; by default, no separator is used
--invalid=<INVALID>-
set the failure mode for invalid input
--zero-terminated,-z-
line delimiter is NUL, not newline
Options d’UNITÉ :
-
none : aucune mise à l’échelle automatique n’est effectuée ; les suffixes déclencheront une erreur
-
auto : accepter un suffixe optionnel d’une/deux lettres :
1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576,
-
si : accepter un suffixe optionnel d’une lettre :
1K = 1000, 1M = 1000000, …
-
iec : accepter un suffixe optionnel d’une lettre :
1K = 1024, 1M = 1048576, …
-
iec-i : accepter un suffixe optionnel de deux lettres :
1Ki = 1024, 1Mi = 1048576, …
-
FIELDS supporte les plages de champs de style cut(1) :
N N-ième champ, compté à partir de 1 N- du N-ième champ jusqu’à la fin de la ligne N-M du N-ième au M-ième champ (inclus) -M du premier au M-ième champ (inclus)
- tous les champs
Plusieurs champs/plages peuvent être séparés par des virgules
FORMAT doit être adapté pour imprimer un argument à virgule flottante %f. Une guillemet optionnelle (%’f) activera –grouping (si pris en charge par la locale actuelle). Une valeur de largeur optionnelle (%10f) remplira la sortie. Un zéro optionnel (%010f) remplira le nombre de zéros. Des valeurs négatives optionnelles (%-10f) aligneront à gauche. Une précision optionnelle (%.1f) remplacera la précision déterminée par l’entrée.
Examples
Convert 1.5K (SI Units) to 1500:
numfmt --from si 1.5K
Convert 1500 to 1.5K (SI Units):
numfmt --to si 1500
Convert 1.5K (IEC Units) to 1536:
numfmt --from iec 1.5K
Use appropriate conversion based on the suffix:
numfmt --from auto {{1.5Ki}}
Convert 5th field (1-indexed) to IEC Units without converting header:
ls -l | numfmt --header=1 --field 5 --to iec
Convert to IEC units, pad with 5 characters, left aligned:
du {{[-s|--summarize]}} * | numfmt --to iec --format "%-5f"
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
od
od [OPTION]... [--] [NOMFICHIER]...
od [-abcdDefFhHiIlLoOsxX] [NOMFICHIER] [[+][0x]DÉCALAGE[.][b]]
od --traditional [OPTION]... [NOMFICHIER] [[+][0x]DÉCALAGE[.][b] [[+][0x]ÉTIQUETTE[.][b]]]
Afficher les fichiers en format octal et autres formats
Options
--help-
Print help information.
--address-radix=<RADIX>,-A <RADIX>-
Select the base in which file offsets are printed.
--skip-bytes=<BYTES>,-j <BYTES>-
Skip BYTES input bytes before formatting and writing.
--read-bytes=<BYTES>,-N <BYTES>-
limit dump to BYTES input bytes
--endian=<big|little>-
byte order to use for multi-byte formats
--strings=<BYTES>,-S <BYTES>-
output strings of at least BYTES graphic chars. 3 is assumed when BYTES is not specified.
-a-
named characters, ignoring high-order bit
-b-
octal bytes
-c-
ASCII characters or backslash escapes
-d-
unsigned decimal 2-byte units
-D-
unsigned decimal 4-byte units
-o-
octal 2-byte units
-I-
decimal 8-byte units
-L-
decimal 8-byte units
-i-
decimal 4-byte units
-l-
decimal 8-byte units
-x-
hexadecimal 2-byte units
-h-
hexadecimal 2-byte units
-O-
octal 4-byte units
-s-
decimal 2-byte units
-X-
hexadecimal 4-byte units
-H-
hexadecimal 4-byte units
-e-
floating point double precision (64-bit) units
-f-
floating point single precision (32-bit) units
-F-
floating point double precision (64-bit) units
--format=<TYPE>,-t <TYPE>-
select output format or formats
--output-duplicates,-v-
do not use * to mark line suppression
--width=<BYTES>,-w <BYTES>-
output BYTES bytes per output line. 32 is implied when BYTES is not
specified. --traditional-
compatibility mode with one input, offset and label.
Affiche les données dans divers formats lisibles par l’homme. Si plusieurs formats sont spécifiés, la sortie contiendra tous les formats dans l’ordre où ils apparaissent sur la ligne de commande. Chaque format sera imprimé sur une nouvelle ligne. Seule la ligne contenant le premier format sera préfixée avec le décalage.
Si aucun nom de fichier n’est spécifié, ou si c’est “-”, stdin sera utilisé. Après un “–”, aucune autre option ne sera reconnue. Cela permet d’avoir des noms de fichiers commençant par “-”.
Si un nom de fichier est un nombre valide qui peut être utilisé comme décalage dans la deuxième forme, vous pouvez le forcer à être reconnu comme un nom de fichier si vous incluez une option comme “-j0”, qui n’est valide que dans la première forme.
RADIX est l’un de o,d,x,n pour octal, décimal, hexadécimal ou aucun.
OCTETS est décimal par défaut, octal si préfixé par “0”, ou hexadécimal si préfixé par “0x”. Les suffixes b, KB, K, MB, M, GB, G multiplieront le nombre par 512, 1000, 1024, 1000^2, 1024^2, 1000^3, 1024^3, 1000^2, 1024^2.
DÉCALAGE et ÉTIQUETTE sont octaux par défaut, hexadécimaux si préfixés par “0x” ou décimaux si un suffixe “.” est ajouté. Le suffixe “b” multipliera par 512.
TYPE contient une ou plusieurs spécifications de format constituées de : a pour ASCII imprimable 7-bits c pour caractères utf-8 ou octal pour caractères non définis d[TAILLE] pour décimal signé f[TAILLE] pour virgule flottante o[TAILLE] pour octal u[TAILLE] pour décimal non signé x[TAILLE] pour hexadécimal TAILLE est le nombre d’octets qui peut être le nombre 1, 2, 4, 8 ou 16, ou C, S, I, L pour 1, 2, 4, 8 octets pour les types entiers, ou F, D, L pour 4, 8, 16 octets pour les virgules flottantes. Toute spécification de type peut avoir un suffixe “z”, qui ajoutera un dump ASCII à la fin de la ligne.
Si une erreur s’est produite, un message de diagnostic sera imprimé sur stderr, et le code de sortie sera non-zéro.
Examples
Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with *:
od {{path/to/file}}
Display file in verbose mode, i.e. without replacing duplicate lines with *:
od {{[-v|--output-duplicates]}} {{path/to/file}}
Display file in hexadecimal format (2-byte units), with byte offsets in decimal format:
od {{[-t|--format]}} {{x}} {{[-A|--address-radix]}} {{d}} {{[-v|--output-duplicates]}} {{path/to/file}}
Display file in hexadecimal format (1-byte units), and 4 bytes per line:
od {{[-t|--format]}} {{x1}} {{[-w|--width=]}}4 {{[-v|--output-duplicates]}} {{path/to/file}}
Display file in hexadecimal format along with its character representation, and do not print byte offsets:
od {{[-t|--format]}} {{xz}} {{[-A|--address-radix]}} {{n}} {{[-v|--output-duplicates]}} {{path/to/file}}
Read only 100 bytes of a file starting from the 500th byte:
od {{[-N|--read-bytes]}} 100 {{[-j|--skip-bytes]}} 500 {{[-v|--output-duplicates]}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
paste
paste [OPTIONS] [FICHIER]...
Écrire les lignes composées des lignes correspondantes séquentiellement de chaque FICHIER, séparées par des TABs, vers la sortie standard.
Options
--serial,-s-
paste one file at a time instead of in parallel
--delimiters=<LIST>,-d <LIST>-
reuse characters from LIST instead of TABs
--zero-terminated,-z-
line delimiter is NUL, not newline
Examples
Join all the lines into a single line, using TAB as delimiter:
paste {{[-s|--serial]}} {{path/to/file}}
Join all the lines into a single line, using the specified delimiter:
paste {{[-s|--serial]}} {{[-d|--delimiters]}} {{delimiter}} {{path/to/file}}
Merge two files side by side, each in its column, using TAB as delimiter:
paste {{path/to/file1}} {{path/to/file2}}
Merge two files side by side, each in its column, using the specified delimiter:
paste {{[-d|--delimiters]}} {{delimiter}} {{path/to/file1}} {{path/to/file2}}
Merge two files, with lines added alternatively:
paste {{[-d|--delimiters]}} '\n' {{path/to/file1}} {{path/to/file2}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
pathchk
pathchk [OPTION]... NOM...
Vérifier si les noms de fichiers sont valides ou portables
Options
-p-
check for most POSIX systems
-P-
check for empty names and leading “-”
--portability-
check for all POSIX systems (equivalent to -p -P)
Examples
Check pathnames for validity in the current system:
pathchk {{path1 path2 ...}}
Check pathnames for validity on a wider range of POSIX compliant systems:
pathchk -p {{path1 path2 ...}}
Check pathnames for validity on all POSIX compliant systems:
pathchk {{[-p -P|--portability]}} {{path1 path2 ...}}
Only check for empty pathnames or leading dashes (-):
pathchk -P {{path1 path2 ...}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
pinky
pinky [OPTION]... [UTILISATEUR]...
Affiche des informations brèves sur les utilisateurs des systèmes Unix
Options
-l-
produire une sortie au format long pour les UTILISATEURS spécifiés
-b-
omettre le répertoire personnel et le shell de l’utilisateur en format long
-h-
omettre le fichier projet de l’utilisateur en format long
-p-
omettre le fichier plan de l’utilisateur en format long
-s-
faire une sortie au format court, c’est le défaut
-f-
omettre la ligne des en-têtes de colonnes en format court
-w-
omettre le nom complet de l’utilisateur en format court
-i-
omettre le nom complet et l’hôte distant de l’utilisateur en format court
-q-
omettre le nom complet, l’hôte distant et le temps d’inactivité de l’utilisateur en format court
--lookup-
tenter de donner un forme canonique aux noms d’hôte avec DNS
--help-
Afficher les informations d’aide
Examples
Display details about the current user:
pinky
Display details for a specific user:
pinky {{user}}
Display details in the long format:
pinky {{user}} -l
Omit the user’s home directory and shell in long format:
pinky {{user}} -lb
Omit the user’s project file in long format:
pinky {{user}} -lh
Omit the column headings in short format:
pinky {{user}} -f
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
pr
pr [OPTION]... [FICHIER]...
paginer ou présenter en colonnes le(s) FICHIER(s) pour l’impression
Options
--pages=<FIRST_PAGE[:LAST_PAGE]>-
Begin and stop printing with page FIRST_PAGE[:LAST_PAGE]
--header=<STRING>,-h <STRING>-
Use the string header to replace the file name
in the header line. --date-format=<FORMAT>,-D <FORMAT>-
Use ‘date’-style FORMAT for the header date.
--double-space,-d-
Produce output that is double spaced. An extra
<newline>
character is output following every<newline>found in the input. --number-lines=<[char][width]>,-n <[char][width]>-
Provide width digit line numbering. The default for width,
if not specified, is 5. The number occupies the first width column
positions of each text column or each line of -m output. If char
(any non-digit character) is given, it is appended to the line number
to separate it from whatever follows. The default for char is a<tab>.
Line numbers longer than width columns are truncated. --first-line-number=<NUMBER>,-N <NUMBER>-
start counting with NUMBER at 1st line of first page printed
--omit-header,-t-
Write neither the five-line identifying header nor the five-line
trailer usually supplied for each page. Quit writing after the last line
of each file without spacing to the end of the page. --omit-pagination,-T-
omit page headers and trailers, eliminate any pagination
by form feeds set in input files --length=<PAGE_LENGTH>,-l <PAGE_LENGTH>-
Override the 66-line default (default number of lines of text 56,
and with -F 63) and reset the page length to lines. If lines is not
greater than the sum of both the header and trailer depths (in lines),
the pr utility shall suppress both the header and trailer, as if the -t
option were in effect. --no-file-warnings,-r-
omit warning when a file cannot be opened
--form-feed,-F,-f-
Use a
<form-feed>for new pages, instead of the default behavior that
uses a sequence of<newline>s. --width=<width>,-w <width>-
Set the width of the line to width column positions for multiple
text-column output only. If the -w option is not specified and the -s option
is not specified, the default width shall be 72. If the -w option is not specified
and the -s option is specified, the default width shall be 512. --page-width=<width>,-W <width>-
set page width to PAGE_WIDTH (72) characters always,
truncate lines, except -J option is set, no interference
with -S or -s --across,-a-
Modify the effect of the -COLUMN option so that the columns are filled
across the page in a round-robin order (for example, when column is 2, the
first input line heads column 1, the second heads column 2, the third is the
second line in column 1, and so on). -b--columns=<columns>-
Produce multi-column output that is arranged in column columns
(the default shall be 1) and is written down each column in the order in which
the text is received from the input file. This option should not be used with -m.
The options -e and -i shall be assumed for multiple text-column output. Whether
or not text columns are produced with identical vertical lengths is unspecified,
but a text column shall never exceed the length of the page (see the -l option).
When used with -t, use the minimum number of lines to write the output. --separator=<char>,-s <char>-
Separate text columns by the single character char instead of by the
appropriate number of<space>s (default for char is the<tab>character). --sep-string=<string>,-S <string>-
separate columns by STRING,
without -S: Default separator<TAB>with -J and<space>
otherwise (same as -S" "), no effect on column options --merge,-m-
Merge files. Standard output shall be formatted so the pr utility
writes one line from each file specified by a file operand, side by side
into text columns of equal fixed widths, in terms of the number of column
positions. Implementations shall support merging of at least nine file operands. --indent=<margin>,-o <margin>-
Each line of output shall be preceded by offset
<space>s. If the -o
option is not specified, the default offset shall be zero. The space taken is
in addition to the output line width (see the -w option below). --join-lines,-J-
merge full lines, turns off -W line truncation, no column
alignment, –sep-string[=STRING] sets separators --help-
Print help information
--expand-tabs=<[CHAR][WIDTH]>,-e <[CHAR][WIDTH]>-
expand input CHARs (TABs) to tab WIDTH (8)
Si aucun FICHIER n’est donné, ou si FICHIER est -, lire l’entrée standard.
Lors de la création d’une sortie multi-colonnes, les colonnes auront une largeur égale. Lors de l’utilisation de l’option ‘-s’ pour séparer les colonnes, le séparateur par défaut est un caractère de tabulation unique. Lors de l’utilisation de l’option ‘-S’ pour séparer les colonnes, le séparateur par défaut est un caractère d’espace unique.
Examples
Print multiple files with a default header and footer:
pr {{path/to/file1 path/to/file2 ...}}
Print with a custom centered header:
pr {{[-h|--header]}} "{{header}}" {{path/to/file1 path/to/file2 ...}}
Print with numbered lines and a custom date format:
pr {{[-n|--number-lines]}} {{[-D|--date-format]}} "{{format}}" {{path/to/file1 path/to/file2 ...}}
Print all files together, one in each column, without a header or footer:
pr {{[-m|--merge]}} {{[-T|--omit-pagination]}} {{path/to/file1 path/to/file2 ...}}
Print, beginning at page 2 up to page 5, with a given page length (including header and footer):
pr +2:5 {{[-l|--length]}} {{page_length}} {{path/to/file1 path/to/file2 ...}}
Print with an offset for each line and a truncating custom page width:
pr {{[-o|--indent]}} {{offset}} {{[-W|--page-width]}} {{width}} {{path/to/file1 path/to/file2 ...}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
printenv
printenv [OPTION]... [VARIABLE]...
Afficher les valeurs des VARIABLE(s) d’environnement spécifiées, ou (sans VARIABLE) afficher les paires nom et valeur pour toutes.
Options
--null,-0-
terminer chaque ligne de sortie avec un octet 0 plutôt qu’un saut de ligne
--quoting-style-
Set quoting style
Examples
Display key-value pairs of all environment variables:
printenv
Display the value of a specific variable:
printenv {{HOME}}
Display the value of a variable and end with NUL instead of newline:
printenv {{[-0|--null]}} {{HOME}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
printf
printf FORMAT [ARGUMENT]...
printf OPTION
Afficher la sortie basée sur la chaîne de format et les arguments suivants.
Options
--help-
Afficher cette aide
--version-
Afficher les informations de version
templating de chaîne anonyme de base :
affiche la chaîne de format au moins une fois, se répétant tant qu’il reste des arguments la sortie affiche les littéraux échappés dans la chaîne de format comme des littéraux de caractères la sortie remplace les champs anonymes par le prochain argument inutilisé, formaté selon le champ.
Affiche le , en remplaçant les séquences de caractères échappés par des littéraux de caractères et les séquences de champs de substitution par les arguments passés
littéralement, à l’exception de ce qui suit séquences de caractères échappés, et les séquences de substitution décrites plus loin.
SÉQUENCES D’ÉCHAPPEMENT
Les séquences d’échappement suivantes, organisées ici par ordre alphabétique, afficheront le littéral de caractère correspondant :
-
" guillemet double
-
\ barre oblique inverse
-
\a alerte (BEL)
-
\b retour arrière
-
\c Fin d’entrée
-
\e échappement
-
\f saut de page
-
\n nouvelle ligne
-
\r retour chariot
-
\t tabulation horizontale
-
\v tabulation verticale
-
\NNN octet avec valeur exprimée en valeur octale NNN (1 à 3 chiffres) les valeurs supérieures à 256 seront traitées
-
\xHH octet avec valeur exprimée en valeur hexadécimale NN (1 à 2 chiffres)
-
\uHHHH caractère Unicode (IEC 10646) avec valeur exprimée en valeur hexadécimale HHHH (4 chiffres)
-
\uHHHH caractère Unicode avec valeur exprimée en valeur hexadécimale HHHH (8 chiffres)
-
%% un seul %
SUBSTITUTIONS
RÉFÉRENCE RAPIDE DES SUBSTITUTIONS
Champs
-
%s: chaîne
-
%b: chaîne analysée pour les littéraux, le deuxième paramètre est la longueur max
-
%c: caractère, pas de deuxième paramètre
-
%i ou %d: entier 64 bits
-
%u: entier non signé 64 bits
-
%x ou %X: entier non signé 64 bits en hexadécimal
-
%o: entier non signé 64 bits en octal le deuxième paramètre est la largeur min, entier la sortie en dessous de cette largeur est remplie avec des zéros en tête
-
%q: ARGUMENT est affiché dans un format qui peut être réutilisé comme entrée shell, en échappant les caractères non imprimables avec la syntaxe POSIX $‘’ proposée.
-
%f ou %F: valeur en virgule flottante décimale
-
%e ou %E: valeur en virgule flottante en notation scientifique
-
%g ou %G: plus courte des valeurs en virgule flottante décimale ou SciNote interprétées spécialement. le deuxième paramètre est -max places après la virgule pour la sortie en virgule flottante -max nombre de chiffres significatifs pour la sortie en notation scientifique
paramétrage des champs
exemples :
printf ‘%4.3i’ 7
Il a un premier paramètre de 4 et un deuxième paramètre de 3 et donnera ’ 007’
printf ‘%.1s’ abcde
Il n’a pas de premier paramètre et un deuxième paramètre de 1 et donnera ‘a’
printf ‘%4c’ q
Il a un premier paramètre de 4 et pas de deuxième paramètre et donnera ’ q’
Le premier paramètre d’un champ est la largeur minimale pour remplir la sortie si la sortie est inférieure à cette valeur absolue de cette largeur, elle sera remplie avec des espaces en tête, ou, si l’argument est négatif, avec des espaces en queue. la valeur par défaut est zéro.
Le deuxième paramètre d’un champ est particulier au type de champ de sortie. les valeurs par défaut peuvent être trouvées dans l’aide de substitution complète ci-dessous
préfixes spéciaux pour les arguments numériques
- 0: (ex. 010) interpréter l’argument comme octal (champs de sortie entiers uniquement)
- 0x: (ex. 0xABC) interpréter l’argument comme hexadécimal (champs de sortie numériques uniquement)
- ': (ex. 'a) interpréter l’argument comme une constante de caractère
COMMENT UTILISER LES SUBSTITUTIONS
Les substitutions sont utilisées pour passer des argument(s) supplémentaire(s) dans la chaîne FORMAT, pour être formatés d’une manière particulière. Par ex.
printf ‘la lettre %X vient avant la lettre %X’ 10 11
affichera
la lettre A vient avant la lettre B
parce que le champ de substitution %X signifie ‘prendre un argument entier et l’écrire comme un nombre hexadécimal’
Passer plus d’arguments qu’il n’y en a dans la chaîne de format fera que la chaîne de format sera répétée pour les substitutions restantes
printf ‘il fait %i F à %s \n’ 22 Portland 25 Boston 27 New York
affichera
il fait 22 F à Portland il fait 25 F à Boston il fait 27 F à Boston
Si une chaîne de format est affichée mais qu’il reste moins d’arguments qu’il n’y a de champs de substitution, les champs de substitution sans argument auront par défaut des chaînes vides, ou pour les champs numériques la valeur 0
SUBSTITUTIONS DISPONIBLES
Ce programme, comme GNU coreutils printf, interprète un sous-ensemble modifié de la spécification printf C POSIX, une référence rapide aux substitutions est ci-dessous.
SUBSTITUTIONS DE CHAÎNES
Tous les champs de chaîne ont un paramètre ‘largeur max’ %.3s signifie ‘afficher pas plus de trois caractères de l’entrée originale’
-
%s: chaîne
-
%b: chaîne échappée - la chaîne sera vérifiée pour tout littéral échappé de la liste de littéraux échappés ci-dessus, et les traduire en caractères littéraux. ex. \n sera transformé en caractère de nouvelle ligne. Une règle spéciale sur le mode %b est que les littéraux octaux sont interprétés différemment Dans les arguments passés par %b, les littéraux interprétés en octal doivent être sous la forme \0NNN au lieu de \NNN. (Bien que, pour des raisons d’héritage, les littéraux octaux sous la forme \NNN seront toujours interprétés et ne lanceront pas d’avertissement, vous aurez des problèmes si vous utilisez cela pour un littéral dont le code commence par zéro, car il sera vu comme étant sous forme \0NNN.)
-
%q: chaîne échappée - la chaîne dans un format qui peut être réutilisé comme entrée par la plupart des shells. Les caractères non imprimables sont échappés avec la syntaxe POSIX proposée ‘$’‘’, et les méta-caractères shell sont cités de manière appropriée. C’est un format équivalent à la sortie ls –quoting=shell-escape.
SUBSTITUTIONS DE CARACTÈRES
Le champ caractère n’a pas de paramètre secondaire.
- %c: un seul caractère
SUBSTITUTIONS D’ENTIERS
Tous les champs entiers ont un paramètre ‘remplir avec zéro’ %.4i signifie un entier qui s’il fait moins de 4 chiffres de longueur, est rempli avec des zéros en tête jusqu’à ce qu’il fasse 4 chiffres de longueur.
-
%d ou %i: entier 64 bits
-
%u: entier non signé 64 bits
-
%x ou %X: entier non signé 64 bits affiché en hexadécimal (base 16) %X au lieu de %x signifie utiliser des lettres majuscules pour ‘a’ à ‘f’
-
%o: entier non signé 64 bits affiché en octal (base 8)
SUBSTITUTIONS EN VIRGULE FLOTTANTE
Tous les champs en virgule flottante ont un paramètre ‘max places décimales / max chiffres significatifs’ %.10f signifie une virgule flottante décimale avec 7 places décimales après 0 %.10e signifie un nombre en notation scientifique avec 10 chiffres significatifs %.10g signifie le même comportement pour décimal et Sci. Note, respectivement, et fournit la plus courte de chaque sortie.
Comme avec GNU coreutils, la valeur après la virgule de ces sorties est analysée comme un double d’abord avant d’être rendue en texte. Pour les deux implémentations, n’attendez pas de précision significative au-delà de la 18ème place décimale. Lors de l’utilisation d’un nombre de places décimales qui est 18 ou plus élevé, vous pouvez vous attendre à une variation de sortie entre GNU coreutils printf et ce printf à la 18ème place décimale de +/- 1
-
%f: valeur en virgule flottante présentée en décimal, tronquée et affichée à 6 places décimales par défaut. Il n’y a pas de parité de comportement post-double avec Coreutils printf, les valeurs ne sont pas estimées ou ajustées au-delà des valeurs d’entrée.
-
%e ou %E: valeur en virgule flottante présentée en notation scientifique 7 chiffres significatifs par défaut %E signifie utiliser E majuscule pour la mantisse.
-
%g ou %G: valeur en virgule flottante présentée dans la plus courte des notations décimale et scientifique se comporte différemment de %f et %E, veuillez voir la spécification posix printf pour tous les détails, quelques exemples de comportement différent : Sci Note a 6 chiffres significatifs par défaut Les zéros de fin sont supprimés Au lieu d’être tronqué, le chiffre après le dernier est arrondi
Comme d’autres comportements dans cet utilitaire, les choix de conception du comportement en virgule flottante dans cet utilitaire sont sélectionnés pour reproduire exactement le comportement de printf de GNU coreutils du point de vue des entrées et sorties.
UTILISATION DES PARAMÈTRES
La plupart des champs de substitution peuvent être paramétrés en utilisant jusqu’à 2 nombres qui peuvent être passés au champ, entre le signe % et la lettre du champ.
Le 1er paramètre indique toujours la largeur minimale de sortie, il est utile pour créer une sortie en colonnes. Toute sortie qui serait inférieure à cette largeur minimale est remplie avec des espaces en tête Le 2ème paramètre est précédé d’un point. Vous n’êtes pas obligé d’utiliser des paramètres
FORMES SPÉCIALES D’ENTRÉE
Pour l’entrée numérique, les formes d’entrée supplémentaires suivantes sont acceptées en plus du décimal :
Octal (uniquement avec entier) : si l’argument commence par un 0, les caractères suivants seront interprétés comme octal (base 8) pour les champs entiers
Hexadécimal : si l’argument commence par 0x, les caractères suivants seront interprétés seront interprétés comme hexadécimal (base 16) pour tous les champs numériques pour les champs flottants, l’entrée hexadécimale résulte en une limite de précision (dans la conversion de l’entrée après la virgule) de 10^-15
Constante de caractère : si l’argument commence par un caractère guillemet simple, le premier octet du caractère suivant sera interprété comme un entier non signé 8 bits. S’il y a des octets supplémentaires, ils lanceront une erreur (sauf si la variable d’environnement POSIXLY_CORRECT est définie)
Examples
Print a text message:
printf "{{%s\n}}" "{{Hello world}}"
Print formatted message multiple times with different strings:
printf "%s\n" {{string1 string2 ...}}
Print an integer in bold blue:
printf "{{\e[1;34m%.3d\e[0m\n}}" {{42}}
Print a float number with the Unicode Euro sign:
printf "{{\u20AC %.2f\n}}" {{123.4}}
Print a text message composed with environment variables:
printf "{{var1: %s\tvar2: %s\n}}" "{{$VAR1}}" "{{$VAR2}}"
Store a formatted message in a variable (does not work on Zsh):
printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}
Print a hexadecimal, octal, and scientific number:
printf "{{hex=%x octal=%o scientific=%e\n}}" 0x{{FF}} 0{{377}} {{100000}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
ptx
ptx [OPTION]... [ENTRÉE]...
ptx -G [OPTION]... [ENTRÉE [SORTIE]]
Produire un index permuté du contenu des fichiers Sortir un index permuté, incluant le contexte, des mots dans les fichiers d’entrée. Les arguments obligatoires pour les options longues le sont aussi pour les options courtes. Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard. Par défaut c’est ‘-F /’.
Options
--auto-reference,-A-
output automatically generated references
--traditional,-G-
behave more like System V ‘ptx’
--flag-truncation=<STRING>,-F <STRING>-
use STRING for flagging line truncations
--macro-name=<STRING>,-M <STRING>-
macro name to use instead of ‘xx’
--format-O-
generate output as roff directives
-T-
generate output as TeX directives
--right-side-refs,-R-
put references at right, not counted in -w
--sentence-regexp=<REGEXP>,-S <REGEXP>-
for end of lines or end of sentences
--word-regexp=<REGEXP>,-W <REGEXP>-
use REGEXP to match each keyword
--break-file=<FILE>,-b <FILE>-
word break characters in this FILE
--ignore-case,-f-
fold lower case to upper case for sorting
--gap-size=<NUMBER>,-g <NUMBER>-
gap size in columns between output fields
--ignore-file=<FILE>,-i <FILE>-
read ignore word list from FILE
--only-file=<FILE>,-o <FILE>-
read only word list from this FILE
--references=<FILE>,-r <FILE>-
first field of each line is a reference
--typeset-mode,-t-
change the default width from 72 to 100
--width=<NUMBER>,-w <NUMBER>-
output width in columns, reference excluded
Examples
Generate a permuted index where the first field of each line is an index reference:
ptx {{[-r|--references]}} {{path/to/file}}
Generate a permuted index with automatically generated index references:
ptx {{[-A|--auto-reference]}} {{path/to/file}}
Generate a permuted index with a fixed width:
ptx {{[-w|--width]}} {{width_in_columns}} {{path/to/file}}
Generate a permuted index with a list of filtered words:
ptx {{[-o|--only-file]}} {{path/to/filter}} {{path/to/file}}
Generate a permuted index with SYSV-style behaviors:
ptx {{[-G|--traditional]}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
pwd
pwd [OPTION]...
Afficher le nom de fichier complet du répertoire de travail actuel.
Options
--logical,-L-
use PWD from environment, even if it contains symlinks
--physical,-P-
avoid all symlinks
Examples
Affiche le répertoire actuel :
pwd
Affiche le répertoire actuel tout en traduisant les liens symboliques (c.-à-d. afficher le répertoire « physique ») :
pwd {{[-P|--physical]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
readlink
readlink [OPTION]... [FICHIER]...
Afficher la valeur d’un lien symbolique ou le nom de fichier canonique.
Options
--canonicalize,-f-
canonicalize by following every symlink in every component of the given name recursively; all but the last component must exist
--canonicalize-existing,-e-
canonicalize by following every symlink in every component of the given name recursively, all components must exist
--canonicalize-missing,-m-
canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence
--no-newline,-n-
do not output the trailing delimiter
--quiet,-q-
suppress most error messages
--silent,-s-
suppress most error messages
--verbose,-v-
report error message
--zero,-z-
separate output with NUL rather than newline
Examples
Print the target of a symbolic link to a file or directory:
readlink {{path/to/symlink}}
Get the absolute path to a file or directory:
readlink {{[-f|--canonicalize]}} {{path/to/file_or_directory}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
realpath
realpath [OPTION]... FICHIER...
Afficher le chemin résolu
Options
--quiet,-q-
Do not print warnings for invalid paths
--strip,--no-symlinks,-s-
Only strip ‘.’ and ‘..’ components, but don’t resolve symbolic links
--zero,-z-
Separate output filenames with \0 rather than newline
--logical,-L-
resolve ‘..’ components before symlinks
--physical,-P-
resolve symlinks as encountered (default)
--canonicalize,-E-
all but the last component must exist (default)
--canonicalize-existing,-e-
canonicalize by following every symlink in every component of the given name recursively, all components must exist
--canonicalize-missing,-m-
canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence
--relative-to=<DIR>-
print the resolved path relative to DIR
--relative-base=<DIR>-
print absolute paths unless paths below DIR
Examples
Display the absolute path for a file or directory:
realpath {{path/to/file_or_directory}}
Require all path components to exist:
realpath {{[-e|--canonicalize-existing]}} {{path/to/file_or_directory}}
Resolve .. components before symlinks:
realpath {{[-L|--logical]}} {{path/to/file_or_directory}}
Disable symlink expansion:
realpath {{[-s|--no-symlinks]}} {{path/to/file_or_directory}}
Suppress error messages:
realpath {{[-q|--quiet]}} {{path/to/file_or_directory}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
rm
rm [OPTION]... FICHIER...
Supprimer (délier) le(s) FICHIER(s)
Options
--force,-f-
ignorer les fichiers inexistants et les arguments, ne jamais demander
-i-
demander avant chaque suppression
-I-
demander une fois avant de supprimer plus de trois fichiers, ou lors d’une suppression récursive.
Moins intrusif que -i, tout en offrant une protection contre la plupart des erreurs --interactive=<WHEN>-
demander selon QUAND : never, once (-I), ou always (-i). Sans QUAND,
demande toujours --one-file-system-
lors de la suppression récursive d’une hiérarchie, ignorer tout répertoire situé sur un
système de fichiers différent de celui de l’argument de ligne de commande correspondant (NON
IMPLÉMENTÉ) --no-preserve-root-
ne pas traiter ‘/’ spécialement
--preserve-root=<all>-
ne pas supprimer ‘/’ (par défaut)
--recursive,-r,-R-
supprimer les répertoires et leur contenu récursivement
--dir,-d-
supprimer les répertoires vides
--verbose,-v-
expliquer ce qui est fait
--progress,-g-
afficher une barre de progression. Note : cette fonctionnalité n’est pas prise en charge par GNU coreutils.
--presume-input-tty
Par défaut, rm ne supprime pas les répertoires. Utilisez l’option –recursive (-r ou -R) pour supprimer également chaque répertoire listé, ainsi que tout son contenu
Pour supprimer un fichier dont le nom commence par un ‘-’, par exemple ‘-foo’, utilisez une de ces commandes : rm – -foo
rm ./-foo
Notez que si vous utilisez rm pour supprimer un fichier, il pourrait être possible de récupérer une partie de son contenu, avec suffisamment d’expertise et/ou de temps. Pour une meilleure assurance que le contenu est vraiment irrécupérable, considérez utiliser shred.
Examples
Remove specific files:
rm {{path/to/file1 path/to/file2 ...}}
Remove specific files ignoring nonexistent ones:
rm {{[-f|--force]}} {{path/to/file1 path/to/file2 ...}}
Remove specific files interactively prompting before each removal:
rm {{[-i|--interactive]}} {{path/to/file1 path/to/file2 ...}}
Remove specific files printing info about each removal:
rm {{[-v|--verbose]}} {{path/to/file1 path/to/file2 ...}}
Remove specific files and directories recursively:
rm {{[-r|--recursive]}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}
Remove empty directories (this is considered the safe method):
rm {{[-d|--dir]}} {{path/to/directory}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
rmdir
rmdir [OPTION]... RÉPERTOIRE...
Supprimer les RÉPERTOIRE(S), s’ils sont vides.
Options
--ignore-fail-on-non-empty-
ignore each failure that is solely because a directory is non-empty
--parents,-p-
remove DIRECTORY and its ancestors; e.g., ‘rmdir -p a/b/c’ is similar to rmdir a/b/c a/b a
--verbose,-v-
output a diagnostic for every directory processed
Examples
Remove specific directories:
rmdir {{path/to/directory1 path/to/directory2 ...}}
Remove specific nested directories recursively:
rmdir {{[-p|--parents]}} {{path/to/directory1 path/to/directory2 ...}}
Clean a directory of empty directories:
rmdir *
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
runcon
runcon CONTEXTE COMMANDE [ARG...]
runcon [-c] [-u UTILISATEUR] [-r RÔLE] [-t TYPE] [-l PLAGE] COMMANDE [ARG...]
Exécuter une commande avec le contexte de sécurité spécifié sous les systèmes avec SELinux activé.
Options
--compute,-c-
Calculer le contexte de transition de processus avant modification.
--user=<USER>,-u <USER>-
Définir l’utilisateur UTILISATEUR dans le contexte de sécurité cible.
--role=<ROLE>,-r <ROLE>-
Définir le rôle RÔLE dans le contexte de sécurité cible.
--type=<TYPE>,-t <TYPE>-
Définir le type TYPE dans le contexte de sécurité cible.
--range=<RANGE>,-l <RANGE>-
Définir la plage PLAGE dans le contexte de sécurité cible.
Exécuter COMMANDE avec un CONTEXTE complètement spécifié, ou avec le contexte de sécurité actuel ou de transition modifié par un ou plusieurs parmi NIVEAU, RÔLE, TYPE et UTILISATEUR.
Si aucun de –compute, –type, –user, –role ou –range n’est spécifié, alors le premier argument est utilisé comme contexte complet.
Notez que seuls les contextes soigneusement choisis ont des chances de s’exécuter avec succès.
Si ni CONTEXTE ni COMMANDE n’est spécifié, le contexte de sécurité actuel est affiché.
Examples
Print the security context of the current execution context:
runcon
Specify the domain to run a command in:
runcon {{[-t|--type]}} {{domain}}_t {{command}}
Specify the context role to run a command with:
runcon {{[-r|--role]}} {{role}}_r {{command}}
Specify the full context to run a command with:
runcon {{user}}_u:{{role}}_r:{{domain}}_t {{command}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
seq
seq [OPTION]... DERNIER
seq [OPTION]... PREMIER DERNIER
seq [OPTION]... PREMIER INCRÉMENT DERNIER
Afficher les nombres de PREMIER à DERNIER, par incréments d’INCRÉMENT.
Options
--separator,-s-
Caractère séparateur (par défaut \n)
--terminator,-t-
Caractère terminateur (par défaut \n)
--equal-width,-w-
Égaliser les largeurs de tous les nombres en remplissant avec des zéros
--format,-f-
utiliser le FORMAT de nombre à virgule flottante de style printf
Examples
Print a sequence from 1 to 10:
seq 10
Print a sequence from 10 to 20:
seq 10 20
Print every 3rd number from 5 to 20:
seq 5 3 20
Print a reverse sequence from 10 to 1:
seq 10 -1 1
Separate the output with a space instead of a newline:
seq {{[-s|--separator]}} " " {{5 3 20}}
Format output width to a minimum of 4 digits padding with zeros as necessary:
seq {{[-f|--format]}} "%04g" {{5 3 20}}
Print all numbers with the same width:
seq {{[-w|--equal-width]}} {{5 3 20}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sha1sum
sha1sum [OPTION]... [FICHIER]...
Afficher le SHA1 et la taille de chaque fichier
Options
--binary,-b--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--tag-
ck-common-help-tag
--text,-t--zero,-z-
ck-common-help-zero
Examples
Calculate the SHA1 checksum for one or more files:
sha1sum {{path/to/file1 path/to/file2 ...}}
Calculate and save the list of SHA1 checksums to a file:
sha1sum {{path/to/file1 path/to/file2 ...}} >{{path/to/file.sha1}}
Calculate a SHA1 checksum from stdin:
{{command}} | sha1sum
Read a file of SHA1 checksums and filenames and verify all files have matching checksums:
sha1sum {{[-c|--check]}} {{path/to/file.sha1}}
Only show a message for missing files or when verification fails:
sha1sum {{[-c|--check]}} --quiet {{path/to/file.sha1}}
Only show a message when verification fails, ignoring missing files:
sha1sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.sha1}}
Check a known SHA1 checksum of a file:
echo {{known_sha1_checksum_of_the_file}} {{path/to/file}} | sha1sum {{[-c|--check]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sha224sum
sha224sum [OPTION]... [FICHIER]...
Afficher le SHA224 et la taille de chaque fichier
Options
--binary,-b--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--tag-
ck-common-help-tag
--text,-t--zero,-z-
ck-common-help-zero
Examples
Calculate the SHA224 checksum for one or more files:
sha224sum {{path/to/file1 path/to/file2 ...}}
Calculate and save the list of SHA224 checksums to a file:
sha224sum {{path/to/file1 path/to/file2 ...}} >{{path/to/file.sha224}}
Calculate a SHA224 checksum from stdin:
{{command}} | sha224sum
Read a file of SHA224 checksums and filenames and verify all files have matching checksums:
sha224sum {{[-c|--check]}} {{path/to/file.sha224}}
Only show a message for missing files or when verification fails:
sha224sum {{[-c|--check]}} --quiet {{path/to/file.sha224}}
Only show a message when verification fails, ignoring missing files:
sha224sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.sha224}}
Check a known SHA224 checksum of a file:
echo {{known_sha224_checksum_of_the_file}} {{path/to/file}} | sha224sum {{[-c|--check]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sha256sum
sha256sum [OPTION]... [FICHIER]...
Afficher le SHA256 et la taille de chaque fichier
Options
--binary,-b--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--tag-
ck-common-help-tag
--text,-t--zero,-z-
ck-common-help-zero
Examples
Calculate the SHA256 checksum for one or more files:
sha256sum {{path/to/file1 path/to/file2 ...}}
Calculate and save the list of SHA256 checksums to a file:
sha256sum {{path/to/file1 path/to/file2 ...}} >{{path/to/file.sha256}}
Calculate a SHA256 checksum from stdin:
{{command}} | sha256sum
Read a file of SHA256 checksums and filenames and verify all files have matching checksums:
sha256sum {{[-c|--check]}} {{path/to/file.sha256}}
Only show a message for missing files or when verification fails:
sha256sum {{[-c|--check]}} --quiet {{path/to/file.sha256}}
Only show a message when verification fails, ignoring missing files:
sha256sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.sha256}}
Check a known SHA256 checksum of a file:
echo {{known_sha256_checksum_of_the_file}} {{path/to/file}} | sha256sum {{[-c|--check]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sha384sum
sha384sum [OPTIONS] [FILE]...
Print or check the SHA384 checksums
Options
--binary,-b--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--tag-
ck-common-help-tag
--text,-t--zero,-z-
ck-common-help-zero
Examples
Calculate the SHA384 checksum for one or more files:
sha384sum {{path/to/file1 path/to/file2 ...}}
Calculate and save the list of SHA384 checksums to a file:
sha384sum {{path/to/file1 path/to/file2 ...}} >{{path/to/file.sha384}}
Calculate a SHA384 checksum from stdin:
{{command}} | sha384sum
Read a file of SHA384 checksums and filenames and verify all files have matching checksums:
sha384sum {{[-c|--check]}} {{path/to/file.sha384}}
Only show a message for missing files or when verification fails:
sha384sum {{[-c|--check]}} --quiet {{path/to/file.sha384}}
Only show a message when verification fails, ignoring missing files:
sha384sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.sha384}}
Check a known SHA384 checksum of a file:
echo {{known_sha384_checksum_of_the_file}} {{path/to/file}} | sha384sum {{[-c|--check]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sha512sum
sha512sum [OPTION]... [FICHIER]...
Afficher le SHA512 et la taille de chaque fichier
Options
--binary,-b--check,-c-
ck-common-help-check
--warn,-w-
ck-common-help-warn
--status-
ck-common-help-status
--quiet-
ck-common-help-quiet
--ignore-missing-
ck-common-help-ignore-missing
--strict-
ck-common-help-strict
--tag-
ck-common-help-tag
--text,-t--zero,-z-
ck-common-help-zero
Examples
Calculate the SHA512 checksum for one or more files:
sha512sum {{path/to/file1 path/to/file2 ...}}
Calculate and save the list of SHA512 checksums to a file:
sha512sum {{path/to/file1 path/to/file2 ...}} >{{path/to/file.sha512}}
Calculate a SHA512 checksum from stdin:
{{command}} | sha512sum
Read a file of SHA512 checksums and filenames and verify all files have matching checksums:
sha512sum {{[-c|--check]}} {{path/to/file.sha512}}
Only show a message for missing files or when verification fails:
sha512sum {{[-c|--check]}} --quiet {{path/to/file.sha512}}
Only show a message when verification fails, ignoring missing files:
sha512sum --ignore-missing {{[-c|--check]}} --quiet {{path/to/file.sha512}}
Check a known SHA512 checksum of a file:
echo {{known_sha512_checksum_of_the_file}} {{path/to/file}} | sha512sum {{[-c|--check]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
shred
shred [OPTION]... FICHIER...
Écrase les FICHIER(s) spécifiés de manière répétée, afin de rendre plus difficile même pour du matériel de sondage très coûteux de récupérer les données.
Options
--force,-f-
change permissions to allow writing if necessary
--iterations=<NUMBER>,-n <NUMBER>-
overwrite N times instead of the default (3)
--size=<N>,-s <N>-
shred this many bytes (suffixes like K, M, G accepted)
-u-
deallocate and remove file after overwriting
--remove=<HOW>-
like -u but give control on HOW to delete; See below
--verbose,-v-
show progress
--exact,-x-
do not round file sizes up to the next full block;
this is the default for non-regular files --zero,-z-
add a final overwrite with zeros to hide shredding
--random-source-
take random bytes from FILE
Supprime le ou les FICHIER(s) si –remove (-u) est spécifié. Par défaut, les fichiers ne sont pas supprimés car il est courant d’opérer sur des fichiers de périphérique comme /dev/hda, et ces fichiers ne doivent généralement pas être supprimés.
ATTENTION : Notez que shred repose sur une hypothèse très importante : que le système de fichiers écrase les données sur place. C’est la façon traditionnelle de procéder, mais de nombreuses conceptions de systèmes de fichiers modernes ne satisfont pas cette hypothèse. Voici des exemples de systèmes de fichiers sur lesquels shred n’est pas efficace, ou n’est pas garanti d’être efficace dans tous les modes de système de fichiers :
-
systèmes de fichiers structurés en journal ou en log, tels que ceux fournis avec AIX et Solaris (et JFS, ReiserFS, XFS, Ext3, etc.)
-
systèmes de fichiers qui écrivent des données redondantes et continuent même si certaines écritures échouent, tels que les systèmes de fichiers basés sur RAID
-
systèmes de fichiers qui font des instantanés, tels que le serveur NFS de Network Appliance
-
systèmes de fichiers qui mettent en cache dans des emplacements temporaires, tels que NFS version 3 clients
-
systèmes de fichiers compressés
Dans le cas des systèmes de fichiers ext3, la clause de non-responsabilité ci-dessus s’applique (et shred est
donc d’efficacité limitée) seulement en mode data=journal, qui journalise les données de fichier
en plus des métadonnées seulement. Dans les modes data=ordered (par défaut) et
data=writeback, shred fonctionne comme d’habitude. Les modes de journal Ext3 peuvent être changés
en ajoutant l’option data=something aux options de montage pour un système de fichiers particulier
dans le fichier /etc/fstab, comme documenté dans la page de manuel mount (man mount).
De plus, les sauvegardes de système de fichiers et les miroirs distants peuvent contenir des copies du fichier qui ne peuvent pas être supprimées, et qui permettront à un fichier détruit d’être récupéré plus tard.
Examples
Overwrite a file:
shred {{path/to/file}}
Overwrite a file and show progress on the screen:
shred {{[-v|--verbose]}} {{path/to/file}}
Overwrite a file, leaving zeros instead of random data:
shred {{[-z|--zero]}} {{path/to/file}}
Overwrite a file a specific number of times:
shred {{[-n|--iterations]}} {{25}} {{path/to/file}}
Overwrite a file and remove it:
shred {{[-u|--remove]}} {{path/to/file}}
Overwrite a file 100 times, add a final overwrite with zeros, remove the file after overwriting it, and show verbose progress on the screen:
shred {{[-vzu|--verbose --zero --remove]}} {{[-n|--iterations]}} 100 {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
shuf
shuf [OPTION]... [FICHIER]
shuf -e [OPTION]... [ARG]...
shuf -i MIN-MAX [OPTION]...
Mélanger l’entrée en affichant une permutation aléatoire des lignes d’entrée. Chaque permutation de sortie est également probable. Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Options
--echo,-e-
treat each ARG as an input line
--input-range=<LO-HI>,-i <LO-HI>-
treat each number LO through HI as an input line
--head-count=<COUNT>,-n <COUNT>-
output at most COUNT lines
--output=<FILE>,-o <FILE>-
write result to FILE instead of standard output
--random-seed=<STRING>-
seed with STRING for reproducible output
--random-source=<FILE>-
get random bytes from FILE
--repeat,-r-
output lines can be repeated
--zero-terminated,-z-
line delimiter is NUL, not newline
Examples
Randomize the order of lines in a file and output the result:
shuf {{path/to/file}}
Only output the first 5 entries of the result:
shuf {{[-n|--head-count]}} 5 {{path/to/file}}
Write the output to another file:
shuf {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}
Generate 3 random numbers in the range 1-10 (inclusive, numbers can repeat):
shuf {{[-n|--head-count]}} 3 {{[-i|--input-range]}} 1-10 {{[-r|--repeat]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sleep
sleep NOMBRE[SUFFIXE]...
sleep OPTION
Faire une pause de NOMBRE secondes.
Options
-
pause for NUMBER seconds
Faire une pause de NOMBRE secondes. SUFFIXE peut être ‘s’ pour les secondes (par défaut), ‘m’ pour les minutes, ‘h’ pour les heures ou ‘d’ pour les jours. Contrairement à la plupart des implémentations qui exigent que NOMBRE soit un entier, ici NOMBRE peut être un nombre à virgule flottante arbitraire. Avec deux arguments ou plus, faire une pause pour la durée spécifiée par la somme de leurs valeurs.
Examples
Delay in seconds:
sleep {{seconds}}
Delay in [m]inutes. (Other units [d]ay, [h]our, [s]econd, [inf]inity can also be used):
sleep {{minutes}}m
Delay for 1 [d]ay 3 [h]ours:
sleep 1d 3h
Execute a specific command after 20 [m]inutes delay:
sleep 20m && {{command}}
Delay forever:
sleep {{[inf|infinity]}}
Delay for one millisecond:
sleep {{0.001|1e-3}}
Display help:
sleep --help
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sort
sort [OPTION]... [FICHIER]...
Affiche la concaténation triée de tous les FICHIER(s). Sans FICHIER, ou quand FICHIER est -, lit l’entrée standard.
Options
--help-
Affiche les informations d’aide.
--version-
Affiche les informations de version.
--sort--human-numeric-sort,-h-
compare selon les tailles lisibles par l’humain, par ex. 1M > 100k
--month-sort,-M-
compare selon l’abréviation du nom du mois
--numeric-sort,-n-
compare selon la valeur numérique de la chaîne
--general-numeric-sort,-g-
compare selon la valeur numérique générale de la chaîne
--version-sort,-V-
Trie par numéro de version SemVer, par ex. 1.12.2 > 1.1.2
--random-sort,-R-
mélange dans un ordre aléatoire
--random-source=<FILE>-
utilise FICHIER comme source de données aléatoires
--dictionary-order,-d-
considère seulement les espaces et les caractères alphanumériques
--merge,-m-
fusionne les fichiers déjà triés ; ne trie pas
--check,-c-
vérifie l’entrée triée ; ne trie pas
--check-silent,-C-
réussit si le fichier donné est déjà trié, et sort avec le statut 1 sinon.
--ignore-case,-f-
convertit les caractères minuscules en majuscules
--ignore-nonprinting,-i-
ignore les caractères non-imprimables
--ignore-leading-blanks,-b-
ignore les espaces de début lors de la recherche de clés de tri dans chaque ligne
--output=<FILENAME>,-o <FILENAME>-
écrit la sortie vers NOMFICHIER au lieu de stdout
--reverse,-r-
inverse la sortie
--stable,-s-
stabilise le tri en désactivant la comparaison de dernier recours
--unique,-u-
affiche seulement le premier d’une série égale
--key,-k-
trie par une clé
--field-separator,-t-
séparateur personnalisé pour -k
--zero-terminated,-z-
le délimiteur de ligne est NUL, pas nouvelle ligne
--parallel=<NUM_THREADS>-
change le nombre de threads s’exécutant simultanément vers NUM_THREADS
--buffer-size=<SIZE>,-S <SIZE>-
définit la TAILLE maximale de chaque segment en nombre d’éléments triés
--temporary-directory=<DIR>,-T <DIR>-
utilise RÉP pour les temporaires, pas $TMPDIR ou /tmp
--compress-program=<PROG>-
compresse les fichiers temporaires avec PROG, décompresse avec PROG -d ; PROG doit prendre l’entrée depuis stdin et sortir vers stdout
--batch-size=<N_MERGE>-
Fusionne au maximum N_MERGE entrées à la fois.
--files0-from=<NUL_FILE>-
lit l’entrée depuis les fichiers spécifiés par FICHIER_NUL terminé par NUL
--debug-
souligne les parties de la ligne qui sont réellement utilisées pour le tri
Le format de clé est CHAMP[.CAR][OPTIONS][,CHAMP[.CAR]][OPTIONS].
Les champs sont séparés par défaut par le premier espace blanc après un caractère non-espace. Utilisez -t pour spécifier un séparateur personnalisé. Dans le cas par défaut, les espaces blancs sont ajoutés au début de chaque champ. Les séparateurs personnalisés ne sont cependant pas inclus dans les champs.
CHAMP et CAR commencent tous deux à 1 (c’est-à-dire qu’ils sont indexés à partir de 1). S’il n’y a pas de fin spécifiée après une virgule, la fin sera la fin de la ligne. Si CAR est défini à 0, cela signifie la fin du champ. CAR par défaut à 1 pour la position de début et à 0 pour la position de fin.
Les options valides sont : MbdfhnRrV. Elles remplacent les options globales pour cette clé.
Examples
Sort a file in ascending order:
sort {{path/to/file}}
Sort a file in descending order:
sort {{[-r|--reverse]}} {{path/to/file}}
Sort a file in case-insensitive way:
sort {{[-f|--ignore-case]}} {{path/to/file}}
Sort a file using numeric rather than alphabetic order:
sort {{[-n|--numeric-sort]}} {{path/to/file}}
Sort /etc/passwd by the 3rd field onward of each line numerically, using : as a field separator:
sort {{[-t|--field-separator]}} : {{[-k|--key]}} 3n /etc/passwd
Sort /etc/passwd numerically by the 3rd field, and when items in the 3rd field are equal, sort by the 4th field by numbers with exponents:
sort {{[-t|--field-separator]}} : {{[-k|--key]}} 3,3n {{[-k|--key]}} 4,4g /etc/passwd
Sort a file preserving only unique lines:
sort {{[-u|--unique]}} {{path/to/file}}
Sort a file, printing the output to the specified output file (can be used to sort a file in-place):
sort {{[-o|--output]}} {{path/to/output_file}} {{path/to/input_file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
split
split [OPTION]... [ENTRÉE [PRÉFIXE]]
Créer des fichiers de sortie contenant des sections consécutives ou entrelacées de l’entrée
Options
--bytes=<SIZE>,-b <SIZE>-
mettre TAILLE octets par fichier de sortie
--line-bytes=<SIZE>,-C <SIZE>-
mettre au maximum TAILLE octets de lignes par fichier de sortie
--lines=<NUMBER>,-l <NUMBER>-
mettre NOMBRE lignes/enregistrements par fichier de sortie
--number=<CHUNKS>,-n <CHUNKS>-
générer CHUNKS fichiers de sortie ; voir l’explication ci-dessous
--additional-suffix=<SUFFIX>-
SUFFIXE supplémentaire à ajouter aux noms de fichiers de sortie
--filter=<COMMAND>-
écrire vers la COMMANDE shell ; le nom de fichier est $FILE (Actuellement non implémenté pour Windows)
--elide-empty-files,-e-
ne pas générer de fichiers de sortie vides avec ‘-n’
-d-
utiliser des suffixes numériques commençant à 0, pas alphabétiques
--numeric-suffixes=<FROM>-
identique à -d, mais permet de définir la valeur de départ
-x-
utiliser des suffixes hexadécimaux commençant à 0, pas alphabétiques
--hex-suffixes=<FROM>-
identique à -x, mais permet de définir la valeur de départ
--suffix-length=<N>,-a <N>-
générer des suffixes de longueur N (par défaut 2)
--verbose-
afficher un diagnostic juste avant l’ouverture de chaque fichier de sortie
--separator=<SEP>,-t <SEP>-
utiliser SEP au lieu de nouvelle ligne comme séparateur d’enregistrement ; ‘\0’ (zéro) spécifie le caractère NUL
--io-blksize
Sortir des morceaux de taille fixe d’ENTRÉE vers PREFIXEaa, PREFIXEab, …; la taille par défaut est 1000, et le PRÉFIXE par défaut est ‘x’. Sans ENTRÉE, ou quand ENTRÉE est -, lire l’entrée standard.
L’argument TAILLE est un entier et une unité optionnelle (exemple: 10K est 10*1024). Les unités sont K,M,G,T,P,E,Z,Y,R,Q (puissances de 1024) ou KB,MB,… (puissances de 1000). Les préfixes binaires peuvent être utilisés aussi: KiB=K, MiB=M, et ainsi de suite.
CHUNKS peut être:
- N diviser en N fichiers basé sur la taille de l’entrée
- K/N sortir le Kème de N vers stdout
- l/N diviser en N fichiers sans diviser les lignes/enregistrements
- l/K/N sortir le Kème de N vers stdout sans diviser les lignes/enregistrements
- r/N comme ‘l’ mais utiliser la distribution round robin
- r/K/N pareillement mais ne sortir que le Kème de N vers stdout
Examples
Split a file, each split having 10 lines (except the last split):
split {{[-l|--lines]}} 10 {{path/to/file}}
Split a file into 5 files. File is split such that each split has same size (except the last split):
split {{[-n|--number]}} 5 {{path/to/file}}
Split a file with 512 bytes in each split (except the last split; use 512k for kilobytes and 512m for megabytes):
split {{[-b|--bytes]}} 512 {{path/to/file}}
Split a file with at most 512 bytes in each split without breaking lines:
split {{[-C|--line-bytes]}} 512 {{path/to/file}}
Split into multiple files from stdin:
gzip {{[-cd|--stdout --decompress]}} {{path/to/compressed_file.gz}} | split {{[-l|--lines]}} {{1000}} - {{path/to/output}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
stat
stat [OPTION]... FICHIER...
afficher le statut du fichier ou du système de fichiers.
Options
--dereference,-L-
follow links
--file-system,-f-
display file system status instead of file status
--terse,-t-
print the information in terse form
--format=<FORMAT>,-c <FORMAT>-
use the specified FORMAT instead of the default;
output a newline after each use of FORMAT --printf=<FORMAT>-
like –format, but interpret backslash escapes,
and do not output a mandatory trailing newline;
if you want a newline, include \n in FORMAT
Séquences de format valides pour les fichiers (sans --file-system) :
-%a : droits d’accès en octal (note : drapeaux printf ‘#’ et ‘0’)
-%A : droits d’accès en format lisible
-%b : nombre de blocs alloués (voir %B)
-%B : la taille en octets de chaque bloc rapporté par %b
-%C : chaîne de contexte de sécurité SELinux
-%d : numéro de périphérique en décimal
-%D : numéro de périphérique en hexadécimal
-%f : mode brut en hexadécimal
-%F : type de fichier
-%g : ID de groupe du propriétaire
-%G : nom de groupe du propriétaire
-%h : nombre de liens physiques
-%i : numéro d’inode
-%m : point de montage
-%n : nom de fichier
-%N : nom de fichier avec guillemets et déréférencement (suivi) si lien symbolique
-%o : suggestion de taille optimale de transfert E/S
-%s : taille totale, en octets
-%t : type de périphérique majeur en hex, pour les fichiers spéciaux caractère/bloc
-%T : type de périphérique mineur en hex, pour les fichiers spéciaux caractère/bloc
-%u : ID utilisateur du propriétaire
-%U : nom d’utilisateur du propriétaire
-%w : heure de création du fichier, lisible ; - si inconnue
-%W : heure de création du fichier, secondes depuis l’Époque ; 0 si inconnue
-%x : heure du dernier accès, lisible
-%X : heure du dernier accès, secondes depuis l’Époque
-%y : heure de la dernière modification de données, lisible
-%Y : heure de la dernière modification de données, secondes depuis l’Époque
-%z : heure du dernier changement de statut, lisible
-%Z : heure du dernier changement de statut, secondes depuis l’Époque
Séquences de format valides pour les systèmes de fichiers :
-%a : blocs libres disponibles pour les non-superutilisateurs
-%b : blocs de données totaux dans le système de fichiers
-%c : nœuds de fichiers totaux dans le système de fichiers
-%d : nœuds de fichiers libres dans le système de fichiers
-%f : blocs libres dans le système de fichiers
-%i : ID du système de fichiers en hexadécimal
-%l : longueur maximale des noms de fichiers
-%n : nom de fichier
-%s : taille de bloc (pour des transferts plus rapides)
-%S : taille de bloc fondamentale (pour les comptes de blocs)
-%t : type de système de fichiers en hexadécimal
-%T : type de système de fichiers en format lisible
NOTE : votre shell peut avoir sa propre version de stat, qui remplace généralement la version décrite ici. Veuillez vous référer à la documentation de votre shell pour les détails sur les options qu’il prend en charge.
Examples
Display properties about a specific file such as size, permissions, creation date, and access date among others:
stat {{path/to/file}}
Display properties about a specific file, only showing the raw result data without labels:
stat {{[-t|--terse]}} {{path/to/file}}
Display information about the filesystem where a specific file is located:
stat {{[-f|--file-system]}} {{path/to/file}}
Show only octal file permissions:
stat {{[-c|--format]}} "%a %n" {{path/to/file}}
Show the owner and group of a specific file:
stat {{[-c|--format]}} "%U %G" {{path/to/file}}
Show the size of a specific file in bytes:
stat {{[-c|--format]}} "%s %n" {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
stdbuf
stdbuf [OPTION]... COMMANDE
Exécute COMMANDE, avec des opérations de mise en mémoire tampon modifiées pour ses flux standards.
Les arguments obligatoires pour les options longues le sont aussi pour les options courtes.
Options
--input=<MODE>,-i <MODE>-
adjust standard input stream buffering
--output=<MODE>,-o <MODE>-
adjust standard output stream buffering
--error=<MODE>,-e <MODE>-
adjust standard error stream buffering
Si MODE est ‘L’, le flux correspondant sera mis en mémoire tampon par ligne. Cette option n’est pas valide avec l’entrée standard.
Si MODE est ‘0’, le flux correspondant ne sera pas mis en mémoire tampon.
Sinon, MODE est un nombre qui peut être suivi par l’un des suivants :
KB 1000, K 1024, MB 10001000, M 10241024, et ainsi de suite pour G, T, P, E, Z, Y. Dans ce cas, le flux correspondant sera entièrement mis en mémoire tampon avec la taille de tampon définie à MODE octets.
NOTE : Si COMMANDE ajuste la mise en mémoire tampon de ses flux standards (tee le fait par exemple), cela remplacera les paramètres correspondants modifiés par stdbuf. De plus, certains filtres (comme dd et cat etc.) n’utilisent pas de flux pour les E/S, et ne sont donc pas affectés par les paramètres stdbuf.
Examples
Change stdin buffer size to 512 KiB:
stdbuf {{[-i|--input]}} 512K {{command}}
Change stdout buffer to line-buffered:
stdbuf {{[-o|--output]}} L {{command}}
Change stderr buffer to unbuffered:
stdbuf {{[-e|--error]}} 0 {{command}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
stty
stty [-F PÉRIPHÉRIQUE | --file=PÉRIPHÉRIQUE] [PARAMÈTRE]...
ou: stty [-F PÉRIPHÉRIQUE | --file=PÉRIPHÉRIQUE] [-a|--all]
ou: stty [-F PÉRIPHÉRIQUE | --file=PÉRIPHÉRIQUE] [-g|--save]
Afficher ou modifier les caractéristiques du terminal.
Options
--all,-a-
print all current settings in human-readable form
--save,-g-
print all current settings in a stty-readable form
--file=<DEVICE>,-F <DEVICE>-
open and use the specified DEVICE instead of stdin
-
settings to change
Examples
Display current terminal size:
stty size
Display all settings for the current terminal:
stty {{[-a|--all]}}
Set the number of rows or columns:
stty {{rows|cols}} {{count}}
Get the actual transfer speed of a device:
stty {{[-F|--file]}} {{path/to/device_file}} speed
Reset all modes to reasonable values for the current terminal:
stty sane
Switch between raw and normal mode:
stty {{raw|cooked}}
Turn character echoing off or on:
stty {{-echo|echo}}
Display help:
stty --help
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sum
sum [OPTION]... [FICHIER]...
Calculer la somme de contrôle et compter les blocs dans un fichier.
Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Options
-r-
use the BSD sum algorithm, use 1K blocks (default)
--sysv,-s-
use System V sum algorithm, use 512 bytes blocks
Examples
Compute a checksum with BSD-compatible algorithm and 1024-byte blocks:
sum {{path/to/file}}
Compute a checksum with System V-compatible algorithm and 512-byte blocks:
sum {{[-s|--sysv]}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
sync
sync [OPTION]... FICHIER...
Synchroniser les écritures en cache vers le stockage persistant
Options
--file-system,-f-
sync the file systems that contain the files (Linux and Windows only)
--data,-d-
sync only file data, no unneeded metadata (Linux only)
Examples
Flush all pending write operations on all disks:
sync
Flush all pending write operations on a single file to disk:
sync {{path/to/file}}
Flush writes and drop filesystem caches:
sync; echo 3 | sudo tee /proc/sys/vm/drop_caches
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
tac
tac [OPTION]... [FICHIER]...
Écrit chaque fichier sur la sortie standard, la dernière ligne en premier.
Options
--before,-b-
attach the separator before instead of after
--regex,-r-
interpret the sequence as a regular expression
--separator=<STRING>,-s <STRING>-
use STRING as the separator instead of newline
Examples
Concatenate specific files in reversed order:
tac {{path/to/file1 path/to/file2 ...}}
Display stdin in reversed order:
{{cat path/to/file}} | tac
Use a specific separator:
tac {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}
Use a specific regex as a separator:
tac {{[-r|--regex]}} {{[-s|--separator]}} {{separator}} {{path/to/file1 path/to/file2 ...}}
Use a separator before each file:
tac {{[-b|--before]}} {{path/to/file1 path/to/file2 ...}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
tail
tail [OPTION]... [FICHIER]...
Afficher les 10 dernières lignes de chaque FICHIER sur la sortie standard. Avec plus d’un FICHIER, précéder chacun d’un en-tête donnant le nom du fichier. Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Les arguments obligatoires pour les options longues sont également obligatoires pour les options courtes.
Options
--bytes=<[+]NUM>,-c <[+]NUM>-
Print the last NUM bytes; use -c +NUM to print from byte NUM onward (counting from 1)
--follow,-f-
Print the file as it grows
--lines=<[+]NUM>,-n <[+]NUM>-
Print the last NUM lines; use -n +NUM to print from line NUM onward (counting from 1)
--pid=<PID>-
With -f, terminate after process ID, PID dies
--quiet,--silent,-q-
Never output headers giving file names
--sleep-interval=<N>,-s <N>-
Number of seconds to sleep between polling the file when running with -f
--max-unchanged-stats=<N>-
Reopen a FILE which has not changed size after N (default 5) iterations to see if it has been unlinked or renamed (this is the usual case of rotated log files); This option is meaningful only when polling (i.e., with –use-polling) and when –follow=name
--verbose,-v-
Always output headers giving file names
--zero-terminated,-z-
Line delimiter is NUL, not newline
--use-polling-
Désactiver le support ‘inotify’ et utiliser le sondage à la place
--retry-
Keep trying to open a file if it is inaccessible
-F-
Same as –follow=name –retry
--debug-
indicate which –follow implementation is used
--presume-input-pipe
Examples
Affiche les 10 dernières lignes d’un fichier :
tail {{chemin/vers/fichier}}
Affiche les 10 dernières lignes de plusieurs fichiers :
tail {{chemin/vers/fichier1 chemin/vers/fichier2 ...}}
Affiche les 5 dernières lignes d’un fichier :
tail {{[-5|--lines 5]}} {{chemin/vers/fichier}}
Affiche tout le contenu d’un fichier à partir d’une ligne spécifique :
tail {{[-n|--lines]}} +{{ligne}} {{chemin/vers/fichier}}
Affiche un nombre spécifique d’octets à partir de la fin d’un fichier :
tail {{[-c|--bytes]}} {{nombre}} {{chemin/vers/fichier}}
Affiche les dernières lignes d’un fichier et continuer à le lire jusqu’à ce que l’on appuie sur <Ctrl c> :
tail {{[-f|--follow]}} {{chemin/vers/fichier}}
Continue à lire le fichier jusqu’à ce que l’on appuie sur <Ctrl c>, même si le fichier est inaccessible :
tail {{[-F|--retry --follow]}} {{chemin/vers/fichier}}
Affiche les nombre dernières lignes d’un fichier et actualiser toutes les secondes secondes :
tail {{[-n|--lines]}} {{nombre}} {{[-s|--sleep-interval]}} {{secondes}} {{[-f|--follow]}} {{chemin/vers/fichier}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
tee
tee [OPTION]... [FICHIER]...
Copier l’entrée standard vers chaque FICHIER, et aussi vers la sortie standard.
Options
--help,-h-
Print help
--append,-a-
append to the given FILEs, do not overwrite
--ignore-interrupts,-i-
ignore interrupt signals (ignored on non-Unix platforms)
-p-
set write error behavior (ignored on non-Unix platforms)
--output-error-
set write error behavior
Si un FICHIER est -, il fait référence à un fichier nommé - .
Examples
Copy stdin to each file, and also to stdout:
echo "example" | tee {{path/to/file}}
Append to the given files, do not overwrite:
echo "example" | tee {{[-a|--append]}} {{path/to/file}}
Print stdin to the terminal, and also pipe it into another program for further processing:
echo "example" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}
Create a directory called “example”, count the number of characters in “example”, and write “example” to the terminal:
echo "example" | tee >(xargs mkdir) >(wc {{[-c|--bytes]}})
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
test
test EXPRESSION
test
[ EXPRESSION ]
[ ]
[ OPTION
Vérifier les types de fichiers et comparer les valeurs.
Options
Quitter avec le statut déterminé par EXPRESSION.
Une EXPRESSION omise vaut false par défaut. Sinon, EXPRESSION est true ou false et définit le statut de sortie. Il peut s’agir de :
( EXPRESSION ) EXPRESSION est vraie
! EXPRESSION EXPRESSION est fausse
EXPRESSION1 -a EXPRESSION2 EXPRESSION1 et EXPRESSION2 sont toutes deux vraies
EXPRESSION1 -o EXPRESSION2 EXPRESSION1 ou EXPRESSION2 est vraie
Opérations sur les chaînes :
-n STRING la longueur de STRING est non nulle
STRING équivalent à -n STRING
-z STRING la longueur de STRING est nulle
STRING1 = STRING2 les chaînes sont égales
STRING1 != STRING2 les chaînes ne sont pas égales
STRING1 > STRING2 STRING1 est plus grande que STRING2 dans les paramètres régionaux actuels
STRING1 < STRING2 STRING1 est plus petite que STRING2 dans les paramètres régionaux actuels
Comparaisons d’entiers :
INTEGER1 -eq INTEGER2 INTEGER1 est égal à INTEGER2
INTEGER1 -ge INTEGER2 INTEGER1 est supérieur ou égal à INTEGER2
INTEGER1 -gt INTEGER2 INTEGER1 est supérieur à INTEGER2
INTEGER1 -le INTEGER2 INTEGER1 est inférieur ou égal à INTEGER2
INTEGER1 -lt INTEGER2 INTEGER1 est inférieur à INTEGER2
INTEGER1 -ne INTEGER2 INTEGER1 n’est pas égal à INTEGER2
Opérations sur les fichiers :
FILE1 -ef FILE2 FILE1 et FILE2 ont les mêmes numéros de périphérique et d’inode
FILE1 -nt FILE2 FILE1 est plus récent (date de modification) que FILE2
FILE1 -ot FILE2 FILE1 est plus ancien que FILE2
-b FILE FILE existe et est un fichier spécial de type bloc
-c FILE FILE existe et est un fichier spécial de type caractère
-d FILE FILE existe et est un répertoire
-e FILE FILE existe
-f FILE FILE existe et est un fichier régulier
-g FILE FILE existe et a le bit set-group-ID
-G FILE FILE existe et appartient à l’ID de groupe effectif
-h FILE FILE existe et est un lien symbolique (identique à -L)
-k FILE FILE existe et a son bit sticky défini
-L FILE FILE existe et est un lien symbolique (identique à -h)
-N FILE FILE existe et a été modifié depuis sa dernière lecture
-O FILE FILE existe et appartient à l’ID utilisateur effectif
-p FILE FILE existe et est un tube nommé
-r FILE FILE existe et la permission de lecture est accordée
-s FILE FILE existe et a une taille supérieure à zéro
-S FILE FILE existe et est un socket
-t FD le descripteur de fichier FD est ouvert sur un terminal
-u FILE FILE existe et son bit set-user-ID est défini
-w FILE FILE existe et la permission d’écriture est accordée
-x FILE FILE existe et la permission d’exécution (ou de recherche) est accordée
À l’exception de -h et -L, tous les tests liés aux FILE déréférencent (suivent) les liens symboliques. Attention : les parenthèses doivent être échappées (par exemple, par des barres obliques inverses) pour les shells. INTEGER peut aussi être -l STRING, qui évalue la longueur de STRING.
NOTE : Les -a et -o binaires sont intrinsèquement ambigus. Utilisez test EXPR1 && test EXPR2 ou test EXPR1 || test EXPR2 à la place.
NOTE : [ honore les options –help et –version, mais test ne le fait pas. test traite chacune de celles-ci comme il traite toute autre STRING non vide.
NOTE : votre shell peut avoir sa propre version de test et/ou [, qui remplace généralement la version décrite ici. Veuillez vous référer à la documentation de votre shell pour les détails sur les options qu’il prend en charge.
Examples
Test if a given variable is equal to a given string:
test "{{$MY_VAR}}" = "{{/bin/zsh}}"
Test if a given variable is empty ([z]ero length):
test -z "{{$GIT_BRANCH}}"
Test if a [f]ile exists:
test -f "{{path/to/file}}"
Test if a [d]irectory does not exist:
test ! -d "{{path/to/directory}}"
If A is true, then do B, or C in the case of an error (notice that C may run even if A fails):
test {{condition}} && {{echo "true"}} || {{echo "false"}}
Use test in a conditional statement:
if test -f "{{path/to/file}}"; then echo "File exists"; else echo "File does not exist"; fi
Display help:
help test
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
timeout
timeout [OPTION] DURÉE COMMANDE...
Démarrer COMMANDE, et la tuer si elle fonctionne encore après DURÉE.
Options
--foreground,-f-
when not running timeout directly from a shell prompt, allow COMMAND to read from the TTY and get TTY signals; in this mode, children of COMMAND will not be timed out
--kill-after,-k-
also send a KILL signal if COMMAND is still running this long after the initial signal was sent
--preserve-status,-p-
exit with the same status as COMMAND, even when the command times out
--signal=<SIGNAL>,-s <SIGNAL>-
specify the signal to be sent on timeout; SIGNAL may be a name like ‘HUP’ or a number; see ‘kill -l’ for a list of signals
--verbose,-v-
diagnose to stderr any signal sent upon timeout
-
a floating point number with an optional suffix: ‘s’ for seconds (the default), ‘m’ for minutes, ‘h’ for hours or ‘d’ for days ; a duration of 0 disables the associated timeout
-
a command to execute with optional arguments
À l’expiration du délai, le signal TERM est envoyé à COMMANDE, si aucun autre SIGNAL n’est spécifié. Le signal TERM tue tout processus qui ne bloque pas ou n’intercepte pas ce signal. Il peut être nécessaire d’utiliser le signal KILL, puisque ce signal ne peut pas être intercepté.
Statut de sortie : 124 si COMMANDE expire et que –preserve-status n’est pas spécifié 125 si la commande timeout elle-même échoue 126 si COMMANDE est trouvé mais ne peut être invoqué 127 si COMMANDE est introuvable 137 si COMMANDE (ou timeout lui-même) reçoit le signal KILL (9) (128+9)
- sinon, le statut de sortie de COMMANDE
Examples
Run sleep 10 and terminate it after 3 seconds:
timeout 3s sleep 10
Send a signal to the command after the time limit expires (TERM by default, kill -l to list all signals):
timeout {{[-s|--signal]}} {{INT|HUP|KILL|...}} {{5s}} {{sleep 10}}
Send verbose output to stderr showing signal sent upon timeout:
timeout {{[-v|--verbose]}} {{0.5s|1m|1h|1d|...}} {{command}}
Preserve the exit status of the command regardless of timing out:
timeout {{[-p|--preserve-status]}} {{1s|1m|1h|1d|...}} {{command}}
Send a forceful KILL signal after certain duration if the command ignores initial signal upon timeout:
timeout {{[-k|--kill-after]}} {{5m}} {{30s}} {{command}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
touch
touch [OPTION]... [FICHIER]...
Mettre à jour les temps d’accès et de modification de chaque FICHIER avec l’heure actuelle.
Options
--help-
Print help information.
-a-
change only the access time
-t <STAMP>-
use [[CC]YY]MMDDhhmm[.ss] instead of the current time
--date=<STRING>,-d <STRING>-
parse argument and use it instead of current time
-f-
(ignored)
-m-
change only the modification time
--no-create,-c-
do not create any files
--no-dereference,-h-
affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink)
--reference=<FILE>,-r <FILE>-
use this file’s times instead of the current time
--time=<WORD>-
change only the specified time: “access”, “atime”, or “use” are equivalent to -a; “modify” or “mtime” are equivalent to -m
Examples
Create specific files or update their timestamps if they already exist:
touch {{path/to/file1 path/to/file2 ...}}
Set the file [a]ccess or [m]odification times to the current one and don’t create file if it doesn’t exist:
touch {{[-c|--no-create]}} {{-a|-m}} {{path/to/file1 path/to/file2 ...}}
Set the file [t]ime to a specific value and don’t create file if it doesn’t exist:
touch {{[-c|--no-create]}} -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}
Set the files’ timestamp to the reference file’s timestamp, and do not create the file if it does not exist:
touch {{[-c|--no-create]}} {{[-r|--reference]}} {{path/to/reference_file}} {{path/to/file1 path/to/file2 ...}}
Set the timestamp by parsing a string:
touch {{[-d|--date]}} "{{last year|5 hours|next thursday|nov 14|...}}" {{path/to/file}}
Create multiple files with an increasing number:
touch {{path/to/file{1..10}}}
Create multiple files with a letter range:
touch {{path/to/file{a..z}}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
tr
tr [OPTION]... ENSEMBLE1 [ENSEMBLE2]
Traduire ou supprimer des caractères
Options
-A--complement,-c,-C-
use the complement of SET1
--delete,-d-
delete characters in SET1, do not translate
--squeeze-repeats,-s-
replace each sequence of a repeated character that is listed in the last specified SET, with a single occurrence of that character
--truncate-set1,-t-
first truncate SET1 to length of SET2
-u-
do not buffer output
Traduire, compresser et/ou supprimer des caractères de l’entrée standard, en écrivant vers la sortie standard.
Examples
Remplace toutes les occurrences d’un caractère dans un fichier, et affiche le résultat :
tr <{{chemin/vers/fichier}} {{caractère_recherché}} {{caractère_remplacé}}
Remplace toutes les occurrences d’un caractère dans la sortie d’une autre commande :
echo {{texte}} | tr {{caractère_recherché}} {{caractère_remplacé}}
Fais correspondre chaque caractère du premier ensemble au caractère correspondant du second ensemble :
tr <{{chemin/vers/fichier}} '{{abcd}}' '{{jkmn}}'
Supprime toutes les occurrences de l’ensemble de caractères spécifié dans l’entrée :
tr <{{chemin/vers/fichier}} {{[-d|--delete]}} '{{caractères_en_entrée}}'
Comprime une série de caractères identiques en un seul caractère :
tr <{{chemin/vers/fichier}} {{[-s|--squeeze-repeats]}} '{{caractères_en_entrée}}'
Traduis le contenu d’un fichier en majuscules :
tr <{{chemin/vers/fichier}} "[:lower:]" "[:upper:]"
Supprime les caractères non imprimables d’un fichier :
tr <{{chemin/vers/fichier}} {{[-cd|--complement --delete]}} "[:print:]"
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
true
Retourne immédiatement avec le code de sortie 0, sauf si l’une des options reconnues est utilisée. Dans ce cas, il essaiera d’afficher l’aide ou la version. Une erreur d’entrée/sortie pendant cette opération entraîne un retour avec le code de sortie 1.
Options
--help-
Print help information
--version-
Print version information
Examples
Return a successful exit code:
true
Make a command always exit with 0:
{{command}} || true
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
truncate
truncate [OPTION]... [FICHIER]...
Réduire ou étendre la taille de chaque fichier à la taille spécifiée.
Options
--io-blocks,-o-
traiter TAILLE comme le nombre de blocs I/O du fichier plutôt que des octets (NON IMPLÉMENTÉ)
--no-create,-c-
ne pas créer les fichiers qui n’existent pas
--reference=<RFILE>,-r <RFILE>-
baser la taille de chaque fichier sur la taille de RFICHIER
--size=<SIZE>,-s <SIZE>-
définir ou ajuster la taille de chaque fichier selon TAILLE, qui est en octets sauf si –io-blocks est spécifié
TAILLE est un entier avec un préfixe optionnel et une unité optionnelle. Les unités disponibles (K, M, G, T, P, E, Z, et Y) utilisent le format suivant : ‘KB’ => 1000 (kilooctets) ‘K’ => 1024 (kibioctets) ‘MB’ => 10001000 (mégaoctets) ‘M’ => 10241024 (mébioctets) ‘GB’ => 100010001000 (gigaoctets) ‘G’ => 102410241024 (gibioctets) TAILLE peut aussi être préfixée par l’un des éléments suivants pour ajuster la taille de chaque fichier basé sur sa taille actuelle : ‘+’ => étendre de ‘-’ => réduire de ‘<’ => au maximum ‘>’ => au minimum ‘/’ => arrondir vers le bas au multiple de ‘%’ => arrondir vers le haut au multiple de
Examples
Set a size of 10 GB to an existing file, or create a new file with the specified size:
truncate {{[-s|--size]}} 10G {{path/to/file}}
Extend the file size by 50 MiB, fill with holes (which reads as zero bytes):
truncate {{[-s|--size]}} +50M {{path/to/file}}
Shrink the file by 2 GiB, by removing data from the end of file:
truncate {{[-s|--size]}} -2G {{path/to/file}}
Empty the file’s content:
truncate {{[-s|--size]}} 0 {{path/to/file}}
Empty the file’s content, but do not create the file if it does not exist:
truncate {{[-s|--size]}} 0 {{[-c|--no-create]}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
tsort
tsort [OPTIONS] FILE
Tri topologique des chaînes présentes dans FILE. Les chaînes sont définies comme toute séquence de jetons séparés par des espaces (tabulation, espace ou saut de ligne), ordonnées selon les dépendances dans un graphe orienté acyclique (DAG). Utile pour la planification et la détermination de l’ordre d’exécution. Si FILE n’est pas fourni, l’entrée standard (stdin) est utilisée.
Options
-w
Examples
Perform a topological sort consistent with a partial sort per line of input separated by blanks:
tsort {{path/to/file}}
Perform a topological sort consistent on strings:
echo -e "{{UI Backend\nBackend Database\nDocs UI}}" | tsort
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
tty
tty [OPTION]...
Afficher le nom de fichier du terminal connecté à l’entrée standard.
Options
--silent,--quiet,-s-
n’afficher rien, retourner seulement un code de sortie
Examples
Print the file name of this terminal:
tty
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
uname
uname [OPTION]...
Affiche certaines informations système. Sans OPTION, identique à -s.
Options
--all,-a-
Behave as though all of the options -mnrsvo were specified.
--all-labeled,-A-
like -a, print all information but one item per line, labeled.
--kernel-name,-s-
print the kernel name.
--nodename,-n-
print the nodename (the nodename may be a name that the system is known by to a communications network).
--kernel-release,-r-
print the operating system release.
--kernel-version,-v-
print the operating system version.
--machine,-m-
print the machine hardware name.
--operating-system,-o-
print the operating system name.
--processor,-p-
print the processor type (non-portable)
--hardware-platform,-i-
print the hardware platform (non-portable)
Examples
Print kernel name:
uname
Print all available system information:
uname {{[-a|--all]}}
Print system architecture and processor information:
uname {{[-mp|--machine --processor]}}
Print kernel name, kernel release, and kernel version:
uname {{[-srv|--kernel-name --kernel-release --kernel-version]}}
Print system hostname:
uname {{[-n|--nodename]}}
Print the current operating system name:
uname {{[-o|--operating-system]}}
Display help:
uname --help
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
unexpand
unexpand [OPTION]... [FICHIER]...
Convertir les espaces dans chaque FICHIER en tabulations, en écrivant vers la sortie standard. Sans FICHIER, ou quand FICHIER est -, lire l’entrée standard.
Options
--all,-a-
convertir tous les espaces, au lieu de seulement les espaces initiaux
--first-only,-f-
convertir seulement les séquences d’espaces en début de ligne (remplace -a)
--tabs=<N, LIST>,-t <N, LIST>-
utiliser une LISTE séparée par des virgules de positions de tabulations ou avoir des tabulations de N caractères au lieu de 8 (active -a)
--no-utf8,-U-
interpréter le fichier d’entrée comme ASCII 8-bit plutôt que UTF-8
Examples
Convert blanks in each file to tabs, writing to stdout:
unexpand {{path/to/file}}
Convert blanks to tabs, reading from stdout:
unexpand
Convert all blanks, instead of just initial blanks:
unexpand {{[-a|--all]}} {{path/to/file}}
Convert only leading sequences of blanks (overrides -a):
unexpand --first-only {{path/to/file}}
Have tabs a certain number of characters apart, not 8 (enables -a):
unexpand {{[-t|--tabs]}} {{number}} {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
uniq
uniq [OPTION]... [ENTRÉE [SORTIE]]
Signaler ou omettre les lignes répétées.
Options
-D-
print all duplicate lines
--all-repeated=<delimit-method>-
afficher toutes les lignes dupliquées. La délimitation se fait avec des lignes vides. [défaut : none]
--group=<group-method>-
afficher tous les éléments, en séparant les groupes avec une ligne vide. [défaut : separate]
--check-chars=<N>,-w <N>-
comparer au maximum N caractères dans les lignes
--count,-c-
préfixer les lignes par le nombre d’occurrences
--ignore-case,-i-
ignorer les différences de casse lors de la comparaison
--repeated,-d-
afficher seulement les lignes dupliquées
--skip-chars=<N>,-s <N>-
éviter de comparer les N premiers caractères
--skip-fields=<N>,-f <N>-
éviter de comparer les N premiers champs
--unique,-u-
afficher seulement les lignes uniques
--zero-terminated,-z-
terminer les lignes avec un octet 0, pas une nouvelle ligne
Filtrer les lignes adjacentes correspondantes de ENTRÉE (ou l’entrée standard), en écrivant vers SORTIE (ou la sortie standard). Note : uniq ne détecte les lignes répétées que si elles sont adjacentes. Vous pourriez vouloir trier l’entrée d’abord, ou utiliser sort -u sans uniq.
Examples
Display each line once:
sort {{path/to/file}} | uniq
Display only unique lines:
sort {{path/to/file}} | uniq {{[-u|--unique]}}
Display only duplicate lines:
sort {{path/to/file}} | uniq {{[-d|--repeated]}}
Display each line once without case sensitivity:
sort {{path/to/file}} | uniq {{[-i|--ignore-case]}}
Display number of occurrences of each line along with that line:
sort {{path/to/file}} | uniq {{[-c|--count]}}
Display number of occurrences of each line, sorted by the most frequent:
sort {{path/to/file}} | uniq {{[-c|--count]}} | sort {{[-nr|--numeric-sort --reverse]}}
Compare only the first 10 characters on each line for uniqueness:
sort {{path/to/file}} | uniq {{[-w|--check-chars]}} 10
Compare text after the first 5 characters on each line for uniqueness:
sort {{path/to/file}} | uniq {{[-s|--skip-chars]}} 5
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
unlink
unlink FICHIER
unlink OPTION
Supprimer le lien vers le fichier FICHIER.
Options
Examples
Remove the specified file if it is the last link:
unlink {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
uptime
uptime [OPTION]...
Afficher l’heure actuelle, la durée pendant laquelle le système a été actif, le nombre d’utilisateurs sur le système, et le nombre moyen de tâches dans la file d’attente d’exécution au cours des 1, 5 et 15 dernières minutes.
Options
--since,-s-
system up since
--pretty,-p-
show uptime in pretty format
-
file to search boot time from
Examples
Print current time, uptime, number of logged-in users, and other information:
uptime
Show only the amount of time the system has been booted for:
uptime {{[-p|--pretty]}}
Print the date and time the system booted up at:
uptime {{[-s|--since]}}
Display the time data in seconds:
uptime {{[-r|--raw]}}
Display version:
uptime {{[-V|--version]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
users
users [FICHIER]
Afficher les noms d’utilisateur des utilisateurs actuellement connectés à l’hôte actuel.
Options
Examples
Print logged in usernames:
users
Print logged in usernames according to a given file:
users {{/var/log/wmtp}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
vdir
Options
--help-
ls-help-print-help
--format-
ls-help-set-display-format
-C-
ls-help-display-files-columns
--long,-l-
ls-help-display-detailed-info
-x-
ls-help-list-entries-rows
--tabsize=<COLS>,-T <COLS>-
ls-help-assume-tab-stops
-m-
ls-help-list-entries-commas
--zero-
ls-help-list-entries-nul
--dired,-D-
ls-help-generate-dired-output
--hyperlink=<WHEN>-
ls-help-hyperlink-filenames
-1-
ls-help-list-one-file-per-line
-o-
ls-help-long-format-no-group
-g-
ls-help-long-no-owner
--numeric-uid-gid,-n-
ls-help-long-numeric-uid-gid
--quoting-style-
Set quoting style
--literal,-N-
ls-help-literal-quoting-style
--escape,-b-
ls-help-escape-quoting-style
--quote-name,-Q-
ls-help-c-quoting-style
--hide-control-chars,-q-
ls-help-replace-control-chars
--show-control-chars-
ls-help-show-control-chars
--time=<field>-
ls-help-show-time-field
-c-
ls-help-time-change
-u-
ls-help-time-access
--hide=<PATTERN>-
ls-help-hide-pattern
--ignore=<PATTERN>,-I <PATTERN>-
ls-help-ignore-pattern
--ignore-backups,-B-
ls-help-ignore-backups
--sort=<field>-
ls-help-sort-by-field
-S-
ls-help-sort-by-size
-t-
ls-help-sort-by-time
-v-
ls-help-sort-by-version
-X-
ls-help-sort-by-extension
-U-
ls-help-sort-none
--dereference,-L-
ls-help-dereference-all
--dereference-command-line-symlink-to-dir-
ls-help-dereference-dir-args
--dereference-command-line,-H-
ls-help-dereference-args
--no-group,-G-
ls-help-no-group
--author-
ls-help-author
--all,-a-
ls-help-all-files
--almost-all,-A-
ls-help-almost-all
-f-
ls-help-unsorted-all
--directory,-d-
ls-help-directory
--human-readable,-h-
ls-help-human-readable
--kibibytes,-k-
ls-help-kibibytes
--si-
ls-help-si
--block-size=<BLOCK_SIZE>-
ls-help-block-size
--inode,-i-
ls-help-print-inode
--reverse,-r-
ls-help-reverse-sort
--recursive,-R-
ls-help-recursive
--width=<COLS>,-w <COLS>-
ls-help-terminal-width
--size,-s-
ls-help-allocation-size
--color-
ls-help-color-output
--indicator-style-
ls-help-indicator-style
--classify=<when>,-F <when>-
ls-help-classify
--file-type-
ls-help-file-type
-p-
ls-help-slash-directories
--time-style=<TIME_STYLE>-
ls-help-time-style
--full-time-
ls-help-full-time
--context,-Z-
ls-help-context
--group-directories-first-
ls-help-group-directories-first
Examples
Affiche la documentation de la commande originale :
tldr ls
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
wc
wc [OPTION]... [FICHIER]...
Afficher le nombre de nouvelles lignes, de mots et d’octets pour chaque FICHIER, et une ligne totale si plus d’un FICHIER est spécifié.
Options
--bytes,-c-
afficher le nombre d’octets
--chars,-m-
afficher le nombre de caractères
--files0-from=<F>-
lire l’entrée depuis les fichiers spécifiés par
des noms terminés par NUL dans le fichier F ;
Si F est - alors lire les noms depuis l’entrée standard --lines,-l-
afficher le nombre de nouvelles lignes
--max-line-length,-L-
afficher la longueur de la ligne la plus longue
--total=<WHEN>-
quand afficher une ligne avec les totaux ;
WHEN peut être : auto, always, only, never --words,-w-
afficher le nombre de mots
--debug
Examples
Compte les lignes d’un fichier :
wc {{[-l|--lines]}} {{chemin/vers/fichier}}
Compte les mots d’un fichier :
wc {{[-w|--words]}} {{chemin/vers/fichier}}
Compte les octets d’un fichier :
wc {{[-c|--bytes]}} {{chemin/vers/fichier}}
Compte les caractères d’un fichier (en prenant en compte l’ensemble des caractères multi-octets) :
wc {{[-m|--chars]}} {{chemin/vers/fichier}}
Compte les lignes, les mots et les caractères depuis l’entrée standard stdin :
{{find .}} | wc
Compte la longueur en nombre de caractères de la plus grande ligne d’un fichier :
wc {{[-L|--max-line-length]}} {{chemin/vers/fichier}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
who
who [OPTION]... [ FICHIER | ARG1 ARG2 ]
Affiche des informations sur les utilisateurs actuellement connectés.
Options
--all,-a-
identique à -b -d –login -p -r -t -T -u
--boot,-b-
heure du dernier démarrage système
--dead,-d-
affiche les processus morts
--heading,-H-
affiche une ligne d’en-têtes de colonnes
--login,-l-
affiche les processus de connexion système
--lookup-
tente de canonicaliser les noms d’hôtes via DNS
-m-
seulement le nom d’hôte et l’utilisateur associés à stdin
--process,-p-
affiche les processus actifs lancés par init
--count,-q-
tous les noms de connexion et le nombre d’utilisateurs connectés
--runlevel,-r-
affiche le niveau d’exécution actuel
--short,-s-
affiche seulement nom, ligne et heure (par défaut)
--time,-t-
affiche le dernier changement d’horloge système
--users,-u-
liste les utilisateurs connectés
--mesg,--message,--writable,-T,-w-
ajoute le statut de message de l’utilisateur comme +, - ou ?
Examples
Display the username, line, and time of all currently logged-in sessions:
who
Display all available information:
who {{[-a|--all]}}
Display all available information with table headers:
who {{[-aH|--all --heading]}}
Display information only for the current terminal session:
who am i
Display help:
who --help
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
whoami
whoami
Affiche le nom d’utilisateur actuel.
Options
Examples
Affiche la documentation de la commande originale :
tldr id
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.
yes
yes [CHAÎNE]...
Affiche de façon répétée une ligne avec CHAÎNE (ou ‘y’)
Options
Examples
Envoyer « message » à répétition :
yes {{message}}
Envoyer « y » à répétition :
yes
Répondre « oui » à toutes les questions posées par la commande apt-get :
yes | sudo apt-get install {{program}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.