Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

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

crates.io package

# Unix like
cargo install coreutils --features unix --locked
# Windows
cargo install coreutils --features windows --locked

Linux

Alpine

Alpine Linux Edge package

apk update uutils-coreutils

Note: Requires the edge repository.

Arch

Arch package

pacman -S uutils-coreutils

Debian

Debian package

apt install rust-coreutils
# To use it:
export PATH=/usr/lib/cargo/bin/coreutils:$PATH

Fedora

Fedora package

dnf install uutils-coreutils
# To use it:
export PATH=/usr/libexec/uutils-coreutils:$PATH

Gentoo

Gentoo package

emerge -pv sys-apps/uutils-coreutils

Manjaro

Manjaro Stable package Manjaro Testing package Manjaro Unstable package

pacman -S uutils-coreutils
# or
pamac install uutils-coreutils

NixOS

nixpkgs unstable package

nix-env -iA nixos.uutils-coreutils

OpenMandriva Lx

openmandriva cooker package

dnf install uutils-coreutils

RHEL/AlmaLinux/CENTOS Stream/Rocky Linux/EPEL 9

epel 9 package

# 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

Ubuntu package

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

Homebrew package

brew install uutils-coreutils

MacPorts

MacPorts package

port install coreutils-uutils

FreeBSD

FreeBSD port

pkg install rust-coreutils

Windows

Winget

winget install uutils.coreutils

Scoop

Scoop package

scoop install uutils-coreutils

MSYS2

MSYS2 package (Windows native)

MSYS2 package (Cygwin)

Alternative installers

Conda

Conda package

conda install -c conda-forge uutils-coreutils

Yocto

Yocto recipe

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 systemTested targets
Linuxx86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
arm-unknown-linux-gnueabihf
i686-unknown-linux-gnu
aarch64-unknown-linux-gnu
macOSx86_64-apple-darwin
aarch64-apple-darwin
Windowsi686-pc-windows-msvc
x86_64-pc-windows-gnu
x86_64-pc-windows-msvc
FreeBSDx86_64-unknown-freebsd
OpenBSDx86_64-unknown-openbsd
Androidx86_64-linux-android
wasm32wasm32-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.

utilLinuxmacOSWindowsFreeBSDAndroid
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:

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 utilities
  • src/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 website
  • tests/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.toml
  • src/main.rs: contains only a single macro call
  • src/<util name>.rs: the actual code for the utility
  • locales/en-US.ftl: the util’s strings
  • locales/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 main branch.
  • 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 -i or uucore: 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, but ls: fix version sort order.
    • You can prefix the title with the utility the PR concerns.
  • 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 stack to 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 main or git rebase main.
    • Feel free to ask for help with merge conflicts.
  • 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 a CI job fails and you believe it is a flaky or intermittent failure, you can comment /rerun on 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:

  1. 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.py script to help with this decision.
  2. Build both the GNU and Rust coreutils using: bash util/build-gnu.sh
  3. Run the test with bash util/run-gnu-test.sh <your test>
  4. Start to modify <your test> to understand what is wrong. Examples:
    1. Add set -v to have the bash verbose mode
    2. Add echo $? where needed
    3. When the variable fail is used in the test, echo $fail to see when the test started to fail
    4. Bump the content of the output (ex: cat err)
    5. …
  5. Or, if the test is simple, extract the relevant information to create a new test case running both GNU & Rust implementation
  6. Start to modify the Rust implementation to match the expected behavior
  7. 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:

  1. Fork the coreutils repository to your GitHub account. Tip: See this GitHub guide for more information on this step.
  2. 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

Install Rust

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:

  1. Install prek
  2. Run prek install while 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

  1. Modify util/update-version.sh (FROM & TO) and run it
  2. Submit a new PR with these changes and wait for it to be merged
  3. Tag the new release git tag -a X.Y.Z and git push --tags
  4. 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.
  5. Write the release notes (it takes time) following previous examples
  6. Run util/publish.sh --do-it to 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.rs for multi-call binaries
  • In src/uucore/src/lib.rs for 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 .ftl files 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:

  • -P displays the id as a password file entry
  • -p makes the output human-readable
  • -A displays 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/--since to show since when the system is up
  • -p/--pretty to 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
───╯

Try it in the playground.

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
───╯

Try it in the playground.

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
───╯

Try it in the playground.

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
───╯

Try it in the playground.

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"
───╯

Try it in the playground.

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.

Try it in the playground.

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.

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
───╯

Try it in the playground.

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_DIAG says 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_COLOR disables 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_diagnostics cargo feature, which is on by default. Building with --no-default-features (plus a feat_os_* selection) drops the renderer and its ariadne dependency, 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:

ValueEffect
alwaysDraw the report even when stderr is a file or a pipe.
neverKeep the plain one-line message even at a terminal.
auto, unset, anything elseDecide 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

UtilityWhat the caret points atTry it
testthe argument that made the expression failtest 7 -eq zap
exprthe argument that made the expression failexpr 9 + foo
chmodthe failing clause (or character) of an invalid symbolic or octal modechmod 'g+rw?x' fruits.txt
mkdirthe failing part of the mode given to -m/--modemkdir -m u+q mydir
mkfifothe failing part of the mode given to -m/--modemkfifo -m u+q mypipe
mknodthe failing part of the mode given to -m/--modemknod -m u+q mydev c 1 3
installthe failing part of the mode given to -m/--modeinstall -m u+q fruits.txt dest
trthe part of a set that is at fault (bad class, backwards range, bad repeat count, …)tr 'qw[y-b]' x
sortthe failing part of a -k/--key or field specification, or of the SIZE given to -Ssort -k2.3x fruits.txt
numfmtthe failing part of a --field or --format specificationnumfmt --format=%q 1000
printfthe failing conversion or escape in the format stringprintf %5.2c q
seqthe failing conversion in the format given to -f/--formatseq -f %5.2c 1 3
statthe failing directive of a -c/--format or --printf formatstat -c %d%.3 fruits.txt
envthe failing part of a -S/--split-string stringenv -S 'echo ${1FOO}'
ddthe failing key, value or flag of a KEY=VALUE operanddd conv=ucase,zap
jointhe failing field of the output format given to -ojoin -o 1.2,2.x fruits.txt fruits.txt
cutthe failing range in the list given to -b, -c, -f or -Fcut -f 1,4-2 fruits.txt
csplitthe failing pattern operand, the character of its regex that broke, or the format given to -b/-ncsplit fruits.txt '/a(b/'
splitthe failing part of the SIZE given to -b, -C or -lsplit -b 7zq fruits.txt
shredthe failing part of the SIZE given to -s/--sizeshred -s 4vv fruits.txt
headthe failing part of the SIZE given to -c or -nhead -c 1fb fruits.txt
tailthe failing part of the SIZE given to -c or -ntail -c 1fb fruits.txt
truncatethe failing part of the SIZE given to -s/--sizetruncate -s 10fb fruits.txt
odthe failing part of the SIZE given to -j, -N, -S or -wod -N 3zz fruits.txt
duthe failing part of the SIZE given to -B/--block-size or -t/--thresholddu -B 1fb
dfthe failing part of the SIZE given to -B/--block-sizedf -B 1fb
lsthe failing part of the SIZE given to --block-size (also dir and vdir)ls --block-size=1fb
stdbufthe failing part of the buffering mode given to -i, -o or -estdbuf -o 6pq head

How it works

The rendering lives in uucore::features::diagnostics and is built on ariadne. A utility that opts in:

  1. Takes a Snapshot of 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.
  2. Maps its own error type to a position, and optionally a label and a line of advice, in a small per-utility diagnostics.rs module. A label is only used when it adds something the message does not say - an expectation, or a fix such as tr’s did 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.
  3. Locates the argument the operand came from - with Snapshot::index_of_value for 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_positional for a positional operand, or an index the utility tracked itself - and calls Snapshot::render to point at the whole argument, or Snapshot::render_inside_at to 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_value does 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), for chmod, mkdir, mkfifo, mknod and install.
  • Range lists (uucore::ranges), for cut’s -b, -c and -f and for numfmt --field. Range::from_list reports which item of the list failed and where it sat.
  • Sizes (uucore::parser::parse_size), for head, tail, truncate, split, shred, stdbuf, sort, od, du, df and ls (with dir and vdir) today, and available to the other callers of the parser. ParseSizeError::span works 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

v0.13.0
arq

Mostrar la arquitectura de la máquina

Options

Determinar el nombre de la arquitectura para la máquina actual.

Examples

Vea la documentación del comando original:

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

v0.13.0
b2sum [OPTIONS] [FILE]...

Print or check the BLAKE2b 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

--length, -l

ck-common-help-length

--tag

ck-common-help-tag

--text, -t
--zero, -z

ck-common-help-zero

Examples

Calcula la suma de comprobación BLAKE2 para uno o más archivos:

b2sum {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Calcula y guarda la lista de sumas de comprobación BLAKE2 en un archivo:

b2sum {{ruta/al/archivo1 ruta/al/archivo2 ...}} >{{ruta/al/archivo.b2}}

Calcula una suma de comprobación BLAKE2 desde stdin:

{{comando}} | b2sum

Lee un archivo de sumas de comprobación BLAKE2 y nombres de archivo y verifica que todos los archivos tengan sumas de comprobación coincidentes:

b2sum {{[-c|--check]}} {{ruta/al/archivo.b2}}

Muestra solo un mensaje para los archivos que faltan o cuando falla la verificación:

b2sum {{[-c|--check]}} --quiet {{ruta/al/archivo.b2}}

Muestra solo un mensaje cuando falle la verificación, ignorando los archivos que faltan:

b2sum --ignore-missing {{[-c|--check]}} --quiet {{ruta/al/archivo.b2}}

Comprueba una suma de comprobación BLAKE2 conocida de un archivo:

echo {{suma_de_comprobación_blake2_conocida_del_archivo}} {{ruta/al/archivo}} | b2sum {{[-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.

base32

v0.13.0
base32 [OPCIÓN]... [ARCHIVO]

codificar/decodificar datos y mostrar a salida estándar Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

Los datos se codifican como se describe para el alfabeto base32 en RFC 4648. Al decodificar, la entrada puede contener nuevas líneas además de los bytes del alfabeto base32 formal. Use –ignore-garbage para intentar recuperarse de cualquier otro byte no alfabético en el flujo codificado.

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

Codifica un archivo:

base32 {{ruta/al/archivo}}

Ajuste la salida codificada en un ancho específico (0 deshabilita el ajuste):

base32 {{[-w|--wrap]}} {{0|76|...}} {{ruta/al/archivo}}

Decodifica un archivo:

base32 {{[-d|--decode]}} {{ruta/al/archivo}}

Codifica stdin:

{{comando}} | base32

Decodifica stdin:

{{comando}} | 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

v0.13.0
base64 [OPCIÓN]... [ARCHIVO]

codificar/decodificar datos y mostrar a salida estándar Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

Los datos se codifican como se describe para el alfabeto base64 en RFC 3548. Al decodificar, la entrada puede contener nuevas líneas además de los bytes del alfabeto base64 formal. Use –ignore-garbage para intentar recuperarse de cualquier otro byte no alfabético en el flujo codificado.

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

Codifica un archivo:

base64 {{ruta/al/archivo}}

Ajusta la salida codificada en un ancho específico (0 deshabilita el ajuste):

base64 {{[-w|--wrap]}} {{0|76|...}} {{ruta/al/archivo}}

Decodifica un archivo:

base64 {{[-d|--decode]}} {{ruta/al/archivo}}

Codifica stdin:

{{comando}} | base64

Decodifica stdin:

{{comando}} | 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

v0.13.0
basename [-z] NOMBRE [SUFIJO]
basename OPCIÓN... NOMBRE...

Mostrar NOMBRE eliminando cualquier componente de directorio inicial Si se especifica, también eliminar un SUFIJO 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

Imprime el nombre de un fichero a partir de su ruta:

basename {{ruta/al/archivo}}

Imprime el componente terminal de la ruta de un directorio:

basename {{ruta/al/directorio}}

Imprime el nombre de un fichero sin un sufijo:

basename {{ruta/al/archivo}} {{sufijo}}

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

v0.13.0
basenc [OPCIÓN]... [ARCHIVO]

Codificar/decodificar datos y mostrar a salida estándar Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

Al decodificar, la entrada puede contener nuevas líneas además de los bytes del alfabeto formal. Use –ignore-garbage para intentar recuperarse de cualquier otro byte no alfabético en el flujo codificado.

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

igual que el programa «base64»

--base64url

base64 seguro para archivos y url

--base32

igual que el programa «base32»

--base32hex

base32 de alfabeto hex extendido

--base16

codificación hex

--base2lsbf

cadena de bits con bit menos significativo (lsb) primero

--base2msbf

cadena de bits con bit más significativo (msb) primero

--z85

codificación similar a ascii85;
al codificar, la longitud de entrada debe ser múltiplo de 4;
al decodificar, la longitud de entrada debe ser múltiplo de 5

--base58

codificación en base58 visualmente no ambigua

Examples

Codifica un archivo con codificación base64:

basenc --base64 {{ruta/al/archivo}}

Descifra un archivo con codificación base64:

basenc {{[-d|--decode]}} --base64 {{ruta/al/archivo}}

Codifica desde stdin con codificación Base32 con 42 columnas:

{{comando}} | basenc --base32 {{[-w|--wrap]}} 42

Codifica desde stdin con codificación base32:

{{comando}} | 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

v0.13.0
cat [OPCIÓN]... [ARCHIVO]...

Concatenar ARCHIVO(s), o entrada estándar, a salida estándar Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

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

Imprime el contenido de un archivo a stdout:

cat {{ruta/al/archivo}}

Concatena varios archivos en un archivo:

cat {{ruta/al/archivo1 ruta/al/archivo2 ...}} >{{ruta/al/archivo_resultado}}

Añade varios archivos a un archivo:

cat {{ruta/al/archivo1 ruta/al/archivo2 ...}} >>{{ruta/al/archivo_resultado}}

Escribe stdin a un archivo:

cat - >{{ruta/al/archivo}}

[n]umera todas las líneas de salida:

cat {{[-n|--number]}} {{ruta/al/archivo}}

Muestra caracteres no imprimibles y en blanco (con prefijo M- si no es ASCII):

cat {{[-vte|--show-nonprinting -t -e]}} {{ruta/al/archivo}}

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

v0.13.0
chcon [OPCIÓN]... CONTEXTO ARCHIVO...
chcon [OPCIÓN]... [-u USUARIO] [-r ROL] [-l RANGO] [-t TIPO] ARCHIVO...
chcon [OPCIÓN]... --reference=RARCHIVO ARCHIVO...

Cambiar el contexto de seguridad SELinux de cada ARCHIVO a CONTEXTO. Con –reference, cambiar el contexto de seguridad de cada ARCHIVO al de RARCHIVO.

Options

--dereference

Afectar el referente de cada enlace simbólico (esto es por defecto), en lugar del enlace simbólico mismo.

--no-dereference, -h

Afectar enlaces simbólicos en lugar de cualquier archivo referenciado.

--help

help

--preserve-root

Fallar al operar recursivamente en «/».

--no-preserve-root

No tratar «/» especialmente (predeterminado).

--reference=<RFILE>

Usar contexto de seguridad de RARCHIVO, en lugar de especificar un valor CONTEXTO.

--user=<USER>, -u <USER>

Establecer usuario USUARIO en el contexto de seguridad destino.

--role=<ROLE>, -r <ROLE>

Establecer rol ROL en el contexto de seguridad destino.

--type=<TYPE>, -t <TYPE>

Establecer tipo TIPO en el contexto de seguridad destino.

--range=<RANGE>, -l <RANGE>

Establecer rango RANGO en el contexto de seguridad destino.

--recursive, -R

Operar en archivos y directorios recursivamente.

-H

Si un argumento de línea de comandos es un enlace simbólico a un directorio, atravesarlo. Solo válido cuando se especifica -R.

-L

Atravesar cada enlace simbólico a un directorio encontrado. Solo válido cuando se especifica -R.

-P

No atravesar ningún enlace simbólico (por defecto). Solo válido cuando se especifica -R.

--verbose, -v

Mostrar un diagnóstico para cada archivo procesado.

Examples

Vea el contexto de seguridad de un archivo:

ls {{[-lZ|-l --context]}} {{ruta/al/archivo}}

Cambia el contexto de seguridad de un archivo de destino utilizando un archivo de referencia:

chcon --reference {{archivo_de_referencia}} {{archivo_de_destino}}

Cambia el contexto de seguridad completo de SELinux de un archivo:

chcon {{usuario}}:{{rol}}:{{tipo}}:{{rango/nivel}} {{nombre_archivo}}

Cambia únicamente la parte de usuario del contexto de seguridad de SELinux:

chcon {{[-u|--user]}} {{usuario}} {{nombre_del_archivo}}

Cambia únicamente la parte de rol del contexto de seguridad de SELinux:

chcon {{[-r|--role]}} {{rol}} {{nombre_del_archivo}}

Cambia únicamente la parte de tipo del contexto de seguridad de SELinux:

chcon {{[-t|--type]}} {{tipo}} {{nombre_del_archivo}}

Cambia únicamente la parte de rango/nivel del contexto de seguridad de SELinux:

chcon {{[-l|--range]}} {{rango/nivel}} {{nombre_del_archivo}}

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

v0.13.0
chgrp [OPCIÓN]... GRUPO ARCHIVO...
chgrp [OPCIÓN]... --reference=RARCHIVO ARCHIVO...

Cambiar el grupo de cada ARCHIVO a GRUPO.

Options

--help

Mostrar información de ayuda.

--changes, -c

como verbose pero reportar solo cuando se hace un cambio

--silent, -f
--quiet

suprimir la mayoría de mensajes de error

--verbose, -v

mostrar un diagnóstico para cada archivo procesado

--preserve-root

fallar al operar recursivamente en «/»

--no-preserve-root

no tratar «/» especialmente (predeterminado)

--reference=<RFILE>

usar el grupo de RARCHIVO en lugar de especificar valores GRUPO

--from=<GROUP>

cambiar el grupo solo si su grupo actual coincide con GRUPO

--recursive, -R

operar en archivos y directorios recursivamente

-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

Cambia el grupo propietario de un archivo/directorio:

chgrp {{grupo}} {{ruta/al/archivo_o_directorio}}

Cambia recursivamente el grupo propietario de un directorio y su contenido:

chgrp {{[-R|--recursive]}} {{grupo}} {{ruta/al/directorio}}

Cambia el grupo propietario de un enlace simbólico:

chgrp {{[-h|--no-dereference]}} {{grupo}} {{ruta/al/symlink}}

Cambia el grupo propietario de un archivo/directorio para que coincida con un archivo de referencia:

chgrp --reference {{ruta/al/archivo_de_referencia}} {{ruta/al/archivo_o_directorio}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
chmod [OPCIÓN]... MODO[,MODO]... ARCHIVO...
chmod [OPCIÓN]... MODO-OCTAL ARCHIVO...
chmod [OPCIÓN]... --reference=RARCHIVO ARCHIVO...

Cambiar el modo de cada ARCHIVO a MODO. Con –reference, cambiar el modo de cada ARCHIVO al de RARCHIVO.

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)

Cada MODO tiene la forma [ugoa]*(-+=)+|[-+=]?[0-7]+.

Examples

Otorga al [u]suario que es propietario del archivo permiso para [x] ejecutarlo:

chmod u+x {{ruta/al/archivo}}

Otorga al [u]suario derechos para leer (r) y escribir (w) un archivo o directorio:

chmod u+rw {{ruta/al/archivo_o_directorio}}

Elimina los derechos de ejecución del [g]rupo:

chmod g-x {{ruta/al/archivo}}

Otorga a todos los usuarios (a) derechos para leer y ejecutar:

chmod a+rx {{ruta/al/archivo}}

Otorga a [o]tros (que no están en el grupo del propietario) los mismos derechos que los del [g]rupo:

chmod o=g {{ruta/al/archivo}}

Quita todos los derechos a [o]tros:

chmod o= {{ruta/al/archivo}}

Otorga al [g]rupo y a [o]tros el derecho para escribir (w) un directorio y su contenido:

chmod {{[-R|--recursive]}} g+w,o+w {{ruta/al/directorio}}

Concede de forma recursiva [a] todos los usuarios permisos de lectu[r]a a los archivos y permisos de e[X]ecución a los subdirectorios dentro de un directorio:

chmod {{[-R|--recursive]}} a+rX {{ruta/al/directorio}}

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

v0.13.0
chown [OPCIÓN]... [PROPIETARIO][:[GRUPO]] ARCHIVO...
chown [OPCIÓN]... --reference=RARCHIVO ARCHIVO...

Cambiar propietario y grupo de archivo

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

Cambia el usuario propietario de un archivo/directorio:

chown {{usuario}} {{ruta/al/archivo_o_directorio}}

Cambia el usuario y grupo propietario de un archivo/directorio:

chown {{usuario}}:{{grupo}} {{ruta/al/archivo_o_directorio}}

Cambia el usuario propietario y el grupo para que ambos sean usuario:

chown {{usuario}}: {{ruta/al/archivo_o_directorio}}

Cambia recursivamente el propietario de un directorio y su contenido:

chown {{[-R|--recursive]}} {{usuario}} {{ruta/al/directorio}}

Cambia el propietario de un enlace simbólico:

chown {{[-h|--no-dereference]}} {{usuario}} {{ruta/al/enlace_simbólico}}

Cambia el propietario de un archivo/directorio para que coincida con un archivo de referencia:

chown --reference {{ruta/al/archivo_de_referencia}} {{ruta/al/archivo_o_directorio}}

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

v0.13.0
chroot [OPCIÓN]... NUEVARAIZ [COMANDO [ARG]...]

Ejecutar COMANDO con directorio raíz establecido a NUEVARAIZ.

Options

--groups=<GROUP1,GROUP2...>

Lista separada por comas de grupos a los cuales cambiar

--userspec=<USER:GROUP>

Usuario y grupo separados por dos puntos a los cuales cambiar.

--skip-chdir

Use esta opción para no cambiar el directorio de trabajo a / después de cambiar el directorio raíz a nuevaraiz, es decir, dentro del chroot.

Examples

Ejecuta un comando como nuevo directorio raíz:

sudo chroot {{ruta/al/nuevo/root}} {{comando}}

Utiliza un usuario y grupo específicos:

sudo chroot --userspec {{nombre_usuario_o_id:nombre_grupo_o_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.

cksum

v0.13.0
cksum [OPCIONES] [ARCHIVO]...

Mostrar CRC y tamaño para cada archivo

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 determina el algoritmo de resumen y formato de salida por defecto:

  • sysv: (equivalente a sum -s)
  • bsd: (equivalente a sum -r)
  • crc: (equivalente a cksum)
  • crc32b: (solo disponible a través de cksum)
  • md5: (equivalente a md5sum)
  • sha1: (equivalente a sha1sum)
  • sha224: (equivalente a sha224sum)
  • sha256: (equivalente a sha256sum)
  • sha384: (equivalente a sha384sum)
  • sha512: (equivalente a sha512sum)
  • blake2b: (equivalente a b2sum)
  • sm3: (solo disponible a través de cksum)

Examples

Muestra una suma de comprobación de 32 bits, el tamaño en bytes y el nombre del archivo:

cksum {{ruta/al/archivo}}

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

v0.13.0
comm [OPCIÓN]... ARCHIVO1 ARCHIVO2

Comparar dos archivos ordenados línea por línea.

Cuando ARCHIVO1 o ARCHIVO2 (no ambos) es -, leer entrada estándar.

Sin opciones, producir salida de tres columnas. La columna uno contiene líneas únicas a ARCHIVO1, la columna dos contiene líneas únicas a ARCHIVO2, y la columna tres contiene líneas comunes a ambos archivos.

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 tres columnas separadas por tabuladores: líneas solo en el primer archivo, líneas solo en el segundo archivo y líneas comunes:

comm {{fichero1}} {{fichero2}}

Imprime solo las líneas comunes a ambos archivos:

comm -12 {{fichero1}} {{fichero2}}

Imprime solo las líneas comunes a ambos archivos, leyendo un archivo desde stdin:

cat {{fichero1}} | comm -12 - {{fichero2}}

Obtiene las líneas que solo se encuentran en el primer fichero, guardando el resultado en un tercer fichero:

comm -23 {{fichero1}} {{fichero2}} >{{solo_fichero1}}

Imprime las líneas solo encontradas en el segundo fichero, cuando los ficheros no están ordenados:

comm -13 <(sort {{fichero1}}) <(sort {{fichero2}})

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
cp [OPCIÓN]... [-T] ORIGEN DESTINO
cp [OPCIÓN]... ORIGEN... DIRECTORIO
cp [OPCIÓN]... -t DIRECTORIO ORIGEN...

Copiar ORIGEN a DESTINO, o múltiples ORIGEN(es) a DIRECTORIO.

Options

--target-directory=<target-directory>, -t <target-directory>

copiar todos los argumentos ORIGEN al directorio destino

--no-target-directory, -T

Tratar DESTINO como un archivo regular y no un directorio

--interactive, -i

preguntar antes de sobreescribir archivos

--link, -l

enlazar archivos duros en lugar de copiar

--no-clobber, -n

no sobreescribir un archivo que ya existe

--recursive, -R, -r

copiar directorios recursivamente

--strip-trailing-slashes

eliminar cualquier barra final de cada argumento ORIGEN

--debug

explicar cómo se copia un archivo. Implica -v

--verbose, -v

declarar explícitamente lo que se está haciendo

--symbolic-link, -s

hacer enlaces simbólicos en lugar de copiar

--force, -f

si un archivo de destino existente no se puede abrir, eliminarlo e intentar de nuevo (esta opción se ignora cuando también se usa la opción -n). Actualmente no implementado para Windows.

--remove-destination

eliminar cada archivo de destino existente antes de intentar abrirlo (contraste con –force). En Windows, actualmente solo funciona para archivos escribibles.

--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>

controlar copias clone/CoW. Ver abajo

--attributes-only

No copiar los datos del archivo, solo los atributos

--preserve=<ATTR_LIST>

Preservar los atributos especificados (por defecto: modo, propiedad (solo unix), marcas de tiempo), si es posible atributos adicionales: context, links, xattr, all

--preserve-default-attributes, -p

igual que –preserve=mode,ownership(solo unix),timestamps

--no-preserve=<ATTR_LIST>

no preservar los atributos especificados

--parents

usar nombre completo del archivo origen bajo DIRECTORIO

--no-dereference, -P

nunca seguir enlaces simbólicos en ORIGEN

--dereference, -L

siempre seguir enlaces simbólicos en ORIGEN

-H

seguir enlaces simbólicos de línea de comandos en ORIGEN

--archive, -a

Igual que -dR –preserve=all

-d

igual que –no-dereference –preserve=links

--one-file-system, -x

permanecer en este sistema de archivos

--sparse=<WHEN>

controlar creación de archivos dispersos. Ver abajo

-Z

establecer contexto de seguridad SELinux del archivo destino al tipo por defecto

--context=<CTX>

como -Z, o si se especifica CTX entonces establecer el contexto de seguridad SELinux o SMACK a CTX

--progress, -g

Mostrar una barra de progreso. Nota: esta característica no está soportada por GNU coreutils.

--copy-contents

NoImplementado: copiar contenidos de archivos especiales cuando recursivo

No copiar un no-directorio que tiene un destino existente con la misma o más nueva marca de tiempo de modificación; en su lugar, omitir silenciosamente el archivo sin fallar. Si se están preservando las marcas de tiempo, la comparación es con la marca de tiempo de origen truncada a las resoluciones del sistema de archivos de destino y de las llamadas del sistema usadas para actualizar marcas de tiempo; esto evita trabajo duplicado si varios comandos cp -pu se ejecutan con el mismo origen y destino. Esta opción se ignora si también se especifica la opción -n o –no-clobber. También, si –preserve=links también se especifica (como con cp -au por ejemplo), eso tendrá precedencia; consecuentemente, dependiendo del orden en que se procesen los archivos del origen, archivos más nuevos en el destino pueden ser reemplazados, para reflejar enlaces duros en el origen. lo cual da más control sobre qué archivos existentes en el destino son reemplazados, y su valor puede ser uno de los siguientes:

  • all Esta es la operación por defecto cuando no se especifica una opción –update, y resulta en que todos los archivos existentes en el destino sean reemplazados.
  • none Esto es similar a la opción –no-clobber, en que ningún archivo en el destino es reemplazado, pero también omitir un archivo no induce un fallo.
  • older Esta es la operación por defecto cuando se especifica –update, y resulta en que los archivos sean reemplazados si son más antiguos que el archivo origen correspondiente.

Examples

Copia un archivo a otra ubicación:

cp {{ruta/al/archivo_de_origen.ext}} {{ruta/al/archivo_destino.ext}}

Copia un archivo en otro directorio, manteniendo el nombre del archivo:

cp {{ruta/al/archivo_de_origen.ext}} {{ruta/al/directorio_destino}}

Copia recursivamente el contenido de un directorio a otra ubicación (si el destino existe, el directorio se copia dentro de él):

cp {{[-r|--recursive]}} {{ruta/al/directorio_de_origen}} {{ruta/al/directorio_de_destino}}

Copia un directorio de forma recursiva, en modo detallado (muestra los archivos a medida que se copian):

cp {{[-vr|--verbose --recursive]}} {{ruta/al/directorio_de_origen}} {{ruta/al/directorio_de_destino}}

Copia varios archivos a la vez en un directorio:

cp {{[-t|--target-directory]}} {{ruta/al/directorio_de_destino}} {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Copia archivos de texto a otra ubicación, en modo interactivo (pregunta al usuario antes de sobrescribir):

cp {{[-i|--interactive]}} {{*.txt}} {{ruta/al/directorio_de_objetivo}}

Sigue los enlaces simbólicos antes de copiar:

cp {{[-L|--dereference]}} {{enlace}} {{ruta/al/directorio_de_destino}}

Utiliza el primer argumento como directorio de destino (útil para xargs ... | cp -t destination_directory):

cp {{[-t|--target-directory]}} {{ruta/al/directorio_de_destino}} {{ruta/al/archivo_o_directorio1 ruta/al/archivo_o_directorio2 ...}}

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

v0.13.0
csplit [OPCIÓN]... ARCHIVO PATRÓN...

Dividir un archivo en secciones determinadas por líneas de contexto

Options

--suffix-format=<FORMAT>, -b <FORMAT>

usar FORMATO sprintf en lugar de %02d

--prefix=<PREFIX>, -f <PREFIX>

usar PREFIJO en lugar de ‘xx’

--keep-files, -k

no eliminar archivos de salida cuando hay errores

--suppress-matched

suprimir las líneas que coinciden con PATRÓN

--digits=<DIGITS>, -n <DIGITS>

usar el número especificado de dígitos en lugar de 2

--quiet, --silent, -q, -s

no mostrar el número de bytes de los archivos de salida

--elide-empty-files, -z

eliminar archivos de salida vacíos

Dividir piezas de ARCHIVO separadas por PATRÓN(ES) en archivos ‘xx00’, ‘xx01’, …, y mostrar el número de bytes de cada pieza en la salida estándar.

Examples

Divide un archivo en dos partes, comenzando la segunda en la línea 10:

csplit {{ruta/al/archivo}} 10

Divide un archivo en tres partes, comenzando las últimas partes en las líneas 7 y 23:

csplit {{ruta/al/archivo}} 7 23

Inicia una nueva parte cada 5 líneas (fallará si el número de líneas no es divisible por 5):

csplit {{ruta/al/archivo}} 5 {*}

Inicia una nueva parte cada 5 líneas, ignorando el error de división exacta:

csplit {{[-k|--keep-files]}} {{ruta/al/archivo}} 5 {*}

Divide un archivo a partir de la línea 5 y utiliza un prefijo personalizado para los archivos de salida (el valor por defecto es xx):

csplit {{ruta/al/archivo}} 5 {{[-f|--prefix]}} {{prefijo}}

Divide un archivo a partir de la primera línea que coincida con un patrón regex:

csplit {{ruta/al/archivo}} /{{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

v0.13.0
cut OPCIÓN... [ARCHIVO]...

Muestra columnas de byte o campo especificadas de cada línea de stdin o los archivos de entrada

Options

--bytes=<LIST>, -b <LIST>

extraer bytes enumerados en LISTA

--characters=<LIST>, -c <LIST>

extraer caracteres enumerados en LISTA

--delimiter=<DELIM>, -d <DELIM>

especificar el carácter delimitador que separa campos en la fuente de entrada. Por defecto Tab.

--whitespace-delimited=<trimmed>, -w <trimmed>

Usar cualquier número de espacios en blanco (Espacio, Tab) para separar campos en la fuente de entrada (extensión FreeBSD).

--fields=<LIST>, -f <LIST>

extraer campos enumerados en LISTA

-F <LIST>

como -f, pero fusiona los delimitadores adyacentes; el delimitador predeterminado es el espacio en blanco y el delimitador de salida un espacio

--complement

invertir el filtro - en lugar de mostrar solo las columnas filtradas, mostrar todas excepto esas columnas

--only-delimited, -s

en modo campo, solo mostrar líneas que contienen el delimitador

--zero-terminated, -z

en lugar de filtrar columnas basado en línea, filtrar columnas basado en \0 (carácter NULL)

--output-delimiter=<NEW_DELIM>, -O <NEW_DELIM>

en modo campo, reemplazar el delimitador en líneas de salida con el argumento de esta opción

--no-partial, -n

con -b, no mostrar caracteres multibyte parciales

Cada llamada debe especificar un modo (qué usar para columnas), una secuencia (qué columnas mostrar), y proporcionar una fuente de datos

Especificar un modo

Use –bytes (-b) o –characters (-c) para especificar modo byte

Use –fields (-f) para especificar modo campo, donde cada línea se divide en campos identificados por un carácter delimitador. Por ejemplo, para un CSV típico podría usar esto en combinación con establecer coma como delimitador

Especificar una secuencia

Una secuencia es un grupo de 1 o más números o rangos inclusivos separados por comas.

cut -f 2,5-7 algun_archivo.txt

mostrará el 2º, 5º, 6º y 7º campo para cada línea fuente

Los rangos pueden extenderse hasta el final de la fila excluyendo el segundo número

cut -f 3- algun_archivo.txt

mostrará el 3er campo y todos los campos después para cada línea fuente

El primer número de un rango puede ser excluido, y esto es efectivamente lo mismo que usar 1 como el primer número: hace que el rango comience en la primera columna. Los rangos también pueden mostrar una sola columna

cut -f 1,3-5 algun_archivo.txt

mostrará el 1º, 3º, 4º y 5º campo para cada línea fuente

La opción –complement, cuando se usa, invierte el efecto de la secuencia

cut –complement -f 4-6 algun_archivo.txt

mostrará todos los campos excepto el 4º, 5º y 6º

Especificar una fuente de datos

Si no se especifican argumentos de archivo fuente, stdin se usa como la fuente de líneas a mostrar

Si se especifican argumentos de archivo fuente, stdin se ignora y todos los archivos se leen consecutivamente si un archivo fuente no se lee exitosamente, se mostrará una advertencia a stderr, y el código de estado eventual será 1, pero cut continuará leyendo a través de los archivos fuente procedentes

Para mostrar columnas tanto de STDIN como de un argumento de archivo, use - (guión) como argumento de archivo fuente para representar stdin.

Opciones de Modo Campo

Los campos en cada línea son identificados por un delimitador (separador)

Establecer el delimitador

Establezca el delimitador que separa campos en el archivo usando la opción –delimiter (-d). Establecer el delimitador es opcional. Si no se establece, se usará un delimitador por defecto de Tab.

Si se proporciona la opción -w, los campos serán separados por cualquier número de caracteres de espacio en blanco (Espacio y Tab). El delimitador de salida será un Tab a menos que se especifique explícitamente. Solo una de las opciones -d o -w puede ser especificada. Esta es una extensión adoptada de FreeBSD.

Opcionalmente Filtrar basado en delimitador

Si se proporciona la bandera –only-delimited (-s), solo las líneas que contienen el delimitador serán mostradas

Reemplazar el delimitador

Si se proporciona la opción –output-delimiter, el argumento usado para ella reemplazará el carácter delimitador en cada línea mostrada. Esto es útil para transformar datos tabulares - ej. para convertir un CSV a un TSV (archivo separado por tabs)

Finales de línea

Cuando se usa la opción –zero-terminated (-z), cut ve \0 (null) como el carácter de ‘final de línea’ (tanto para propósitos de leer líneas como separar líneas mostradas) en lugar de \n (nueva línea). Esto es útil para datos tabulares donde algunas de las celdas pueden contener nuevas líneas

echo ‘ab\0cd’ | cut -z -c 1

resultará en ‘a\0c\0’

Examples

Imprime un rango específico de caracteres/campos de cada línea:

{{comando}} | cut --{{characters|field}} {{1|1,10|1-10|1-|-10}}

Imprime un rango de campos de cada línea con un [d]elimitador específico:

{{comando}} | cut --delimiter "{{,}}" --fields {{1}}

Imprime un rango de [c]aracteres de cada línea del archivo específico:

cut --characters {{1}} {{ruta/al/archivo}}

Imprime [c]ampos específicos de líneas terminadas en NUL (por ejemplo, como en find . -print0) en lugar de nuevas líneas:

{{comando}} | cut --zero-terminated --fields {{1}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
date [OPCIÓN]... [+FORMATO]...
date [OPCIÓN]... [MMDDhhmm[[CC]AA][.ss]]

FORMATO controla la salida. Las secuencias interpretadas son:
| Secuencia | Descripción                                                       | Ejemplo                |
| --------- | ----------------------------------------------------------------- | ---------------------- |
| %%        | un % literal                                                      | %                      |
| %a        | nombre abreviado del día de la semana según la configuración regional | dom                    |
| %A        | nombre completo del día de la semana según la configuración regional | domingo                |
| %b        | nombre abreviado del mes según la configuración regional         | ene                    |
| %B        | nombre completo del mes según la configuración regional          | enero                  |
| %c        | fecha y hora según la configuración regional                     | jue 3 mar 23:05:25 2005|
| %C        | siglo; como %Y, pero omite los dos últimos dígitos               | 20                     |
| %d        | día del mes                                                       | 01                     |
| %D        | fecha; igual que %m/%d/%y                                         | 12/31/99               |
| %e        | día del mes, rellenado con espacios; igual que %_d               | 3                      |
| %F        | fecha completa; igual que %Y-%m-%d                                | 2005-03-03             |
| %g        | dos últimos dígitos del año del número de semana ISO (ver %G)    | 05                     |
| %G        | año del número de semana ISO (ver %V); normalmente útil solo con %V | 2005                   |
| %h        | igual que %b                                                      | ene                    |
| %H        | hora (00..23)                                                     | 23                     |
| %I        | hora (01..12)                                                     | 11                     |
| %j        | día del año (001..366)                                            | 062                    |
| %k        | hora, rellenada con espacios ( 0..23); igual que %_H             |  3                     |
| %l        | hora, rellenada con espacios ( 1..12); igual que %_I             |  9                     |
| %m        | mes (01..12)                                                      | 03                     |
| %M        | minuto (00..59)                                                   | 30                     |
| %n        | una nueva línea                                                   | \\n                     |
| %N        | nanosegundos (000000000..999999999)                               | 123456789              |
| %p        | equivalente regional de AM o PM; vacío si es desconocido         | PM                     |
| %P        | como %p, pero en minúsculas                                       | pm                     |
| %q        | trimestre del año (1..4)                                          | 1                      |
| %r        | hora en formato de 12 horas según la configuración regional      | 11:11:04 PM            |
| %R        | hora de 24 horas y minuto; igual que %H:%M                       | 23:30                  |
| %s        | segundos desde 1970-01-01 00:00:00 UTC                           | 1615432800             |
| %S        | segundo (00..60)                                                  | 30                     |
| %t        | una tabulación                                                    | \\t                     |
| %T        | hora; igual que %H:%M:%S                                          | 23:30:30               |
| %u        | día de la semana (1..7); 1 es lunes                              | 4                      |
| %U        | número de semana del año, con domingo como primer día de la semana (00..53) | 10                     |
| %V        | número de semana ISO, con lunes como primer día de la semana (01..53) | 12                     |
| %w        | día de la semana (0..6); 0 es domingo                            | 4                      |
| %W        | número de semana del año, con lunes como primer día de la semana (00..53) | 11                     |
| %x        | representación de fecha según la configuración regional          | 03/03/2005             |
| %X        | representación de hora según la configuración regional           | 23:30:30               |
| %y        | dos últimos dígitos del año (00..99)                             | 05                     |
| %Y        | año                                                               | 2005                   |
| %z        | zona horaria numérica +hhmm                                       | -0400                  |
| %:z       | zona horaria numérica +hh:mm                                      | -04:00                 |
| %::z      | zona horaria numérica +hh:mm:ss                                   | -04:00:00              |
| %:::z     | zona horaria numérica con : hasta la precisión necesaria         | -04, +05:30            |
| %Z        | abreviatura alfabética de zona horaria                           | EDT                    |

Por defecto, date rellena los campos numéricos con ceros.
Las siguientes banderas opcionales pueden seguir a '%':
* `-` (guión) no rellenar el campo
* `_` (guión bajo) rellenar con espacios
* `0` (cero) rellenar con ceros
* `^` usar mayúsculas si es posible
* `#` usar el caso opuesto si es posible
Después de cualquier bandera viene un ancho de campo opcional, como número decimal;
luego un modificador opcional, que es
* `E` para usar las representaciones alternativas de la configuración regional si están disponibles, o
* `O` para usar los símbolos numéricos alternativos de la configuración regional si están disponibles.
Ejemplos:
  Convertir segundos desde la época (1970-01-01 UTC) a una fecha

  date --date='@2147483647'

  Mostrar la hora en la costa oeste de EE.UU. (usar tzselect(1) para encontrar TZ)

  TZ='America/Los_Angeles' date

Mostrar o establecer la fecha y hora del sistema

Options

--date=<STRING>, -d <STRING>

mostrar la hora descrita por CADENA, no ‘ahora’

--file=<DATEFILE>, -f <DATEFILE>

como –date; una vez por cada línea de ARCHIVOFECHA

--iso-8601=<FMT>, -I <FMT>

mostrar fecha/hora en formato ISO 8601.
FMT=‘date’ solo para fecha (por defecto),
‘hours’, ‘minutes’, ‘seconds’, o ‘ns’
para fecha y hora con la precisión indicada.
Ejemplo: 2006-08-14T02:34:56-06:00

--resolution

salida de resolución de sellos horarios disponibles
Ejemplo: 0.000000001

--rfc-email, -R

mostrar fecha y hora en formato RFC 5322.
Ejemplo: Mon, 14 Aug 2006 02:34:56 -0600

--rfc-3339=<FMT>

mostrar fecha/hora en formato RFC 3339.
FMT=‘date’, ‘seconds’, o ‘ns’
para fecha y hora con la precisión indicada.
Ejemplo: 2006-08-14 02:34:56-06:00

--debug

anotar la fecha analizada y advertir sobre uso cuestionable en stderr

--reference=<FILE>, -r <FILE>

mostrar la hora de última modificación de ARCHIVO

--set=<STRING>, -s <STRING>

establecer la hora descrita por CADENA

--universal, --utc, -u

mostrar o establecer el Tiempo Universal Coordinado (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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
dd [OPERANDO]...
dd OPCIÓN

Copiar, y opcionalmente convertir, un recurso del sistema de archivos

Options

Operandos

  • bs=BYTES : leer y escribir hasta BYTES bytes a la vez (predeterminado: 512); sobrescribe ibs y obs.

  • cbs=BYTES : el ‘tamaño de bloque de conversión’ en bytes. Se aplica a las operaciones conv=block y conv=unblock.

  • conv=CONVS : una lista separada por comas de opciones de conversión o (por razones de compatibilidad) indicadores de archivo.

  • count=N : dejar de leer entrada tras N operaciones de lectura de tamaño ibs en lugar de continuar hasta EOF. Ver iflag=count_bytes si se prefiere detenerse tras N bytes

  • ibs=N : el tamaño del búfer usado para lecturas (predeterminado: 512)

  • if=ARCHIVO : el archivo usado para entrada. Cuando no se especifica, se usa stdin

  • iflag=INDICADORES : una lista separada por comas de indicadores de entrada que especifican cómo se trata la fuente de entrada. INDICADORES puede ser cualquiera de los indicadores de entrada o indicadores generales especificados abajo.

  • skip=N (o iseek=N) : omiten N registros de tamaño ibs en la entrada antes de comenzar las operaciones de copia/conversión. Consulte iflag=seek_bytes si se prefiere buscar N bytes.

  • obs=N : el tamaño del búfer usado para escrituras (predeterminado: 512)

  • of=ARCHIVO : el archivo usado para salida. Cuando no se especifica, se usa stdout

  • oflag=INDICADORES : lista separada por comas de indicadores de salida que especifican cómo se trata el origen de salida. INDICADORES puede ser cualquiera de los indicadores de salida o indicadores generales especificados abajo

  • seek=N (o oseek=N) : busca N registros de tamaño obs en la salida antes de comenzar las operaciones de copia/conversión. Consulte oflag=seek_bytes si se prefiere buscar N bytes

  • status=NIVEL : controla si las estadísticas de volumen y rendimiento se escriben en stderr.

    Cuando no se especifica, dd imprimirá estadísticas al completarse. Un ejemplo está abajo.

      6+0 records in
      16+0 records out
      8192 bytes (8.2 kB, 8.0 KiB) copied, 0.00057009 s,
      14.4 MB/s
    
    Las primeras dos líneas son las estadísticas de 'volumen' y la línea final
    son las estadísticas de 'rendimiento'.
    Las estadísticas de volumen indican el número de lecturas completas y
    parciales de tamaño ibs, o escrituras de tamaño obs que tuvieron lugar
    durante la copia. El formato de las estadísticas de volumen es
    <completas>+<parciales>. Si los registros han sido truncados (consulte
    conv=block), las estadísticas de volumen contendrán el número de registros
    truncados.
    
    Los valores posibles de NIVEL son:
    - progress : Declarar estadísticas de rendimiento periódicas conforme avanza la copia.
    - noxfer : Declarar estadísticas de volumen finales, pero no estadísticas de rendimiento.
    - none : No declarar estadísticas.
    
    La impresión de estadísticas de rendimiento también se activa con la señal INFO
    (donde sea soportada), o la señal USR1. Establecer la variable de entorno
    POSIXLY_CORRECT a cualquier valor (incluyendo un valor vacío) causará que la
    señal USR1 sea ignorada.
    
    

Opciones de Conversión

  • ascii : convertir de EBCDIC a ASCII. Esto es lo inverso de la opción ebcdic. Implica conv=unblock.

  • ebcdic : convertir de ASCII a EBCDIC. Esto es lo inverso de la opción ascii. Implica conv=block.

  • ibm : convertir de ASCII a EBCDIC, aplicando las convenciones para [, ] y ~ especificadas en POSIX. Implica conv=block.

  • ucase : convertir de minúsculas a mayúsculas.

  • lcase : convierte de mayúsculas a minúsculas.

  • block : para cada nueva línea menor que el tamaño indicado por cbs=BYTES, eliminar la línea nueva y rellenar con espacios hasta cbs. Las líneas más largas que cbs son truncadas.

  • unblock : para cada bloque de entrada del tamaño indicado por cbs=BYTES, eliminar los espacios finales derechos y reemplazar con un carácter de nueva línea.

  • sparse : intenta buscar en la salida cuando un bloque de tamaño obs consiste solo de ceros.

  • swab : intercambia cada par adyacente de bytes. Si hay un número impar de bytes, el byte final se omite.

  • sync : rellenar cada bloque de lado ibs con ceros. Si se especifica block o unblock, rellenar con espacios en su lugar.

  • excl : el archivo de salida debe ser creado. Fallar si el archivo de salida ya está presente.

  • nocreat : el archivo de salida no será creado. Fallar si el archivo de salida no está ya presente.

  • notrunc : el archivo de salida no será truncado. Si esta opción no está presente, la salida será truncada cuando se abra.

  • noerror : todos los errores de lectura serán ignorados. Si esta opción no está presente, dd solo ignorará Error::Interrupted.

  • fdatasync : los datos se escribirán antes de terminar.

  • fsync : los datos y metadatos se escribirán antes de terminar.

Indicadores de entrada

  • count_bytes : un valor para count=N será interpretado como bytes.
  • skip_bytes : un valor para skip=N será interpretado como bytes.
  • fullblock : esperar ibs bytes de cada lectura. Las lecturas de longitud cero aún se consideran EOF.

Indicadores de salida

  • append : abrir archivo en modo de adición. Considere establecer conv=notrunc también.
  • seek_bytes : un valor para seek=N será interpretado como bytes.

Indicadores Generales

  • direct : usar E/S directa para datos.
  • directory : fallar a menos que la entrada dada (si se usa como iflag) o salida (si se usa como oflag) sea un directorio.
  • dsync : usar E/S sincronizada para datos.
  • sync : usar E/S sincronizada para datos y metadatos.
  • nonblock : usar E/S no bloqueante.
  • noatime : no actualizar el tiempo de acceso.
  • nocache : solicitar que el SO descarte la caché.
  • noctty : no asignar un tty controlador.
  • nofollow : no seguir enlaces del sistema.

Examples

Crea una unidad USB de arranque a partir de un archivo isohybrid (como archlinux-xxx.iso) y muestra el progreso:

sudo dd status=progress if={{ruta/al/archivo.iso}} of={{/dev/unidad_usb}}

Clona una unidad a otra con un tamaño de bloque de 4 MiB y descarga las escrituras antes de que el comando termine:

sudo dd bs=4M conv=fsync if={{/dev/unidad_de_origen}} of={{/dev/unidad_de_descarga}}

Genera un archivo con un número específico de bytes aleatorios utilizando el controlador aleatorio del kernel:

dd bs={{100}} count={{1}} if=/dev/urandom of={{ruta/al/archivo_aleatorio}}

Compara el rendimiento de escritura de un disco:

dd bs={{1M}} count={{1024}} if=/dev/zero of={{ruta/al/fichero_1GB}}

Crea una copia de seguridad del sistema en un archivo IMG (puede restaurarla más tarde intercambiando if y of), y muestra el progreso:

sudo dd status=progress if={{/dev/unidad_dispositivo}} of={{ruta/al/archivo.img}}

Comprueba el progreso de una operación dd en curso (ejecute este comando desde otro intérprete de comandos):

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
df [OPCIÓN]... [ARCHIVO]...

Mostrar información sobre el sistema de archivos en el que reside cada ARCHIVO, o todos los sistemas de archivos por defecto.

Options

--help

Mostrar información de ayuda.

--all, -a

incluir sistemas de archivos ficticios

--block-size=<SIZE>, -B <SIZE>

escalar tamaños por TAMAÑO antes de mostrarlos; ej. ‘-BM’ muestra tamaños en unidades de 1,048,576 bytes

--total

producir un gran total

--human-readable, -h

mostrar tamaños en formato legible por humanos (ej., 1K 234M 2G)

--si, -H

igualmente, pero usar potencias de 1000 no 1024

--inodes, -i

listar información de inodo en lugar de uso de bloque

-k

como –block-size=1K

-m

like –block-size=1M

--local, -l

limitar listado a sistemas de archivos locales

--no-sync

no invocar sync antes de obtener información de uso (por defecto)

--output=<FIELD_LIST>

usar formato de salida definido por LISTA_CAMPO, o mostrar todos los campos si LISTA_CAMPO se omite.

--portability, -P

usar el formato de salida POSIX

--sync

invocar sync antes de obtener información de uso (solo no-windows)

--type=<TYPE>, -t <TYPE>

limitar listado a sistemas de archivos de tipo TIPO

--print-type, -T

mostrar tipo de sistema de archivos

--exclude-type=<TYPE>, -x <TYPE>

limitar listado a sistemas de archivos no de tipo TIPO

Los valores mostrados están en unidades del primer TAMAÑO disponible de –block-size, y las variables de entorno DF_BLOCK_SIZE, BLOCK_SIZE y BLOCKSIZE. En otro caso, las unidades por defecto son 1024 bytes (o 512 si POSIXLY_CORRECT está establecido).

TAMAÑO es un entero y una unidad opcional (ejemplo: 10M es 1010241024). Las unidades son K, M, G, T, P, E, Z, Y (potencias de 1024) o KB, MB,… (potencias de 1000). Las unidades pueden estar en decimal, hexadecimal, octal o binario.

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

v0.13.0

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

Vea la documentación del comando original:

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

v0.13.0
dircolors [OPCIÓN]... [ARCHIVO]

Mostrar comandos para establecer la variable de entorno 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 se especifica ARCHIVO, leerlo para determinar qué colores usar para qué tipos de archivo y extensiones. De lo contrario, se usa una base de datos precompilada. Para detalles sobre el formato de estos archivos, ejecute ‘dircolors –print-database’

Examples

Comandos de salida para establecer $LS_COLOR usando los colores por defecto:

dircolors

Muestra cada tipo de fichero con el color con el que aparecerían en ls:

dircolors --print-ls-colors

Comandos de salida para establecer $LS_COLOR utilizando los colores de un archivo:

dircolors {{ruta/al/archivo}}

Comandos de salida para el intérprete de comandos Bourne:

dircolors {{[-b|--bourne-shell]}}

Comandos de salida para el intérprete de comandos C:

dircolors {{[-c|--c-shell]}}

Visualiza los colores predeterminados según los tipos de archivo y extensiones:

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

v0.13.0
dirname [OPCIÓN] NOMBRE...

Quitar el último componente del nombre de archivo

Options

--zero, -z

dirname-zero-help

Mostrar cada NOMBRE eliminando su último componente que no sea barra y las barras finales; si NOMBRE no contiene /, mostrar ‘.’ (indicando el directorio actual).

Examples

Calcula el directorio padre de una ruta dada:

dirname {{ruta/al/archivo_o_directorio}}

Calcula el directorio padre de múltiples rutas:

dirname {{ruta/al/archivo_o_directorio1 ruta/al/archivo_o_directorio2 ...}}

Delimita la salida con un carácter NUL en lugar de una nueva línea (útil cuando se combina con xargs):

dirname {{[-z|--zero]}} {{ruta/al/archivo_o_directorio1 ruta/al/archivo_o_directorio2 ...}}

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

v0.13.0
du [OPCIÓN]... [ARCHIVO]...
du [OPCIÓN]... --files0-from=F

Estimar uso de espacio de archivos

Options

--help

Mostrar información de ayuda.

--all, -a

escribir conteos para todos los archivos, no solo directorios

--apparent-size, -A

mostrar tamaños aparentes, en lugar de uso de disco aunque el tamaño aparente es usualmente menor, puede ser mayor debido a agujeros en archivos (‘dispersos’), fragmentación interna, bloques indirectos, y similares

--block-size=<SIZE>, -B <SIZE>

escalar tamaños por TAMAÑO antes de mostrarlos. Ej., ‘-BM’ muestra tamaños en unidades de 1,048,576 bytes. Ver formato TAMAÑO abajo.

--bytes, -b

equivalente a ‘–apparent-size –block-size=1’

--total, -c

producir un gran total

--max-depth=<N>, -d <N>

mostrar el total para un directorio (o archivo, con –all) solo si está N o menos niveles debajo del argumento de línea de comandos; –max-depth=0 es lo mismo que –summarize

--human-readable, -h

mostrar tamaños en formato legible por humanos (ej., 1K 234M 2G)

--inodes

listar información de uso de inodo en lugar de uso de bloque como –block-size=1K

-k

como –block-size=1K

--count-links, -l

contar tamaños muchas veces si están enlazados duros

--dereference, -L

seguir todos los enlaces simbólicos

--dereference-args, -D, -H

seguir solo enlaces simbólicos que están listados en la línea de comandos

--no-dereference, -P

no seguir ningún enlace simbólico (esto es por defecto)

-m

como –block-size=1M

--null, -0

terminar cada línea de salida con byte 0 en lugar de nueva línea

--separate-dirs, -S

no incluir tamaño de subdirectorios

--summarize, -s

mostrar solo un total para cada argumento

--si

como -h, pero usar potencias de 1000 no 1024

--one-file-system, -x

omitir directorios en diferentes sistemas de archivos

--threshold=<SIZE>, -t <SIZE>

excluir entradas menores que TAMAÑO si es positivo, o entradas mayores que TAMAÑO si es negativo

--verbose, -v

modo detallado (opción no presente en GNU/Coreutils)

--exclude=<PATTERN>

excluir archivos que coinciden con PATRÓN

--exclude-from=<FILE>, -X <FILE>

excluir archivos que coinciden con cualquier patrón en ARCHIVO

--files0-from=<FILE>

resumir uso de dispositivo de los nombres de archivo terminados en NUL especificados en archivo F; si F es -, entonces leer nombres de entrada estándar

--time=<WORD>

mostrar tiempo de la última modificación de cualquier archivo en el directorio, o cualquiera de sus subdirectorios. Si se da PALABRA, mostrar tiempo como PALABRA en lugar de tiempo de modificación: atime, access, use, ctime, status, birth o creation

--time-style=<STYLE>

mostrar tiempos usando estilo ESTILO: full-iso, long-iso, iso, +FORMATO FORMATO se interpreta como ‘date’

Los valores mostrados están en unidades del primer TAMAÑO disponible de –block-size, y las variables de entorno DU_BLOCK_SIZE, BLOCK_SIZE y BLOCKSIZE. De otra manera, las unidades por defecto son 1024 bytes (o 512 si POSIXLY_CORRECT está establecido).

TAMAÑO es un entero y unidad opcional (ejemplo: 10M es 1010241024). Las unidades son K, M, G, T, P, E, Z, Y (potencias de 1024) o KB, MB,… (potencias de 1000).

PATRÓN permite algunas exclusiones avanzadas. Por ejemplo, las siguientes sintaxis están soportadas: ? coincidirá solo con un carácter

  • coincidirá con cero o más caracteres {a,b} coincidirá con a o b

Examples

Lista los tamaños de un directorio y sus subdirectorios, en la unidad dada (B/KiB/MiB):

du -{{b|k|m}} {{ruta/al/directorio}}

Lista los tamaños de un directorio y sus subdirectorios, de forma legible (es decir, seleccionando automáticamente la unidad adecuada para cada tamaño):

du {{[-h|--human-readable]}} {{ruta/al/directorio}}

Muestra el tamaño de un único directorio, en unidades legibles:

du {{[-sh|--summarize --human-readable]}} {{ruta/al/directorio}}

Lista los tamaños legibles de un directorio y de todos los archivos y directorios que contiene:

du -ah {{ruta/al/directorio}}

Lista los tamaños legibles de un directorio y sus subdirectorios, hasta N niveles de profundidad:

du {{[-h|--human-readable]}} --max-depth=N {{ruta/al/directorio}}

Lista el tamaño legible de todos los archivos .jpg en los subdirectorios del directorio actual y muestra un total acumulado al final:

du {{[-ch|--total --human-readable]}} {{*/*.jpg}}

Lista todos los archivos y directorios (incluidos los ocultos) por encima de un determinado tamaño (útil para investigar qué está ocupando realmente el espacio):

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

v0.13.0
echo [OPCIONES]... [CADENA]...

Mostrar una línea de texto

Options

-n

do not output the trailing newline

-e

enable interpretation of backslash escapes

-E

disable interpretation of backslash escapes (default)

Mostrar la(s) CADENA(s) en salida estándar.

Si -e está activo, se reconocen las siguientes secuencias:

  • \ barra invertida
  • \a alerta (BEL)
  • \b retroceso
  • \c no producir más salida
  • \e escape
  • \f avance de página
  • \n nueva línea
  • \r retorno de carro
  • \t tabulación horizontal
  • \v tabulación vertical
  • \0NNN byte con valor octal NNN (1 a 3 dígitos)
  • \xHH byte con valor hexadecimal HH (1 a 2 dígitos)

Examples

Imprime un mensaje de texto. Nota: las comillas son opcionales:

echo "{{Hola Mundo}}"

Imprime un mensaje con variables de ambiente:

echo "{{Mi ruta es $PATH}}"

Imprime un mensaje sin la nueva línea:

echo -n "{{Hola Mundo}}"

Añade un mensaje al final del archivo:

echo "{{Hola Mundo}}" >>{{archivo.txt}}

Habilita la interpretación de escapes de backslash (caracteres especiales):

echo -e "{{Column 1\tColumn 2}}"

Imprime el estado de salida del último comando ejecutado (Nota: En Windows Command Prompt y PowerShell los equivalentes son echo %errorlevel% y $lastexitcode respectivamente):

echo $?

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
env [OPCIÓN]... [-] [NOMBRE=VALOR]... [COMANDO [ARG]...]

Establecer cada NOMBRE a VALOR en el entorno y ejecutar COMANDO

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 command is 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 - implica -i. Si no hay COMANDO, mostrar el entorno resultante.

Examples

Muestra el entorno:

env

Ejecuta un programa. A menudo se utiliza en scripts después del shebang (#!) para buscar la ruta al programa:

env {{program}}

Limpia el entorno y ejecuta un programa:

env {{[-i|--ignore-environment]}} {{program}}

Elimina variable del entorno y ejecuta un programa:

env {{[-u|--unset]}} {{variable}} {{program}}

Establece una variable y ejecuta un programa:

env {{variable}}={{value}} {{program}}

Establece una o más variables y ejecuta un programa:

env {{variable1=value variable2=value variable3=value ...}} {{program}}

Ejecuta un programa con un nombre diferente:

env {{[-a|--argv0]}} {{custom_name}} {{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.

expand

v0.13.0
expand [OPCIÓN]... [ARCHIVO]...

Convertir tabulaciones en cada ARCHIVO a espacios, escribiendo a la salida estándar. Sin ARCHIVO, o cuando ARCHIVO es -, leer la entrada estándar.

Options

--initial, -i

no convertir tabulaciones después de caracteres que no sean espacios en blanco

--tabs=<N, LIST>, -t <N, LIST>

tener tabulaciones separadas por N caracteres, no 8, o usar lista separada por comas de posiciones de tabulación explícitas

--no-utf8, -U

interpretar archivo de entrada como ASCII de 8-bit en lugar de 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

v0.13.0
expr [EXPRESIÓN]
expr [OPCIONES]

Imprimir el valor de EXPRESIÓN en la salida estándar

Options

--version

output version information and exit

--help

display this help and exit

Imprimir el valor de EXPRESIÓN en la salida estándar. Una línea en blanco abajo separa grupos de precedencia creciente.

EXPRESIÓN puede ser:

  • ARG1 | ARG2: ARG1 si no es nulo ni 0, de lo contrario ARG2
  • ARG1 & ARG2: ARG1 si ningún argumento es nulo o 0, de lo contrario 0
  • ARG1 < ARG2: ARG1 es menor que ARG2
  • ARG1 <= ARG2: ARG1 es menor o igual que ARG2
  • ARG1 = ARG2: ARG1 es igual a ARG2
  • ARG1 != ARG2: ARG1 es distinto de ARG2
  • ARG1 >= ARG2: ARG1 es mayor o igual que ARG2
  • ARG1 > ARG2: ARG1 es mayor que ARG2
  • ARG1 + ARG2: suma aritmética de ARG1 y ARG2
  • ARG1 - ARG2: diferencia aritmética de ARG1 y ARG2
  • ARG1 * ARG2: producto aritmético de ARG1 y ARG2
  • ARG1 / ARG2: cociente aritmético de ARG1 dividido por ARG2
  • ARG1 % ARG2: resto aritmético de ARG1 dividido por ARG2
  • CADENA : REGEXP: coincidencia de patrón anclado de REGEXP en CADENA
  • match CADENA REGEXP: igual que CADENA : REGEXP
  • substr CADENA POS LONGITUD: subcadena de CADENA, POS contado desde 1
  • index CADENA CARACTERES: índice en CADENA donde se encuentra cualquier CARACTERES, o 0
  • length CADENA: longitud de CADENA
    • TOKEN: interpretar TOKEN como una cadena, incluso si es una palabra clave como match o un operador como /
  • ( EXPRESIÓN ): valor de EXPRESIÓN

Tenga cuidado que muchos operadores necesitan ser escapados o entrecomillados para los shells. Las comparaciones son aritméticas si ambos ARGs son números, de lo contrario lexicográficas. Las coincidencias de patrón devuelven la cadena coincidente entre ( y ) o nulo; si ( y ) no se usan, devuelven el número de caracteres coincidentes o 0.

El estado de salida es 0 si EXPRESIÓN no es nula ni 0, 1 si EXPRESIÓN es nula o 0, 2 si EXPRESIÓN es sintácticamente inválida, y 3 si ocurrió un error.

Variables de entorno:

  • EXPR_DEBUG_TOKENS=1: volcar tokens de la expresión
  • EXPR_DEBUG_RPN=1: volcar expresión representada en notación polaca inversa
  • EXPR_DEBUG_SYA_STEP=1: volcar cada paso del analizador
  • EXPR_DEBUG_AST=1: volcar expresión representada como árbol de sintaxis abstracta

Examples

Obtiene la longitud de una cadena específica:

expr length "{{cadena}}"

Obtiene la subcadena de una cadena con una longitud específica:

expr substr "{{cadena}}" {{desde}} {{longitud}}

Empareja una subcadena específica frente a un patrón:

expr match "{{cadena}}" '{{patrón}}'

Obtiene la primera posición de un caracter de un conjunto específico en una cadena:

expr index "{{cadena}}" "{{caracteres}}"

Calcula una expresión matemática específica:

expr {{expresión1}} {{+|-|*|/|%}} {{expresión2}}

Obtiene la primera expresión si su valor no es cero y no nulo, de otro modo, obtiene el segundo:

expr {{expresión1}} \| {{expresión2}}

Obtiene la primera expresión si ambas expresiones no son cero y no nulas de otro modo obtiene cero:

expr {{expresión1}} \& {{expresión2}}

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

v0.13.0
factor [OPCIÓN]... [NÚMERO]...

Imprimir los factores primos de los NÚMERO(s) dados. Si no se especifica ninguno, leer de la entrada estándar.

Options

--exponents, -h

Imprimir factores en la forma p^e

--help

Imprimir información de ayuda.

Examples

Muestra la factorización primaria de un número:

factor {{número}}

Toma la entrada de stdin si no se especifica ningún argumento:

echo {{número}} | 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

v0.13.0
Devuelve falso, un estado de salida sin éxito.

Inmediatamente devuelve el estado de salida 1. Cuando se invoca con una de las opciones reconocidas, intentará escribir el texto de ayuda o versión. Cualquier error de E/S durante esta operación es diagnosticado, sin embargo el programa también devolverá 1.

Options

--help

Print help information

--version

Print version information

Examples

Devuelve un código de salida distinto de cero:

false

Hace que un comando siempre salga con 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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
[OPCIÓN]... [ARCHIVO]...

Reformatear párrafos de entrada (o entrada estándar) a stdout.

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

Reformatea un archivo:

fmt {{ruta/al/archivo}}

Reformatea un archivo produciendo líneas de salida de (como máximo) n caracteres:

fmt {{[-w|--width]}} {{n}} {{ruta/al/archivo}}

Reformatea un archivo sin unir las líneas más cortas respecto al ancho dado:

fmt {{[-s|--split-only]}} {{ruta/al/archivo}}

Reformatea un archivo con espaciado uniforme (1 espacio entre palabras y 2 espacios entre párrafos):

fmt {{[-u|--uniform-spacing]}} {{ruta/al/archivo}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
fold [OPCIÓN]... [ARCHIVO]...

Escribe cada archivo (o entrada estándar si no se proporcionan archivos) a la salida estándar mientras corta líneas largas

Options

--bytes, -b

fold-bytes-help

--characters, -c

fold-characters-help

--spaces, -s

fold-spaces-help

--width=<WIDTH>, -w <WIDTH>

fold-width-help

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
groups [OPCIÓN]... [NOMBREUSUARIO]...

Mostrar membresías de grupo para cada NOMBREUSUARIO o, si no se especifica NOMBREUSUARIO, para el proceso actual (que puede diferir si la base de datos de grupos ha cambiado).

Options

Examples

Muestra los grupos a los que pertenece el usuario actual:

groups

Imprime la pertenencia a grupos de una lista de usuarios:

groups {{nombredeusuario1 nombredeusuario2 ...}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
head [OPCIÓN]... [ARCHIVO]...

Mostrar las primeras 10 líneas de cada ARCHIVO a salida estándar. Con más de un ARCHIVO, preceder cada uno con un encabezado que muestre el nombre del archivo. Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

Los argumentos obligatorios para las opciones largas también son obligatorios para las opciones cortas.

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

Muestra las primeras líneas de un archivo:

head {{[-n|--lines]}} {{cuenta}} {{ruta/al/archivo}}

Muestra los primeros bits de un archivo:

head {{[-c|--bytes]}} {{cuenta}} {{ruta/al/archivo}}

Muestra todo el contenido de un archivo excepto las últimas líneas:

head {{[-n|--lines]}} -{{cuenta}} {{ruta/al/archivo}}

Muestra todo el contenido de un archivo excepto los últimos bits:

head {{[-c|--bytes]}} -{{cuenta}} {{ruta/al/archivo}}

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

v0.13.0
hostid [opciones]

Imprimir el identificador numérico (en hexadecimal) para el host actual

Options

Examples

Muestra el identificador numérico del host actual en formato 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

v0.13.0
hostname [OPCIÓN]... [NOMBRE_HOST]

Mostrar o establecer el nombre del host del sistema.

Options

--domain, -d

Mostrar el nombre del dominio DNS si es posible

--ip-address, -i

Mostrar la(s) dirección(es) de red del host

--fqdn, -f

Mostrar el FQDN (Nombre de Dominio Completamente Calificado) (predeterminado)

--short, -s

Mostrar el nombre de host corto (la porción antes del primer punto) si es posible

Examples

Muestra el nombre actual del host:

hostname

Muestra la dirección de red correspondiente al nombre del host:

hostname {{[-i|--ip-address]}}

Muestra el FQDN (nombre de dominio completamente calificado):

hostname {{[-f|--fqdn]}}

Establece el nombre del host:

hostname {{nuevo_nombre}}

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

v0.13.0
id [OPCIÓN]... [USUARIO]...

Mostrar información de usuario y grupo para cada USUARIO especificado, o (cuando se omite USUARIO) para el usuario actual.

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

La utilidad id muestra los nombres de usuario y grupo e IDs numéricos, del proceso que llama, a la salida estándar. Si los IDs reales y efectivos son diferentes, ambos se muestran, de otra manera solo se muestra el ID real.

Si se especifica un usuario (nombre de login o ID de usuario), se muestran los IDs de usuario y grupo de ese usuario. En este caso, se asume que los IDs reales y efectivos son los mismos.

Examples

Muestra la ID del usuario actual (UID), la ID del grupo (GID) y los grupos a los que pertenece:

id

Muestra la identidad del usuario actual:

id {{[-un|--user --name]}}

Muestra la identidad del usuario actual como un número:

id {{[-u|--user]}}

Muestra la identidad del grupo primario actual:

id {{[-gn|--group --name]}}

Muestra la identidad del grupo primario actual como un número:

id {{[-g|--group]}}

Muestra el ID (UID) de un usuario arbitrario, el ID de grupo (GID) y los grupos a los que pertenece:

id {{usuario}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
install [OPCIÓN]... [ARCHIVO]...

Copiar FUENTE a DEST o múltiples FUENTE(s) al DIRECTORIO existente, mientras se establecen los modos de permisos y propietario/grupo

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

Copia archivos al destino:

install {{ruta/al/archivo_fuente1 ruta/al/archivo_fuente2 ...}} {{ruta/al/destino}}

Copia archivos al destino, estableciendo su propiedad:

install {{[-o|--owner]}} {{usuario}} {{ruta/al/archivo_de_origen1 ruta/al/archivo_de_origen2 ...}} {{ruta/al/destino}}

Copia archivos al destino, estableciendo su propiedad de grupo:

install {{[-g|--group]}} {{usuario}} {{ruta/al/archivo_de_origen1 ruta/al/archivo_de_origen2 ...}} {{ruta/al/destino}}

Copia archivos al destino, estableciendo su modo:

install {{[-m|--mode]}} {{+x}} {{ruta/al/archivo_de_origen1 ruta/al/archivo_de_origen2 ...}} {{ruta/al/destino}}

Copia archivos y aplica las fechas y horas de acceso y modificación de los archivos de origen a los de destino:

install {{[-p|--preserve-timestamps]}} {{ruta/al/archivo_de_origen1 ruta/al/archivo_de_origen2 ...}} {{ruta/al/destino}}

Copia archivos y crea los directorios en el destino si no existen:

install -D {{ruta/al/archivo_de_origen1 ruta/al/archivo_de_origen2 ...}} {{ruta/al/destino}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
join [OPCIÓN]... ARCHIVO1 ARCHIVO2

Para cada par de líneas de entrada con campos de unión idénticos, escribir una línea a la salida estándar. El campo de unión predeterminado es el primero, delimitado por espacios en blanco.

Cuando FILE1 o FILE2 (no ambos) es -, leer entrada estándar.

Options

-a <FILENUM>

también imprimir líneas no emparejables del archivo NUMARCHIVO, donde
NUMARCHIVO es 1 o 2, correspondiente a ARCHIVO1 o ARCHIVO2

-v <FILENUM>

como -a NUMARCHIVO, pero suprimir líneas de salida unidas

-e <EMPTY>

reemplazar campos de entrada faltantes con VACÍO

--ignore-case, -i

ignorar diferencias de mayúsculas/minúsculas al comparar campos

--numeric-sort, -n

compare join fields by numerical value, as ‘sort -n’ does

-j <FIELD>

equivalente a ‘-1 CAMPO -2 CAMPO’

-o <FORMAT>

obedecer FORMATO mientras se construye la línea de salida

-t <CHAR>

usar CARÁCTER como separador de campo de entrada y salida

-1 <FIELD>

unir en este CAMPO del archivo 1

-2 <FIELD>

unir en este CAMPO del archivo 2

--check-order

verificar que la entrada esté correctamente ordenada, incluso si todas las líneas de entrada son emparejables

--nocheck-order

no verificar que la entrada esté correctamente ordenada

--header

tratar la primera línea en cada archivo como cabeceras de campo, imprimirlas sin intentar emparejarlas

--zero-terminated, -z

el delimitador de línea es NUL, no nueva línea

Examples

Une dos archivos en el primer campo (por defecto):

join {{ruta/al/archivo1}} {{ruta/al/archivo2}}

Une dos archivos utilizando una coma (en lugar de un espacio) como separador de campos:

join -t ',' {{ruta/al/archivo1}} {{ruta/al/archivo2}}

Une el campo3 del archivo1 con el campo1 del archivo2:

join -1 {{3}} -2 {{1}} {{ruta/al/archivo1}} {{ruta/al/archivo2}}

Produce una línea por cada línea no emparejable del fichero1:

join -a {{1}} {{ruta/al/archivo1}} {{ruta/al/archivo2}}

Une un fichero desde stdin:

cat {{ruta/al/archivo1}} | join - {{ruta/al/archivo2}}

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

v0.13.0
kill [OPCIONES]... PID...

Enviar señal a procesos o listar información sobre señales.

Options

--list, -l

Lists signals

--table, -t

Lists table of signals

--signal=<signal>, -s <signal>

Sends given signal instead of SIGTERM

Examples

Termina un programa usando la señal SIGTERM (terminar) predeterminada:

kill {{identificador_del_proceso}}

Lista todas las señales disponibles (para utilizarlas sin el prefijo SIG):

kill -l

Termina un programa usando la señal SIGHUP (hang up/colgar). Muchos programas residentes (daemons) se recargarán en lugar de terminar:

kill {{[-1|-SIGHUP]}} {{identificador_del_proceso}}

Termina un programa usando la señal SIGINT (interrumpir). Esto es normalmente iniciado por el usuario al presionar <Ctrl c>:

kill {{[-2|-SIGINT]}} {{identificador_del_proceso}}

Señala al sistema operativo terminar inmediatamente un programa (el cual no tiene oportunidad de capturar la señal):

kill {{[-9|-SIGKILL]}} {{identificador_del_proceso}}

Señala al sistema operativo pausar un programa hasta que la señal SIGCONT (continuar) sea recibida:

kill {{[-STOP|-SIGSTOP]}} {{identificador_del_proceso}}

Envía una señal SIGUSR1 a todos los procesos con un GID (id de grupo) dado:

kill {{[-USR1|-SIGUSR1]}} -{{identificador_de_grupo}}

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

v0.13.0
link ARCHIVO1 ARCHIVO2

Llamar la función link para crear un enlace llamado ARCHIVO2 a un ARCHIVO1 existente.

Options

Examples

Crea un enlace duro de un archivo nuevo a un archivo existente:

link {{ruta/al/archivo_existente}} {{ruta/al/archivo_nuevo}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
ln [OPCIÓN]... [-T] DESTINO NOMBRE_ENLACE
ln [OPCIÓN]... DESTINO
ln [OPCIÓN]... DESTINO... DIRECTORIO
ln [OPCIÓN]... -t DIRECTORIO DESTINO...

Crear enlaces entre archivos.

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

En la 1a forma, crear un enlace a DESTINO con el nombre NOMBRE_ENLACE. En la 2a forma, crear un enlace a DESTINO en el directorio actual. En las 3a y 4a formas, crear enlaces a cada DESTINO en DIRECTORIO. Crear enlaces duros por defecto, enlaces simbólicos con –symbolic. Por defecto, cada destino (nombre del nuevo enlace) no debería existir ya. Al crear enlaces duros, cada DESTINO debe existir. Los enlaces simbólicos pueden contener texto arbitrario; si se resuelve posteriormente, un enlace relativo se interpreta en relación a su directorio padre.

Examples

Crea un enlace simbólico a un archivo o directorio:

ln {{[-s|--symbolic]}} {{/ruta/al/archivo_o_directorio}} {{ruta/al/enlace_simbólico}}

Sobrescribe un enlace simbólico existente para que apunte a un archivo distinto:

ln {{[-sf|--symbolic --force]}} {{/ruta/al/nuevo_archivo}} {{ruta/al/enlace_simbólico}}

Crea un enlace duro a un archivo:

ln {{/ruta/al/archivo}} {{ruta/al/enlace_duro}}

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

v0.13.0
logname

Imprimir el nombre de inicio de sesión del usuario

Options

Examples

Muestra el nombre del usuario que ha iniciado sesión actualmente:

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
ls [OPCIÓN]... [ARCHIVO]...

Listar contenido de directorios. Ignorar archivos y directorios que empiecen por ‘.’ de forma predeterminada

Options

--help

Mostrar información de ayuda.

--format

Establecer el formato de visualización.

-C

Mostrar los archivos en columnas.

--long, -l

Mostrar información detallada.

-x

Listar entradas en filas en lugar de columnas.

--tabsize=<COLS>, -T <COLS>

Asumir paradas de tabulación en cada COLS en lugar de 8

-m

Listar entradas separadas por comas.

--zero

Listar entradas separadas por caracteres NUL ASCII.

--dired, -D

generar salida diseñada para el modo dired (Directory Editor) de Emacs

--hyperlink=<WHEN>

crear hiperenlaces en nombres de archivo CUANDO

-1

Listar un archivo por línea.

-o

Formato largo sin información de grupo.
Idéntico a –format=long con –no-group.

-g

Formato largo sin información de propietario.

--numeric-uid-gid, -n

-l con UIDs y GIDs numéricos.

--quoting-style

Set quoting style

--literal, -N

Usar estilo de comillas literal. Equivalente a --quoting-style=literal

--escape, -b

Usar estilo de comillas de escape. Equivalente a --quoting-style=escape

--quote-name, -Q

Usar estilo de comillas C. Equivalente a --quoting-style=c

--hide-control-chars, -q

Reemplazar caracteres de control con ‘?’ si no están escapados.

--show-control-chars

Mostrar caracteres de control ‘tal como están’ si no están escapados.

--time=<field>

Mostrar tiempo en <campo>:
tiempo de acceso (-u): atime, access, use;
tiempo de cambio (-t): ctime, status.
tiempo de modificación: mtime, modification.
tiempo de creación: birth, creation;

-c

Si se está usando el formato de listado largo (p. ej., -l, -o), mostrar el
tiempo de cambio de estado (el ‘ctime’ en el inode) en lugar del tiempo de
modificación. Cuando se ordene explícitamente por tiempo (–sort=time o -t) o cuando
no se use un formato de listado largo, ordenar según el tiempo de cambio de estado.

-u

Si se está usando el formato de listado largo (p. ej., -l, -o), mostrar el
tiempo de acceso de estado en lugar del tiempo de modificación. Cuando se ordene
explícitamente por tiempo (–sort=time o -t) o cuando no se use un formato de
listado largo, ordenar según el tiempo de acceso.

--hide=<PATTERN>

no listar entradas implícitas que coincidan con el PATRÓN shell (anulado por -a o -A)

--ignore=<PATTERN>, -I <PATTERN>

no listar entradas implícitas que coincidan con el PATRÓN shell

--ignore-backups, -B

Ignorar entradas que terminen con ~.

--sort=<field>

Ordenar por <campo>: name, none (-U), time (-t), size (-S), extension (-X) o width

-S

Ordenar por tamaño de archivo, el más grande primero.

-t

Ordenar por tiempo de modificación (el ‘mtime’ en el inode), el más nuevo primero.

-v

Ordenación natural de números (de versión) en los nombres de archivo.

-X

Ordenar alfabéticamente por extensión de entrada.

-U

No ordenar; listar los archivos en cualquier orden en que estén almacenados en el
directorio. Esto es especialmente útil al listar directorios muy grandes,
ya que no ordenar puede ser notablemente más rápido.

--dereference, -L

Al mostrar información de archivo para un enlace simbólico, mostrar información para el
archivo al que se refiere el enlace en lugar del enlace mismo.

--dereference-command-line-symlink-to-dir

No seguir enlaces simbólicos excepto cuando enlacen a directorios y sean
dados como argumentos de línea de comandos.

--dereference-command-line, -H

No seguir enlaces simbólicos excepto cuando sean dados como argumentos de línea de comandos.

--no-group, -G

No mostrar grupo en formato largo.

--author

Mostrar autor en formato largo. En las plataformas soportadas,
el autor siempre coincide con el propietario del archivo.

--all, -a

No ignorar archivos ocultos (archivos con nombres que empiecen por ‘.’).

--almost-all, -A

En un directorio, no ignorar todos los nombres de archivo que empiecen por ‘.’,
solo ignorar ‘.’ y ‘..’.

-f

Listado de todos los archivos dentro del directorio ordenado, no ordenado. Equivalente a -aU. Inhabilita –color a no ser que se especifique explícitamente.

--directory, -d

Solo listar los nombres de directorios, en lugar de listar contenido de directorios.
Esto no seguirá enlaces simbólicos a menos que se especifique una de las opciones
--dereference-command-line (-H), --dereference (-L), o
--dereference-command-line-symlink-to-dir.

--human-readable, -h

Mostrar tamaños de archivo legibles por humanos (p. ej. 1K 234M 56G).

--kibibytes, -k

predeterminado a bloques de 1024 bytes para uso del sistema de archivos; usado solo con -s y por
totales de directorio

--si

Mostrar tamaños de archivo legibles por humanos usando potencias de 1000 en lugar de 1024.

--block-size=<BLOCK_SIZE>

escalar tamaños por BLOCK_SIZE al mostrarlos

--inode, -i

mostrar el número de índice de cada archivo

--reverse, -r

Invertir cualquier método de ordenación, p. ej., listar archivos en orden
alfabético inverso, el más joven primero, el más pequeño primero, o lo que sea.

--recursive, -R

Listar el contenido de todos los directorios recursivamente.

--width=<COLS>, -w <COLS>

Asumir que el terminal tiene COLS columnas de ancho.

--size, -s

mostrar el tamaño asignado de cada archivo, en bloques

--color

Colorear salida basada en tipo de archivo.

--indicator-style

Añadir indicador con estilo WORD a nombres de entrada:
none (predeterminado), slash (-p), file-type (–file-type), classify (-F)

--classify=<when>, -F <when>

Añadir un carácter a cada nombre de archivo indicando el tipo de archivo. También, para
archivos regulares que son ejecutables, añadir ‘*’. Los indicadores de tipo de archivo son
‘/’ para directorios, ‘@’ para enlaces simbólicos, ‘|’ para FIFOs, ‘=’ para sockets,
‘>’ para puertas, y nada para archivos regulares. when puede omitirse, o uno de:
none - No clasificar. Este es el predeterminado.
auto - Solo clasificar si salida estándar es un terminal.
always - Siempre clasificar.
Especificar –classify y ningún when es equivalente a –classify=always. Esto no
seguirá enlaces simbólicos listados en la línea de comandos a menos que se especifiquen
las opciones –dereference-command-line (-H), –dereference (-L), o
–dereference-command-line-symlink-to-dir.

--file-type

Igual que –classify, pero no añadir ‘*’

-p

Añadir indicador / a directorios.

--time-style=<TIME_STYLE>

formato de fecha/hora con -l; ver TIME_STYLE abajo

--full-time

como -l –time-style=full-iso

--context, -Z

mostrar cualquier contexto de seguridad de cada archivo

--group-directories-first

agrupar directorios antes que archivos; puede aumentarse con
una opción –sort, pero cualquier uso de –sort=none (-U) deshabilita la agrupación

El argumento TIME_STYLE puede ser full-iso, long-iso, iso, locale o +FORMATO. FORMATO se interpreta como en date. También la variable de entorno TIME_STYLE establece el estilo predeterminado a usar.

Examples

Lista un archivo por línea:

ls -1

Lista todos los archivos, incluyendo archivos ocultos:

ls {{[-a|--all]}}

Lista todos los archivos, añadiendo / al final de los nombres de directorios:

ls {{[-F|--classify]}}

Lista todos los archivos en formato largo (permisos, propietarios, tamaño y fecha de última modificación):

ls {{[-la|-l --all]}}

Lista en formato largo y tamaño legible por humanos (i.e., KiB, MiB, GiB, etc.):

ls {{[-lh|-l --human-readable]}}

Lista recursivamente en formato largo y ordena los tamaños de mayor a menor:

ls {{[-lSR|-lS --recursive]}}

Lista todos los archivos en formato largo y ordenados por fecha de modificación (archivos más viejos en primer lugar):

ls {{[-ltr|-lt --reverse]}}

Lista solamente directorios:

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

v0.13.0
md5sum [OPTIONS] [FILE]...

Print or check the MD5 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

Calcula la suma de comprobación MD5 de uno o más archivos:

md5sum {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Calcula y guarda la lista de sumas de comprobación MD5 en un archivo:

md5sum {{ruta/al/archivo1 ruta/al/archivo2 ...}} >{{ruta/al/archivo.md5}}

Calcula una suma de comprobación MD5 a partir de stdin:

{{comando}} | md5sum

Lee un archivo de sumas de comprobación MD5 y nombres de archivo y verifica que todos los archivos tengan sumas de comprobación coincidentes:

md5sum {{[-c|--check]}} {{ruta/al/archivo.md5}}

Muestra un mensaje solo para los archivos que faltan o cuando falla la verificación:

md5sum {{[-c|--check]}} --quiet {{ruta/al/archivo.md5}}

Muestra un mensaje solo cuando falla la verificación, ignorando los archivos que faltan:

md5sum --ignore-missing {{[-c|--check]}} --quiet {{ruta/al/archivo.md5}}

Comprueba la suma de comprobación MD5 conocida de un archivo:

echo {{suma_de_comprobación_md5_conocida_del_archivo}} {{ruta/al/archivo}} | 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

v0.13.0
mkdir [OPCIÓN]... DIRECTORIO...

Crear el/los DIRECTORIO(s) dado(s) si no existen

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

Cada MODO tiene la forma [ugoa]*(-+=)+|[-+=]?[0-7]+.

Examples

Crea los directorios especificados:

mkdir {{ruta/al/directorio1 ruta/al/directorio2 ...}}

Crea directorios recursivamente y sus padres si es necesario:

mkdir {{[-p|--parents]}} {{ruta/al/directorio}}

Crea directorios con permisos específicos:

mkdir {{[-m|--mode]}} {{u=rwx,g=rw,o=r}} {{ruta/al/directorio1 ruta/al/directorio2 ...}}

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

v0.13.0
mkfifo [OPCIÓN]... NOMBRE...

Crear un FIFO con el nombre dado.

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

Crea un pipe nombrado en una ruta específica:

mkfifo {{ruta/al/pipe}}

Envía datos a través de un pipe nombrado ejecutando el comando en segundo plano:

echo "{{Hola Mundo}}" >{{ruta/al/pipe}} &

Recibe datos a través de un pipe nombrado:

cat {{ruta/al/pipe}}

Comparte tu sesión de la terminal en tiempo real:

mkfifo {{ruta/al/pipe}}; script {{[-f|--flush]}} {{ruta/al/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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
mknod [OPCIÓN]... NOMBRE TIPO [MAYOR MENOR]

Crear el archivo especial NOMBRE del TIPO dado.

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

Los argumentos obligatorios para las opciones largas son obligatorios también para las opciones cortas. -m, –mode=MODO establecer los bits de permisos de archivo a MODO, no a=rw - umask

Tanto MAYOR como MENOR deben especificarse cuando TIPO es b, c, o u, y deben omitirse cuando TIPO es p. Si MAYOR o MENOR comienza con 0x o 0X, se interpreta como hexadecimal; de lo contrario, si comienza con 0, como octal; de lo contrario, como decimal. TIPO puede ser:

  • b crear un archivo especial de bloque (con búfer)
  • c, u crear un archivo especial de carácter (sin búfer)
  • p crear un FIFO

NOTA: su shell puede tener su propia versión de mknod, que generalmente reemplaza la versión descrita aquí. Por favor consulte la documentación de su shell para detalles sobre las opciones que soporta.

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
mktemp [OPCIÓN]... [PLANTILLA]

Crear un archivo o directorio temporal.

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
more [OPCIONES] ARCHIVO...

Mostrar el contenido de un archivo de texto

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

Abre un archivo:

more {{ruta/al/archivo}}

Abre un archivo y muestra su contenido desde una línea específica:

more +{{número_de_línea}} {{ruta/al/archivo}}

Avanza a la siguiente página:

<Espacio>

Busca una cadena de caracteres (presione <n> para ir a la siguiente coincidencia):

</>{{algo}}<Intro>

Sale del programa:

<q>

Muestra ayuda sobre comandos interactivos:

<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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
mv [OPCIÓN]... [-T] ORIGEN DESTINO
mv [OPCIÓN]... ORIGEN... DIRECTORIO
mv [OPCIÓN]... -t DIRECTORIO ORIGEN...

Mover ORIGEN a DESTINO, o múltiples ORIGEN(es) a DIRECTORIO.

Options

--force, -f

no avisar antes de sobreescribir

--interactive, -i

avisar antes de anular

--no-clobber, -n

no sobreescribir un archivo existente

--strip-trailing-slashes

eliminar cualquier barra final de cada argumento ORIGEN

--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>

mover todos los argumentos ORIGEN al DIRECTORIO

--no-target-directory, -T

tratar DESTINO como un archivo normal

--verbose, -v

explicar lo que se está haciendo

--progress, -g

Mostrar una barra de progreso.
Nota: esta característica no está soportada por GNU coreutils.

-Z

establecer contexto de seguridad SELinux del archivo destino al tipo predeterminado

--context=<CTX>

como -Z, o si CTX está especificado entonces establezca el contexto de seguridad SELinux a CTX

--debug

explicar cómo se copia un archivo. Implica -v

--exchange

intercambiar origen y destino (permutarlos atómicamente)

Al especificar más de una de -i, -f, -n, solo la final tendrá efecto.

No mover un no-directorio que tiene un destino existente con la misma o más nueva marca de tiempo de modificación; en su lugar, omitir silenciosamente el archivo sin fallar. Si el movimiento cruza límites de sistema de archivos, la comparación es con la marca de tiempo de origen truncada a las resoluciones del sistema de archivos de destino y de las llamadas del sistema usadas para actualizar marcas de tiempo; esto evita trabajo duplicado si varios comandos mv -u se ejecutan con el mismo origen y destino. Esta opción se ignora si también se especifica la opción -n o –no-clobber. lo cual da más control sobre qué archivos existentes en el destino son reemplazados, y su valor puede ser uno de los siguientes:

  • all Esta es la operación por defecto cuando no se especifica una opción –update, y resulta en que todos los archivos existentes en el destino sean reemplazados.
  • none Esto es similar a la opción –no-clobber, en que ningún archivo en el destino es reemplazado, pero también omitir un archivo no induce un fallo.
  • older Esta es la operación por defecto cuando se especifica –update, y resulta en que los archivos sean reemplazados si son más antiguos que el archivo origen correspondiente.

Examples

Cambia el nombre de un archivo o directorio cuando el destino no es un directorio existente:

mv {{ruta/a/origen}} {{ruta/a/destino}}

Mueve un archivo o directorio a un directorio existente:

mv {{ruta/a/origen}} {{ruta/al/directorio_existente}}

Mueve varios archivos a un directorio existente, manteniendo los nombres de archivo sin cambios:

mv {{ruta/a/origen1 ruta/a/origen2 ...}} {{ruta/al/directorio_existente}}

No pedir confirmación antes de sobrescribir los archivos existentes:

mv {{[-f|--force]}} {{ruta/a/origen}} {{ruta/a/destino}}

Pide confirmación interactivamente antes de sobrescribir archivos existentes, independientemente de los permisos de los archivos:

mv {{[-i|--interactive]}} {{ruta/a/origen}} {{ruta/a/destino}}

No sobrescribir los archivos existentes en el destino:

mv {{[-n|--no-clobber]}} {{ruta/a/origen}} {{ruta/a/destino}}

Mueve archivos en modo verboso, mostrando los archivos después de moverlos:

mv {{[-v|--verbose]}} {{ruta/a/origen}} {{ruta/a/destino}}

Especifica el directorio de destino para poder utilizar herramientas externas para recopilar archivos movibles:

{{find /var/log -type f -name '*.log' -print0}} | {{xargs -0}} mv {{[-t|--target-directory]}} {{ruta/al/directorio_destino}}

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

v0.13.0
nice [OPCIÓN] [COMANDO [ARG]...]

Ejecutar COMANDO con una prioridad ajustada, que afecta la programación de procesos. Sin COMANDO, imprimir la prioridad actual. Los valores de prioridad van desde -20 (más favorable al proceso) hasta 19 (menos favorable al proceso).

Options

--adjustment, -n

add N to the niceness (default is 10)

Examples

Inicia un programa con la prioridad modificada:

nice -{{valor_de_niceness}} {{comando}}

Defina la prioridad con una opción explícita:

nice {{[-n|--adjustment]}} {{-20..19}} {{comando}}

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

v0.13.0
nl [OPCIÓN]... [ARCHIVO]...

Numerar líneas de archivos

Options

--help

Imprimir información de ayuda.

--body-numbering=<STYLE>, -b <STYLE>

usar ESTILO para numerar líneas del cuerpo

--section-delimiter=<CC>, -d <CC>

usar CC para separar páginas lógicas

--footer-numbering=<STYLE>, -f <STYLE>

usar ESTILO para numerar líneas del pie

--header-numbering=<STYLE>, -h <STYLE>

usar ESTILO para numerar líneas del encabezado

--line-increment=<NUMBER>, -i <NUMBER>

incremento del número de línea en cada línea

--join-blank-lines=<NUMBER>, -l <NUMBER>

grupo de NÚMERO líneas vacías contadas como una

--number-format=<FORMAT>, -n <FORMAT>

insertar números de línea según FORMATO

--no-renumber, -p

no reiniciar números de línea en páginas lógicas

--number-separator=<STRING>, -s <STRING>

agregar CADENA después del número de línea (posible)

--starting-line-number=<NUMBER>, -v <NUMBER>

primer número de línea en cada página lógica

--number-width=<NUMBER>, -w <NUMBER>

usar NÚMERO columnas para números de línea

ESTILO es uno de:

  • a numerar todas las líneas
  • t numerar solo líneas no vacías
  • n no numerar líneas
  • pBRE numerar solo líneas que contengan una coincidencia para la expresión regular básica, BRE

FORMATO es uno de:

  • ln justificado a la izquierda, sin ceros a la izquierda
  • rn justificado a la derecha, sin ceros a la izquierda
  • rz justificado a la derecha, con ceros a la izquierda

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
nohup COMANDO [ARG]...
nohup OPCIÓN

Ejecutar COMANDO ignorando señales de desconexión.

Options

Si la entrada estándar es terminal, será reemplazada con /dev/null. Si la salida estándar es terminal, será anexada a nohup.out en su lugar, o $HOME/nohup.out, si falló abrir nohup.out. Si el error estándar es terminal, será redirigido a stdout.

Examples

Ejecuta un proceso que puede seguir ejecutándose tras el cierre del terminal:

nohup {{comando}} {{argumento1 argumento2 ...}}

Ejecuta nohup en modo de segundo plano:

nohup {{comando}} {{argumento1 argumento2 ...}} &

Ejecuta un script de intérprete de comandos que puede seguir ejecutándose tras el cierre del terminal:

nohup {{ruta/al/script.sh}} &

Ejecuta un proceso y escribe la salida en un archivo específico:

nohup {{comando}} {{argumento1 argumento2 ...}} >{{ruta/al/archivo_de_salida}} &

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

v0.13.0
nproc [OPCIONES]...

Imprimir el número de núcleos disponibles para el proceso actual. Si las variables de entorno OMP_NUM_THREADS u OMP_THREAD_LIMIT están establecidas, entonces determinarán el valor mínimo y máximo devuelto respectivamente.

Options

--all

print the number of cores available to the system

--ignore=<N>

ignore up to N cores

Examples

Muestra el número de unidades de procesamiento disponibles:

nproc

Muestra el número de unidades de procesamiento instaladas, incluidas las inactivas:

nproc --all

Si es posible, resta un número determinado de unidades del valor devuelto:

nproc --ignore {{conteo}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
numfmt [OPCIÓN]... [NÚMERO]...

Convertir números desde/hacia cadenas legibles por humanos

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

Opciones de UNIDAD:

  • none: no se hace escalado automático; los sufijos activarán un error

  • auto: aceptar sufijo opcional de una/dos letras:

    1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576,

  • si: aceptar sufijo opcional de una letra:

    1K = 1000, 1M = 1000000, …

  • iec: aceptar sufijo opcional de una letra:

    1K = 1024, 1M = 1048576, …

  • iec-i: aceptar sufijo opcional de dos letras:

    1Ki = 1024, 1Mi = 1048576, …

  • CAMPOS soporta rangos de campo estilo cut(1):

    N N-ésimo campo, contado desde 1 N- desde el N-ésimo campo, hasta el final de la línea N-M desde el N-ésimo hasta el M-ésimo campo (inclusive) -M desde el primero hasta el M-ésimo campo (inclusive)

    • todos los campos

Múltiples campos/rangos pueden separarse con comas

FORMATO debe ser adecuado para imprimir un argumento de punto flotante %f. Comilla opcional (%’f) habilitará –grouping (si es soportado por la configuración regional actual). Valor de ancho opcional (%10f) rellenará la salida. Ancho cero opcional (%010f) rellenará el número con ceros. Valores negativos opcionales (%-10f) alinearán a la izquierda. Precisión opcional (%.1f) sobrescribirá la precisión determinada por la entrada.

Examples

Convierte 1.5K (Unidades SI) a 1500:

numfmt --from si 1.5K

Convierte el 5º campo (1-indexado) a Unidades IEC sin convertir la cabecera:

ls -l | numfmt --header=1 --field 5 --to iec

Convierte a unidades IEC, los rellena con 5 caracteres, alineado a la izquierda:

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
od [OPCIÓN]... [--] [NOMBRE_ARCHIVO]...
od [-abcdDefFhHiIlLoOsxX] [NOMBRE_ARCHIVO] [[+][0x]DESPLAZAMIENTO[.][b]]
od --traditional [OPCIÓN]... [NOMBRE_ARCHIVO] [[+][0x]DESPLAZAMIENTO[.][b] [[+][0x]ETIQUETA[.][b]]]

Volcar archivos en octal y otros formatos

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.

Exhibe datos en varios formatos legibles por humanos. Si se especifican múltiples formatos, la salida contendrá todos los formatos en el orden que aparecen en la línea de comandos. Cada formato se imprimirá en una nueva línea. Solo la línea que contiene el primer formato será prefijada con el desplazamiento.

Si no se especifica nombre de archivo, o es “-”, se usará stdin. Tras un “–”, no se reconocerán más opciones. Esto permite nombres de archivo que empiecen con “-”.

Si un nombre de archivo es un número válido que puede usarse como desplazamiento en la segunda forma, puede forzar que se reconozca como nombre de archivo si incluye una opción como “-j0”, que solo es válida en la primera forma.

RADIX es uno de o,d,x,n para octal, decimal, hexadecimal o ninguno.

BYTES es decimal por defecto, octal si tiene prefijo “0”, o hexadecimal si tiene prefijo “0x”. Los sufijos b, KB, K, MB, M, GB, G, multiplicarán el número con 512, 1000, 1024, 1000^2, 1024^2, 1000^3, 1024^3, 1000^2, 1024^2.

DESPLAZAMIENTO y ETIQUETA son octal por defecto, hexadecimal si tienen prefijo “0x” o decimal si se agrega un sufijo “.”. El sufijo “b” multiplicará con 512.

TIPO contiene una o más especificaciones de formato que consisten en: a para ASCII imprimible de 7-bits c para caracteres utf-8 u octal para caracteres indefinidos d[TAMAÑO] para decimal con signo f[TAMAÑO] para punto flotante o[TAMAÑO] para octal u[TAMAÑO] para decimal sin signo x[TAMAÑO] para hexadecimal TAMAÑO es el número de bytes que puede ser el número 1, 2, 4, 8 o 16, o C, S, I, L para 1, 2, 4, 8 bytes para tipos enteros, o F, D, L para 4, 8, 16 bytes para punto flotante. Cualquier especificación de tipo puede tener un sufijo “z”, que agregará un volcado ASCII al final de la línea.

Si ocurrió un error, se imprimirá un mensaje de diagnóstico en stderr, y el código de salida será distinto de cero.

Examples

Muestra el archivo con la configuración predeterminada: formato octal, 8 bytes por línea, desplazamientos de bytes en octal y líneas duplicadas sustituidas por *:

od {{ruta/al/archivo}}

Muestra el archivo en modo detallado, es decir, sin sustituir las líneas duplicadas por *:

od {{[-v|--output-duplicates]}} {{ruta/al/archivo}}

Muestra el archivo en formato hexadecimal (unidades de 2 bytes), con desplazamientos de bytes en formato decimal:

od {{[-t|--format]}} {{x}} {{[-A|--address-radix]}} {{d}} {{[-v|--output-duplicates]}} {{ruta/al/archivo}}

Muestra el archivo en formato hexadecimal (unidades de 1 byte) y 4 bytes por línea:

od {{[-t|--format]}} {{x1}} {{[-w|--width=]}}4 {{[-v|--output-duplicates]}} {{ruta/al/archivo}}

Muestra el archivo en formato hexadecimal junto con su representación en caracteres y no imprime las compensaciones de bytes:

od {{[-t|--format]}} {{xz}} {{[-A|--address-radix]}} {{n}} {{[-v|--output-duplicates]}} {{ruta/al/archivo}}

Lee solo 100 bytes de un archivo a partir del byte 500:

od {{[-N|--read-bytes]}} 100 {{[-j|--skip-bytes]}} 500 {{[-v|--output-duplicates]}} {{ruta/al/archivo}}

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

v0.13.0
paste [OPCIONES] [ARCHIVO]...

Escribir líneas consistentes de las líneas correspondientes secuencialmente de cada ARCHIVO, separadas por TABs, a salida estándar.

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

Une todas las líneas en una sola línea, utilizando TAB como delimitador:

paste {{[-s|--serial]}} {{ruta/al/archivo}}

Une todas las líneas en una sola línea, utilizando el delimitador especificado:

paste {{[-s|--serial]}} {{[-d|--delimiters]}} {{delimitador}} {{ruta/al/archivo}}

Combina dos archivos uno al lado del otro, cada uno en su columna, utilizando TAB como delimitador:

paste {{ruta/al/archivo1}} {{ruta/al/archivo2}}

Combina dos archivos uno al lado del otro, cada uno en su columna, utilizando el delimitador especificado:

paste {{[-d|--delimiters]}} {{delimitador}} {{ruta/al/archivo1}} {{ruta/al/archivo2}}

Combina dos archivos, con líneas añadidas alternativamente:

paste {{[-d|--delimiters]}} '\n' {{ruta/al/archivo1}} {{ruta/al/archivo2}}

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

v0.13.0
pathchk [OPCIÓN]... NOMBRE...

Verificar si los nombres de archivo son válidos o 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

Comprueba la validez de las rutas de acceso en el sistema actual:

pathchk {{ruta1 ruta2 ...}}

Comprueba la validez de las rutas de acceso en una gama más amplia de sistemas compatibles con POSIX:

pathchk -p {{ruta1 ruta2 ...}}

Comprueba la validez de las rutas en todos los sistemas compatibles con POSIX:

pathchk {{[-p -P|--portability]}} {{ruta1 ruta2 ...}}

Comprueba únicamente si las rutas están vacías o comienzan por un guión (-):

pathchk -P {{ruta1 ruta2 ...}}

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

v0.13.0
pinky [OPCIÓN]... [USUARIO]...

Muestra información breve del usuario en sistemas basados en Unix

Options

-l

producir salida de formato largo para los USUARIOs especificados

-b

omitir el directorio de inicio y shell del usuario en formato largo

-h

omitir el archivo de proyecto del usuario en formato largo

-p

omitir el archivo de plan del usuario en formato largo

-s

hacer salida de formato corto, este es el predeterminado

-f

omitir la línea de encabezados de columna en formato corto

-w

omitir el nombre completo del usuario en formato corto

-i

omitir el nombre completo del usuario y host remoto en formato corto

-q

omitir el nombre completo del usuario, host remoto y tiempo inactivo en formato corto

--lookup

intenta canonizar nombres de host por medio de DNS

--help

Imprimir información de ayuda

Examples

Muestra detalles sobre el usuario actual:

pinky

Muestra detalles de un usuario específico:

pinky {{usuario}}

Muestra detalles en formato extenso:

pinky {{usuario}} -l

Omite el directorio de inicio y el intérprete de comandos del usuario en formato largo:

pinky {{usuario}} -lb

Omite el archivo de proyecto del usuario en formato largo:

pinky {{usuario}} -lh

Omite los encabezados de columna en formato corto:

pinky {{usuario}} -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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
pr [OPCIÓN]... [ARCHIVO]...

paginar o hacer columnas de ARCHIVO(s) para impresión

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 no se proporcionan ARCHIVO(s), o si ARCHIVO es -, leer entrada estándar.

Al crear salida multicolumna, las columnas serán de ancho igual. Al usar la opción ‘-s’ para separar columnas, el separador predeterminado es un solo carácter de tabulación. Al usar la opción ‘-S’ para separar columnas, el separador predeterminado es un solo carácter de espacio.

Examples

Imprime varios archivos con un encabezado y un pie de página predeterminados:

pr {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Imprime con un encabezado centrado personalizado:

pr {{[-h|--header]}} "{{encabezado}}" {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Imprime con líneas numeradas y un formato de fecha personalizado:

pr {{[-n|--number-lines]}} {{[-D|--date-format]}} "{{formato}}" {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Imprime todos los archivos juntos, uno en cada columna, sin encabezado ni pie de página:

pr {{[-m|--merge]}} {{[-T|--omit-pagination]}} {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Imprime, comenzando en la página 2 hasta la página 5, con una longitud de página determinada (incluidos el encabezado y el pie de página):

pr +2:5 {{[-l|--length]}} {{longitud_página}} {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Imprime con un sangrado para cada línea y un ancho de página personalizado truncado:

pr {{[-o|--indent]}} {{sangrado}} {{[-W|--page-width]}} {{ancho}} {{ruta/al/archivo1 ruta/al/archivo2 ...}}

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

v0.13.0
printenv [OPCIÓN]... [VARIABLE]...

Mostrar los valores de las VARIABLE(s) de entorno especificadas, o (sin VARIABLE) mostrar pares nombre y valor para todas ellas.

Options

--null, -0

terminar cada línea de salida con byte 0 en lugar de nueva línea

--quoting-style

Set quoting style

Examples

Muestra los pares clave-valor de todas las variables de entorno:

printenv

Muestra el valor de una variable concreta:

printenv {{HOME}}

Muestra el valor de una variable y terminar con un carácter NUL en lugar de un salto de línea:

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

v0.13.0
printf FORMATO [ARGUMENTO]...
printf OPCIÓN

Imprimir salida basada en la cadena de formato y argumentos siguientes.

Options

--help

Imprimir información de ayuda

--version

Imprimir información de versión

plantilla de cadena anónima básica:

imprime cadena de formato al menos una vez, repitiendo mientras queden argumentos la salida imprime literales escapados en la cadena de formato como literales de carácter la salida reemplaza campos anónimos con el siguiente argumento sin usar, formateado según el campo.

Imprime el , reemplazando secuencias de caracteres escapados con literales de carácter y secuencias de campo de sustitución con argumentos pasados

literalmente, con la excepción de las siguientes secuencias de caracteres escapados, y las secuencias de sustitución descritas más abajo.

SECUENCIAS DE ESCAPE

Las siguientes secuencias de escape, organizadas aquí en orden alfabético, imprimirán el literal de carácter correspondiente:

  • " comilla doble

  • \ barra invertida

  • \a alerta (BEL)

  • \b retroceso

  • \c Fin-de-Entrada

  • \e escape

  • \f alimentación de formulario

  • \n nueva línea

  • \r retorno de carro

  • \t tabulación horizontal

  • \v tabulación vertical

  • \NNN byte con valor expresado en valor octal NNN (1 a 3 dígitos) valores mayores que 256 serán tratados

  • \xHH byte con valor expresado en valor hexadecimal NN (1 a 2 dígitos)

  • \uHHHH carácter Unicode (IEC 10646) con valor expresado en valor hexadecimal HHHH (4 dígitos)

  • \uHHHH carácter Unicode con valor expresado en valor hexadecimal HHHH (8 dígitos)

  • %% un solo %

SUSTITUCIONES

REFERENCIA RÁPIDA DE SUSTITUCIÓN

Campos

  • %s: cadena

  • %b: cadena analizada para literales segundo parámetro es longitud máxima

  • %c: carácter sin segundo parámetro

  • %i o %d: entero de 64-bit

  • %u: entero sin signo de 64 bit

  • %x o %X: entero sin signo de 64-bit como hex

  • %o: entero sin signo de 64-bit como octal segundo parámetro es ancho mínimo, entero salida bajo ese ancho se rellena con ceros iniciales

  • %q: ARGUMENTO se imprime en un formato que puede reutilizarse como entrada de shell, escapando caracteres no imprimibles con la sintaxis $‘’ propuesta por POSIX.

  • %f o %F: valor de punto flotante decimal

  • %e o %E: valor de punto flotante en notación científica

  • %g o %G: el más corto de valor de punto flotante decimal o SciNote interpretado especialmente. segundo parámetro es -lugares máximos después del punto decimal para salida de punto flotante -número máximo de dígitos significativos para salida de notación científica

parametrizando campos

ejemplos:

printf ‘%4.3i’ 7

Tiene un primer parámetro de 4 y un segundo parámetro de 3 y resultará en ’ 007’

printf ‘%.1s’ abcde

No tiene primer parámetro y un segundo parámetro de 1 y resultará en ‘a’

printf ‘%4c’ q

Tiene un primer parámetro de 4 y sin segundo parámetro y resultará en ’ q’

El primer parámetro de un campo es el ancho mínimo para rellenar la salida si la salida es menor que este valor absoluto de este ancho, se rellenará con espacios iniciales, o, si el argumento es negativo, con espacios finales. el predeterminado es cero.

El segundo parámetro de un campo es particular al tipo de campo de salida. los predeterminados se pueden encontrar en la ayuda de sustitución completa abajo

prefijos especiales para argumentos numéricos

  • 0: (ej. 010) interpretar argumento como octal (solo campos de salida enteros)
  • 0x: (ej. 0xABC) interpretar argumento como hex (solo campos de salida numéricos)
  • ': (ej. 'a) interpretar argumento como una constante de carácter

CÓMO USAR SUSTITUCIONES

Las sustituciones se usan para pasar argumento(s) adicional(es) a la cadena FORMAT, para ser formateados de una manera particular. Ej.

printf ‘la letra %X viene antes de la letra %X’ 10 11

imprimirá

la letra A viene antes de la letra B

porque el campo de sustitución %X significa ‘tomar un argumento entero y escribirlo como un número hexadecimal’

Pasar más argumentos que los que están en la cadena de formato causará que la cadena de formato se repita para las sustituciones restantes

printf ‘está a %i F en %s \n’ 22 Portland 25 Boston 27 New York

imprimirá

está a 22 F en Portland está a 25 F en Boston está a 27 F en Boston

Si una cadena de formato se imprime pero quedan menos argumentos que campos de sustitución, los campos de sustitución sin un argumento usarán cadenas vacías por defecto, o para campos numéricos el valor 0

SUSTITUCIONES DISPONIBLES

Este programa, como printf de GNU coreutils, interpreta un subconjunto modificado de la especificación printf C POSIX, una referencia rápida a sustituciones está abajo.

SUSTITUCIONES DE CADENA

Todos los campos de cadena tienen un parámetro de ‘ancho máximo’ %.3s significa ‘imprimir no más de tres caracteres de la entrada original’

  • %s: cadena

  • %b: cadena escapada - la cadena será verificada para cualquier literal escapado de la lista de literales escapados arriba, y traducirlos a caracteres literales. ej. \n será transformado en un carácter de nueva línea. Una regla especial sobre el modo %b es que los literales octales se interpretan diferente En argumentos pasados por %b, los literales interpretados como octal deben estar en la forma \0NNN en lugar de \NNN. (Aunque, por razones de compatibilidad, los literales octales en la forma \NNN aún serán interpretados y no lanzarán una advertencia, tendrá problemas si usa esto para un literal cuyo código comience con cero, ya que será visto como en forma \0NNN.)

  • %q: cadena escapada - la cadena en un formato que puede reutilizarse como entrada por la mayoría de shells. Los caracteres no imprimibles son escapados con la sintaxis POSIX propuesta ‘$’‘’’, y los meta-caracteres de shell son entrecomillados apropiadamente. Esto es un formato equivalente a la salida ls –quoting=shell-escape.

SUSTITUCIONES DE CARÁCTER

El campo de carácter no tiene un parámetro secundario.

  • %c: un solo carácter

SUSTITUCIONES DE ENTERO

Todos los campos enteros tienen un parámetro ‘rellenar con cero’ %.4i significa un entero que si es menor de 4 dígitos en longitud, se rellena con ceros iniciales hasta que sea de 4 dígitos de longitud.

  • %d o %i: entero de 64-bit

  • %u: entero sin signo de 64-bit

  • %x o %X: entero sin signo de 64-bit impreso en Hexadecimal (base 16) %X en lugar de %x significa usar letras mayúsculas para ‘a’ hasta ‘f’

  • %o: entero sin signo de 64-bit impreso en octal (base 8)

SUSTITUCIONES DE PUNTO FLOTANTE

Todos los campos de punto flotante tienen un parámetro ‘lugares decimales máximos / dígitos significativos máximos’ %.10f significa un punto flotante decimal con 7 lugares decimales después de 0 %.10e significa un número en notación científica con 10 dígitos significativos %.10g significa el mismo comportamiento para decimal y Sci. Note, respectivamente, y proporciona la más corta de cada salida.

Como con GNU coreutils, el valor después del punto decimal es estas salidas se analiza como un double primero antes de ser renderizado a texto. Para ambas implementaciones no espere precisión significativa más allá del 18º lugar decimal. Al usar un número de lugares decimales que es 18 o mayor, puede esperar variación en salida entre printf de GNU coreutils y este printf en el 18º lugar decimal de +/- 1

  • %f: valor de punto flotante presentado en decimal, truncado y mostrado a 6 lugares decimales por defecto. No hay paridad de comportamiento pasado-double con printf de Coreutils, los valores no son estimados o ajustados más allá de valores de entrada.

  • %e o %E: valor de punto flotante presentado en notación científica 7 dígitos significativos por defecto %E significa usar E mayúscula para la mantisa.

  • %g o %G: valor de punto flotante presentado en la más corta de notación decimal y científica se comporta diferente de %f y %E, por favor vea especificación printf posix para detalles completos, algunos ejemplos de comportamiento diferente: Sci Note tiene 6 dígitos significativos por defecto Los ceros finales son removidos En lugar de ser truncado, el dígito después del último es redondeado

Como otro comportamiento en esta utilidad, las decisiones de diseño del comportamiento de punto flotante en esta utilidad están seleccionadas para reproducir exactamente el comportamiento del printf de GNU coreutils desde un punto de vista de entradas y salidas.

USANDO PARÁMETROS

La mayoría de campos de sustitución pueden parametrizarse usando hasta 2 números que pueden pasarse al campo, entre el signo % y la letra del campo.

El 1er parámetro siempre indica el ancho mínimo de salida, es útil para crear salida columnar. Cualquier salida que sería menor que este ancho mínimo se rellena con espacios iniciales El 2do parámetro es precedido por un punto. No tiene que usar parámetros

FORMAS ESPECIALES DE ENTRADA

Para entrada numérica, las siguientes formas adicionales de entrada son aceptadas además de decimal:

Octal (solo con entero): si el argumento comienza con un 0 los caracteres siguientes serán interpretados como octal (base 8) para campos enteros

Hexadecimal: si el argumento comienza con 0x los caracteres siguientes serán interpretados serán interpretados como hex (base 16) para cualquier campo numérico para campos float, la entrada hexadecimal resulta en un límite de precisión (al convertir entrada después del punto decimal) de 10^-15

Constante de Carácter: si el argumento comienza con un carácter de comilla simple, el primer byte del siguiente carácter será interpretado como un entero sin signo de 8-bit. Si hay bytes adicionales, lanzarán un error (a menos que la variable de entorno POSIXLY_CORRECT esté establecida)

Examples

Imprime un mensaje de texto:

printf "{{%s\n}}" "{{Hola mundo}}"

Imprime un número entero en negrita azul:

printf "{{\e[1;34m%.3d\e[0m\n}}" {{42}}

Imprime un número flotante con el signo del euro Unicode:

printf "{{\u20AC %.2f\n}}" {{123.4}}

Imprime un mensaje de texto compuesto con variables de entorno:

printf "{{var1: %s\tvar2: %s\n}}" "{{$VAR1}}" "{{$VAR2}}"

Almacena un mensaje formateado en una variable (no funciona en Zsh):

printf -v {{myvar}} {{"Esto es %s = %d\n" "un año" 2016}}

Imprime un número hexadecimal, octal y científico:

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

v0.13.0
ptx [OPCIÓN]... [ENTRADA]...
ptx -G [OPCIÓN]... [ENTRADA [SALIDA]]

Producir un índice permutado del contenido del archivo Generar un índice permutado, incluyendo contexto, de las palabras en los archivos de entrada. Los argumentos obligatorios para opciones largas son obligatorios también para opciones cortas. Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar. El predeterminado es ‘-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

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
pwd [OPCIÓN]...

Mostrar el nombre completo del directorio de trabajo actual.

Options

--logical, -L

use PWD from environment, even if it contains symlinks

--physical, -P

avoid all symlinks

Examples

Muestra el directorio actual:

pwd

Muestra el directorio actual y resuelve todos los enlaces simbólicos (es decir, muestra la ruta “física”):

pwd {{[-P|--physical]}}

Muestra la ayuda:

pwd --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.

readlink

v0.13.0
readlink [OPCIÓN]... [ARCHIVO]...

Imprimir valor de un enlace simbólico o nombre de archivo canónico.

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

Obtiene el archivo real al que apunta el enlace simbólico:

readlink {{ruta/al/archivo}}

Obtiene la ruta absoluta a un archivo:

readlink {{[-f|--canonicalize]}} {{ruta/al/archivo}}

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

v0.13.0
realpath [OPCIÓN]... ARCHIVO...

Imprimir la ruta resuelta

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

Muestra la ruta absoluta de un archivo o directorio:

realpath {{ruta/al/archivo_o_directorio}}

Requiere que existan todos los componentes de la ruta:

realpath {{[-e|--canonicalize-existing]}} {{ruta/al/archivo_o_directorio}}

Resuelve los componentes .. antes que los enlaces simbólicos:

realpath {{[-L|--logical]}} {{ruta/al/archivo_o_directorio}}

Desactiva la expansión de enlaces simbólicos:

realpath {{[-s|--no-symlinks]}} {{ruta/al/archivo_o_directorio}}

Suprime los mensajes de error:

realpath {{[-q|--quiet]}} {{ruta/al/archivo_o_directorio}}

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

v0.13.0
rm [OPCIÓN]... ARCHIVO...

Eliminar (desenlazar) el/los ARCHIVO(s)

Options

--force, -f

ignorar archivos y argumentos inexistentes, nunca avisar

-i

avisar antes de cada eliminación

-I

avisar una vez antes de eliminar más de tres archivos, o al eliminar recursivamente.
Menos intrusivo que -i, mientras aún da cierta protección contra la mayoría de errores

--interactive=<WHEN>

avisar según CUÁNDO: never, once (-I), o always (-i). Sin CUÁNDO,
avisa siempre

--one-file-system

al eliminar una jerarquía recursivamente, omitir cualquier directorio que esté en un sistema
de archivos diferente del argumento de línea de comandos correspondiente (NO
IMPLEMENTADO)

--no-preserve-root

no tratar «/» especialmente

--preserve-root=<all>

no quitar «/» (predeterminado)

--recursive, -r, -R

eliminar directorios y su contenido recursivamente

--dir, -d

eliminar directorios vacíos

--verbose, -v

explicar lo que se está haciendo

--progress, -g

exhibe una barra de progreso. Nota: esta característica no es admitida por GNU coreutils.

--presume-input-tty

Por defecto, rm no elimina directorios. Use la opción –recursive (-r o -R) para eliminar cada directorio listado, también, junto con todo su contenido

Para eliminar un archivo cuyo nombre comienza con ‘-’, por ejemplo ‘-foo’, use uno de estos comandos: rm – -foo

rm ./-foo

Note que si usa rm para eliminar un archivo, podría ser posible recuperar algo de su contenido, dada suficiente experiencia y/o tiempo. Para mayor aseguración de que el contenido sea verdaderamente irrecuperable, considere usar shred.

Examples

Elimina archivos específicos:

rm {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Elimina archivos específicos ignorando los que no existen:

rm -f {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Elimina varios archivos de forma interactiva, solicitando confirmación antes de eliminar cada archivo:

rm -i {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Elimina archivos, imprimiendo un mensaje por cada archivo eliminado:

rm -v {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Elimina, de forma recursiva, archivos y directorios:

rm -r {{ruta/al/directorio1 ruta/al/directorio2 ...}}

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

v0.13.0
rmdir [OPCIÓN]... DIRECTORIO...

Eliminar el/los DIRECTORIO(s), si están vacíos.

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

v0.13.0
runcon CONTEXTO COMANDO [ARG...]
runcon [-c] [-u USUARIO] [-r ROL] [-t TIPO] [-l RANGO] COMANDO [ARG...]

Ejecutar comando con contexto de seguridad especificado bajo sistemas habilitados con SELinux.

Options

--compute, -c

Calcular contexto de transición de proceso antes de modificar.

--user=<USER>, -u <USER>

Establecer usuario USUARIO en el contexto de seguridad objetivo.

--role=<ROLE>, -r <ROLE>

Establecer rol ROL en el contexto de seguridad objetivo.

--type=<TYPE>, -t <TYPE>

Establecer tipo TIPO en el contexto de seguridad objetivo.

--range=<RANGE>, -l <RANGE>

Establecer rango RANGO en el contexto de seguridad objetivo.

Ejecutar COMANDO con CONTEXTO completamente especificado, o con contexto de seguridad actual o transicionado modificado por uno o más de NIVEL, ROL, TIPO, y USUARIO.

Si ninguno de –compute, –type, –user, –role o –range está especificado, entonces el primer argumento se usa como el contexto completo.

Note que solo contextos cuidadosamente elegidos es probable que se ejecuten exitosamente.

Si ni CONTEXTO ni COMANDO está especificado, se imprime el contexto de seguridad actual.

Examples

Muestra el contexto de seguridad del contexto de ejecución actual:

runcon

Especifica el dominio en el que se ejecutará un comando:

runcon {{[-t|--type]}} {{dominio}}_t {{comando}}

Especifica el rol del contexto con el que se ejecutará un comando:

runcon {{[-r|--role]}} {{rol}}_r {{comando}}

Especifica el contexto completo con el que ejecutar un comando:

runcon {{usuario}}_u:{{rol}}_r:{{dominio}}_t {{comando}}

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

v0.13.0
seq [OPCIÓN]... ÚLTIMO
seq [OPCIÓN]... PRIMERO ÚLTIMO
seq [OPCIÓN]... PRIMERO INCREMENTO ÚLTIMO

Mostrar números de PRIMERO a ÚLTIMO, en pasos de INCREMENTO.

Options

--separator, -s

Carácter separador (por defecto \n)

--terminator, -t

Carácter terminador (por defecto \n)

--equal-width, -w

Igualar anchos de todos los números rellenando con ceros

--format, -f

usar FORMATO de punto flotante estilo printf

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
sha1sum [OPTIONS] [FILE]...

Print or check the SHA1 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

Calcula la suma de comprobación SHA1 de uno o más archivos:

sha1sum {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Calcula y guarda la lista de sumas de comprobación SHA1 en un archivo:

sha1sum {{ruta/al/archivo1 ruta/al/archivo2 ...}} >{{ruta/al/archivo.sha1}}

Calcula una suma de comprobación SHA1 a partir de stdin:

{{comando}} | sha1sum

Lee un archivo de sumas de comprobación SHA1 y nombres de archivo y verifica que todos los archivos tengan sumas de comprobación coincidentes:

sha1sum {{[-c|--check]}} {{ruta/al/archivo.sha1}}

Solo muestra un mensaje cuando faltan archivos o cuando falla la verificación:

sha1sum {{[-c|--check]}} --quiet {{ruta/al/archivo.sha1}}

Solo muestra un mensaje cuando falla la verificación, ignorando los archivos que faltan:

sha1sum --ignore-missing {{[-c|--check]}} --quiet {{ruta/al/archivo.sha1}}

Comprueba una suma de comprobación SHA1 conocida de un archivo:

echo {{suma_de_verificación_sha1_conocida_del_archivo}} {{ruta/al/archivo}} | 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

v0.13.0
sha224sum [OPTIONS] [FILE]...

Print or check the SHA224 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

Calcula la suma de comprobación SHA224 para uno o más archivos:

sha224sum {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Calcula y guarda la lista de sumas de comprobación SHA224 en un archivo:

sha224sum {{ruta/al/archivo1 ruta/al/archivo2 ...}} >{{ruta/al/archivo.sha224}}

Calcula una suma de comprobación SHA224 desde stdin:

{{comando}} | sha224sum

Lee nombres de archivo y archivo de sumas de comprobación SHA224 y verifica que todos los archivos tengan sumas de comprobación coincidentes:

sha224sum {{[-c|--check]}} {{ruta/al/archivo.sha224}}

Muestra solo un mensaje para los archivos que faltan o cuando falla la verificación:

sha224sum {{[-c|--check]}} --quiet {{ruta/al/archivo.sha224}}

Muestra solo un mensaje cuando falla la verificación, ignorando los archivos que faltan:

sha224sum --ignore-missing {{[-c|--check]}} --quiet {{ruta/al/archivo.sha224}}

Comprueba una suma de comprobación SHA224 conocida de un archivo:

echo {{suma_de_comprobación_sha224_conocida_del_archivo}} {{ruta/al/archivo}} | 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

v0.13.0
sha256sum [OPTIONS] [FILE]...

Print or check the SHA256 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

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
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

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
sha512sum [OPTIONS] [FILE]...

Print or check the SHA512 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

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
shred [OPCIÓN]... ARCHIVO...

Sobrescribir los ARCHIVO(s) especificados repetidamente, para hacer más difícil incluso para sondeo de hardware muy costoso recuperar los datos.

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

Eliminar ARCHIVO(s) si se especifica –remove (-u). El predeterminado es no eliminar los archivos porque es común operar en archivos de dispositivo como /dev/hda, y esos archivos usualmente no deberían eliminarse.

PRECAUCIÓN: Note que shred se basa en una suposición muy importante: que el sistema de archivos sobrescribe datos en el lugar. Esta es la forma tradicional de hacer las cosas, pero muchos diseños de sistemas de archivos modernos no satisfacen esta suposición. Los siguientes son ejemplos de sistemas de archivos en los que shred no es efectivo, o no se garantiza que sea efectivo en todos los modos de sistema de archivos:

  • sistemas de archivos estructurados por registro o journal, como los suministrados con AIX y Solaris (y JFS, ReiserFS, XFS, Ext3, etc.)

  • sistemas de archivos que escriben datos redundantes y continúan incluso si algunas escrituras fallan, como sistemas de archivos basados en RAID

  • sistemas de archivos que hacen instantáneas, como el servidor NFS de Network Appliance

  • sistemas de archivos que almacenan en caché en ubicaciones temporales, como clientes NFS versión 3

  • sistemas de archivos comprimidos

En el caso de sistemas de archivos ext3, la exención anterior se aplica (y shred es así de efectividad limitada) solo en modo data=journal, que registra datos de archivo además de solo metadatos. En ambos modos data=ordered (predeterminado) y data=writeback, shred funciona como de costumbre. Los modos journal de Ext3 pueden cambiarse agregando la opción data=algo a las opciones de montaje para un sistema de archivos particular en el archivo /etc/fstab, como se documenta en la página de manual de mount (man mount).

Además, las copias de seguridad de sistema de archivos y espejos remotos pueden contener copias del archivo que no se pueden eliminar, y que permitirán que un archivo destruido se recupere más tarde.

Examples

Sobrescribe un archivo:

shred {{ruta/al/archivo}}

Sobrescribe un archivo y muestra el progreso en pantalla:

shred {{[-v|--verbose]}} {{ruta/al/archivo}}

Sobrescribe un archivo, sustituyendo los datos aleatorios por ceros:

shred {{[-z|--zero]}} {{ruta/al/archivo}}

Sobrescribe un archivo un número específico de veces:

shred {{[-n|--iterations]}} {{25}} {{ruta/al/archivo}}

Sobrescribe un archivo y lo elimina:

shred {{[-u|--remove]}} {{ruta/al/archivo}}

Sobrescribe un archivo 100 veces, añade una sobrescritura final con ceros, elimina el archivo tras sobrescribirlo y muestra el progreso detallado en pantalla:

shred {{[-vzu|--verbose --zero --remove]}} {{[-n|--iterations]}} 100 {{ruta/al/archivo}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
shuf [OPCIÓN]... [ARCHIVO]
shuf -e [OPCIÓN]... [ARG]...
shuf -i LO-HI [OPCIÓN]...

Mezclar la entrada mostrando una permutación aleatoria de líneas de entrada. Cada permutación de salida es igualmente probable. Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

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

v0.13.0
sleep NÚMERO[SUFIJO]...
sleep OPCIÓN

Pausar por NÚMERO segundos.

Options

pause for NUMBER seconds

Pausar por NÚMERO segundos. SUFIJO puede ser ‘s’ para segundos (por defecto), ‘m’ para minutos, ‘h’ para horas o ‘d’ para días. A diferencia de la mayoría de implementaciones que requieren que NÚMERO sea un entero, aquí NÚMERO puede ser un número de punto flotante arbitrario. Dados dos o más argumentos, pausar por la cantidad de tiempo especificada por la suma de sus valores.

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
sort [OPCIÓN]... [ARCHIVO]...

Mostrar concatenación ordenada de todos los ARCHIVO(s). Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

Options

--help

Mostrar información de ayuda.

--version

Mostrar información de versión.

--sort
--human-numeric-sort, -h

comparar según tamaños legibles por humanos, ej. 1M > 100k

--month-sort, -M

comparar según abreviación de nombre de mes

--numeric-sort, -n

comparar según valor numérico de cadena

--general-numeric-sort, -g

comparar según valor numérico general de cadena

--version-sort, -V

Ordenar por número de versión SemVer, ej. 1.12.2 > 1.1.2

--random-sort, -R

mezclar en orden aleatorio

--random-source=<FILE>

usar ARCHIVO como fuente de datos aleatorios

--dictionary-order, -d

considerar solo espacios en blanco y caracteres alfanuméricos

--merge, -m

fusionar archivos ya ordenados; no ordenar

--check, -c

verificar entrada ordenada; no ordenar

--check-silent, -C

salir exitosamente si el archivo dado ya está ordenado, y salir con estado 1 de otra manera.

--ignore-case, -f

plegar caracteres de minúscula a mayúscula

--ignore-nonprinting, -i

ignorar caracteres no imprimibles

--ignore-leading-blanks, -b

ignorar espacios en blanco iniciales al encontrar claves de ordenamiento en cada línea

--output=<FILENAME>, -o <FILENAME>

escribir salida a NOMBREARCHIVO en lugar de stdout

--reverse, -r

invertir la salida

--stable, -s

estabilizar ordenamiento deshabilitando comparación de último recurso

--unique, -u

mostrar solo el primero de una secuencia igual

--key, -k

ordenar por una clave

--field-separator, -t

separador personalizado para -k

--zero-terminated, -z

el delimitador de línea es NUL, no nueva línea

--parallel=<NUM_THREADS>

cambiar el número de hilos ejecutándose concurrentemente a NUM_HILOS

--buffer-size=<SIZE>, -S <SIZE>

establece el TAMAÑO máximo de cada segmento en número de elementos ordenados

--temporary-directory=<DIR>, -T <DIR>

usar DIR para temporales, no $TMPDIR o /tmp

--compress-program=<PROG>

comprimir archivos temporales con PROG, descomprimir con PROG -d; PROG tiene que tomar entrada desde stdin y salida a stdout

--batch-size=<N_MERGE>

Fusionar como máximo N_FUSION entradas a la vez.

--files0-from=<NUL_FILE>

leer entrada de los archivos especificados por ARCHIVO_NUL terminado en NUL

--debug

subrayar las partes de la línea que realmente se usan para ordenar

El formato de clave es CAMPO[.CAR][OPCIONES][,CAMPO[.CAR]][OPCIONES].

Los campos por defecto están separados por el primer espacio en blanco después de un carácter que no sea espacio en blanco. Use -t para especificar un separador personalizado. En el caso por defecto, se agrega espacio en blanco al principio de cada campo. Sin embargo, los separadores personalizados no se incluyen en los campos.

CAMPO y CAR ambos empiezan en 1 (es decir, están indexados en 1). Si no hay final especificado después de una coma, el final será el final de la línea. Si CAR se establece en 0, significa el final del campo. CAR por defecto es 1 para la posición inicial y 0 para la posición final.

Las opciones válidas son: MbdfhnRrV. Anulan las opciones globales para esta clave.

Examples

Ordena un archivo en orden ascendente:

sort {{ruta/al/archivo}}

Ordena un archivo en orden descendente:

sort {{[-r|--reverse]}} {{ruta/al/archivo}}

Ordena un archivo sin distinguir entre mayúsculas y minúsculas:

sort {{[-f|--ignore-case]}} {{ruta/al/archivo}}

Ordena un archivo usando orden numérico en lugar de alfabético:

sort {{[-n|--numeric-sort]}} {{ruta/al/archivo}}

Ordena /etc/passwd por el tercer campo de cada línea numéricamente, usando : como separador de campos:

sort {{[-t|--field-separator]}} : {{[-k|--key]}} 3n /etc/passwd

Como el anterior, pero cuando los elementos del tercer campo son iguales, ordena por el cuarto campo con números con exponentes:

sort {{[-t|--field-separator]}} : {{[-k|--key]}} 3,3n {{[-k|--key]}} 4,4g /etc/passwd

Ordena un archivo conservando únicamente las líneas únicas:

sort {{[-u|--unique]}} {{ruta/al/archivo}}

Ordena un archivo, imprimiendo la salida en un archivo específico (puede usarse para ordenar un archivo en el sitio):

sort {{[-o|--output]}} {{ruta/al/archivo_de_salida}} {{ruta/al/archivo_de_entrada}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
split [OPCIÓN]... [ENTRADA [PREFIJO]]

Crear archivos de salida conteniendo secciones consecutivas o intercaladas de entrada

Options

--bytes=<SIZE>, -b <SIZE>

poner TAMAÑO bytes por archivo de salida

--line-bytes=<SIZE>, -C <SIZE>

poner como máximo TAMAÑO bytes de líneas por archivo de salida

--lines=<NUMBER>, -l <NUMBER>

poner NÚMERO líneas/registros por archivo de salida

--number=<CHUNKS>, -n <CHUNKS>

generar FRAGMENTOS archivos de salida; ver explicación abajo

--additional-suffix=<SUFFIX>

SUFIJO adicional para anexar a nombres de archivos de salida

--filter=<COMMAND>

escribir a COMANDO shell; el nombre de archivo es $FILE (Actualmente no implementado para Windows)

--elide-empty-files, -e

no generar archivos de salida vacíos con ‘-n’

-d

usar sufijos numéricos empezando en 0, no alfabéticos

--numeric-suffixes=<FROM>

igual que -d, pero permite establecer el valor de inicio

-x

usar sufijos hexadecimales empezando en 0, no alfabéticos

--hex-suffixes=<FROM>

igual que -x, pero permite establecer el valor de inicio

--suffix-length=<N>, -a <N>

generar sufijos de longitud N (predeterminado 2)

--verbose

imprimir un diagnóstico justo antes de que se abra cada archivo de salida

--separator=<SEP>, -t <SEP>

usar SEP en lugar de nueva línea como separador de registro; ‘\0’ (cero) especifica el carácter NUL

--io-blksize

Generar piezas de tamaño fijo de ENTRADA a PREFIJOaa, PREFIJOab, …; el tamaño predeterminado es 1000, y el PREFIJO predeterminado es ‘x’. Sin ENTRADA, o cuando ENTRADA es -, leer entrada estándar.

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
stat [OPCIÓN]... ARCHIVO...

Mostrar estado de archivo o sistema de archivos.

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

Secuencias de formato válidas para archivos (sin --file-system):

-%a: derechos de acceso en octal (note las banderas printf ‘#’ y ‘0’) -%A: derechos de acceso en forma legible por humanos -%b: número de bloques asignados (ver %B) -%B: el tamaño en bytes de cada bloque reportado por %b -%C: cadena de contexto de seguridad SELinux -%d: número de dispositivo en decimal -%D: número de dispositivo en hex -%f: modo crudo en hex -%F: tipo de archivo -%g: ID de grupo del propietario -%G: nombre de grupo del propietario -%h: número de enlaces duros -%i: número de inodo -%m: punto de montaje -%n: nombre de archivo -%N: nombre de archivo con comillas con desreferencia (seguir) si es enlace simbólico -%o: sugerencia de tamaño óptimo de transferencia E/S -%s: tamaño total, en bytes -%t: tipo de dispositivo mayor en hex, para archivos especiales de dispositivo carácter/bloque -%T: tipo de dispositivo menor en hex, para archivos especiales de dispositivo carácter/bloque -%u: ID de usuario del propietario -%U: nombre de usuario del propietario -%w: tiempo de nacimiento del archivo, legible por humanos; - si desconocido -%W: tiempo de nacimiento del archivo, segundos desde Época; 0 si desconocido -%x: tiempo del último acceso, legible por humanos -%X: tiempo del último acceso, segundos desde Época -%y: tiempo de la última modificación de datos, legible por humanos

-%Y: tiempo de la última modificación de datos, segundos desde Época -%z: tiempo del último cambio de estado, legible por humanos -%Z: tiempo del último cambio de estado, segundos desde Época

Secuencias de formato válidas para sistemas de archivos:

-%a: bloques libres disponibles para no-superusuario -%b: bloques de datos totales en sistema de archivos -%c: nodos de archivo totales en sistema de archivos -%d: nodos de archivo libres en sistema de archivos -%f: bloques libres en sistema de archivos -%i: ID de sistema de archivos en hex -%l: longitud máxima de nombres de archivo -%n: nombre de archivo -%s: tamaño de bloque (para transferencias más rápidas) -%S: tamaño de bloque fundamental (para conteos de bloque) -%t: tipo de sistema de archivos en hex -%T: tipo de sistema de archivos en forma legible por humanos

NOTA: su shell puede tener su propia versión de stat, que usualmente reemplaza la versión descrita aquí. Por favor consulte la documentación de su shell para detalles sobre las opciones que soporta.

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
stdbuf [OPCIÓN]... COMANDO

Ejecutar COMANDO, con operaciones de almacenamiento en búfer modificadas para sus flujos estándar.

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 MODO es ‘L’ el flujo correspondiente será almacenado en búfer por líneas. Esta opción no es válida con entrada estándar.

Si MODO es ‘0’ el flujo correspondiente no tendrá búfer.

De lo contrario, MODO es un número que puede ser seguido por uno de los siguientes:

KB 1000, K 1024, MB 10001000, M 10241024, y así sucesivamente para G, T, P, E, Z, Y. En este caso el flujo correspondiente será completamente almacenado en búfer con el tamaño de búfer establecido a MODO bytes.

NOTA: Si COMANDO ajusta el almacenamiento en búfer de sus flujos estándar (tee hace por ej.) entonces eso anulará las configuraciones correspondientes cambiadas por stdbuf. También algunos filtros (como dd y cat etc.) no usan flujos para E/S, y por lo tanto no son afectados por las configuraciones de stdbuf.

Examples

Cambia el tamaño del búfer de stdin a 512 KiB:

stdbuf {{[-i|--input]}} 512K {{comando}}

Cambia el búfer de stdout a búfer por líneas:

stdbuf {{[-o|--output]}} L {{comando}}

Configura el búfer stderr sin almacenamiento en búfer:

stdbuf {{[-e|--error]}} 0 {{comando}}

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

v0.13.0
stty [-F DISPOSITIVO | --file=DISPOSITIVO] [CONFIGURACIÓN]...
o:  stty [-F DISPOSITIVO | --file=DISPOSITIVO] [-a|--all]
o:  stty [-F DISPOSITIVO | --file=DISPOSITIVO] [-g|--save]"

Declarar o cambiar características del 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

Muestra el tamaño actual del terminal:

stty size

Muestra todos los ajustes del terminal actual:

stty {{[-a|--all]}}

Establece el número de filas o columnas:

stty {{rows|cols}} {{cuenta}}

Obtiene la velocidad de transferencia real de un dispositivo:

stty {{[-F|--file]}} {{ruta/al/archivo_del_dispositivo}} speed

Restablece todos los modos a valores razonables para la terminal actual:

stty sane

Cambia entre el modo sin procesar y el modo normal:

stty {{raw|cooked}}

Activa o desactiva el eco de caracteres:

stty {{-echo|echo}}

Muestra la ayuda:

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

v0.13.0
sum [OPCIÓN]... [ARCHIVO]...

Suma de verificación y contar los bloques en un archivo.

Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

Options

-r

use the BSD sum algorithm, use 1K blocks (default)

--sysv, -s

use System V sum algorithm, use 512 bytes blocks

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
sync [OPCIÓN]... ARCHIVO...

Sincronizar escrituras en caché al almacenamiento persistente

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

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
tac [OPCIÓN]... [ARCHIVO]...

Escribir cada archivo a salida estándar, última línea primero.

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

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
tail [OPCIÓN]... [ARCHIVO]...

Mostrar las últimas 10 líneas de cada ARCHIVO a salida estándar. Con más de un ARCHIVO, preceder cada uno con un encabezado que muestre el nombre del archivo. Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar. Los argumentos obligatorios para las opciones largas también son obligatorios para las opciones cortas.

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

Deshabilitar soporte ‘inotify’ y usar consultas en su lugar

--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

Imprime las últimas líneas de ‘recuento’ de un archivo:

tail {{[-n|--lines]}} {{recuento}} {{ruta/al/archivo}}

Imprime un archivo desde una línea específica:

tail {{[-n|--lines]}} +{{recuento}} {{ruta/al/archivo}}

Imprime un número específico de bytes desde el final de algún archivo:

tail {{[-n|--lines]}} {{recuento}} {{ruta/al/archivo}}

Imprime las últimas líneas de un archivo en tiempo real hasta presionar <Ctrl c>:

tail {{[-f|--follow]}} {{ruta/al/archivo}}

Mantiene leyendo las últimas líneas de un archivo hasta presionar <Ctrl c>, aunque el archivo sea inaccesible:

tail {{[-F|--retry --follow]}} {{ruta/al/archivo}}

Imprime las últimas líneas de ‘recuento’ en ‘archivo’ y se actualiza cada ‘n’ segundos:

tail {{[-n|--lines]}} {{recuento}} {{[-s|--sleep-interval]}} {{segundos}} {{[-f|--follow]}} {{ruta/al/archivo}}

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

v0.13.0
tee [OPCIÓN]... [ARCHIVO]...

Copiar entrada estándar a cada ARCHIVO, y también a salida estándar.

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 ARCHIVO es -, se refiere a un archivo llamado - .

Examples

Copia la entrada estándar (stdin) a cada archivo, y también a la salida estándar (stdout):

echo "ejemplo" | tee {{ruta/al/archivo}}

Anexa a los archivos específicos, sin sobreescribir:

echo "ejemplo" | tee {{[-a|--append]}} {{ruta/al/archivo}}

Imprime la entrada estándar a la terminal, y también lo reenvía a otro programa para posterior procesamiento:

echo "ejemplo" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}

Crea un directorio llamado “ejemplo”, cuenta el número de caracteres en “ejemplo” y escribe “ejemplo” a la terminal:

echo "ejemplo" | 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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
test EXPRESIÓN
test
[ EXPRESIÓN ]
[ ]
[ OPCIÓN ]

Verificar tipos de archivo y comparar valores.

Options

Salir con el estado determinado por EXPRESIÓN.

Una EXPRESIÓN omitida es falsa por defecto. De lo contrario, EXPRESIÓN es verdadera o falsa y establece el estado de salida.

Es una de:

  • ( EXPRESIÓN ) EXPRESIÓN es verdadera
  • ! EXPRESIÓN EXPRESIÓN es falsa
  • EXPRESIÓN1 -a EXPRESIÓN2 tanto EXPRESIÓN1 como EXPRESIÓN2 son verdaderas
  • EXPRESIÓN1 -o EXPRESIÓN2 o EXPRESIÓN1 o EXPRESIÓN2 es verdadera

Operaciones de cadena:

  • -n CADENA la longitud de CADENA es distinta de cero
  • CADENA equivalente a -n CADENA
  • -z CADENA la longitud de CADENA es cero
  • CADENA1 = CADENA2 las cadenas son iguales
  • CADENA1 != CADENA2 las cadenas no son iguales

Comparaciones de enteros:

  • ENTERO1 -eq ENTERO2 ENTERO1 es igual a ENTERO2
  • ENTERO1 -ge ENTERO2 ENTERO1 es mayor o igual que ENTERO2
  • ENTERO1 -gt ENTERO2 ENTERO1 es mayor que ENTERO2
  • ENTERO1 -le ENTERO2 ENTERO1 es menor o igual que ENTERO2
  • ENTERO1 -lt ENTERO2 ENTERO1 es menor que ENTERO2
  • ENTERO1 -ne ENTERO2 ENTERO1 no es igual a ENTERO2

Operaciones de archivo:

  • ARCHIVO1 -ef ARCHIVO2 ARCHIVO1 y ARCHIVO2 tienen los mismos números de dispositivo e inode

  • ARCHIVO1 -nt ARCHIVO2 ARCHIVO1 es más nuevo (fecha de modificación) que ARCHIVO2

  • ARCHIVO1 -ot ARCHIVO2 ARCHIVO1 es más viejo que ARCHIVO2

  • -b ARCHIVO ARCHIVO existe y es especial de bloque

  • -c ARCHIVO ARCHIVO existe y es especial de carácter

  • -d ARCHIVO ARCHIVO existe y es un directorio

  • -e ARCHIVO ARCHIVO existe

  • -f ARCHIVO ARCHIVO existe y es un archivo regular

  • -g ARCHIVO ARCHIVO existe y tiene set-group-ID

  • -G ARCHIVO ARCHIVO existe y es propiedad del ID de grupo efectivo

  • -h ARCHIVO ARCHIVO existe y es un enlace simbólico (igual que -L)

  • -k ARCHIVO ARCHIVO existe y tiene su bit pegajoso establecido

  • -L ARCHIVO ARCHIVO existe y es un enlace simbólico (igual que -h)

  • -N ARCHIVO ARCHIVO existe y ha sido modificado desde que fue leído por última vez

  • -O ARCHIVO ARCHIVO existe y es propiedad del ID de usuario efectivo

  • -p ARCHIVO ARCHIVO existe y es una tubería con nombre

  • -r ARCHIVO ARCHIVO existe y se otorga permiso de lectura

  • -s ARCHIVO ARCHIVO existe y tiene un tamaño mayor que cero

  • -S ARCHIVO ARCHIVO existe y es un socket

  • -t FD el descriptor de archivo FD está abierto en un terminal

  • -u ARCHIVO ARCHIVO existe y su bit set-user-ID está establecido

  • -w ARCHIVO ARCHIVO existe y se otorga permiso de escritura

  • -x ARCHIVO ARCHIVO existe y se otorga permiso de ejecución (o búsqueda)

Excepto por -h y -L, todas las pruebas relacionadas con ARCHIVO desreferencian (siguen) enlaces simbólicos. Tenga cuidado que los paréntesis necesitan ser escapados (ej., por barras invertidas) para shells. ENTERO también puede ser -l CADENA, que evalúa a la longitud de CADENA.

NOTA: Los -a y -o binarios son inherentemente ambiguos. Use test EXPR1 && test EXPR2 o test EXPR1 || test EXPR2 en su lugar. NOTA: [ respeta las opciones –help y –version, pero test no. test trata cada una de esas como trata cualquier otra CADENA no vacía. NOTA: su shell puede tener su propia versión de test y/o [, que usualmente reemplaza la versión descrita aquí. Por favor consulte la documentación de su shell para detalles sobre las opciones que soporta.

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
timeout [OPCIÓN] DURACIÓN COMANDO...

Iniciar COMANDO, y terminarlo si aún se está ejecutando después de DURACIÓN.

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

Al agotarse el tiempo, envía la señal TERM a COMANDO, si no se especifica otra SEÑAL. La señal TERM mata cualquier proceso que no bloquee ni capture esa señal. Puede ser necesario usar la señal KILL, ya que esta señal no se puede capturar.

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
touch [OPCIÓN]... [ARCHIVO]...

Actualizar los tiempos de acceso y modificación de cada ARCHIVO al tiempo actual.

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

Crea los archivos especificados:

touch {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Establece los tiempos de [a]cceso o [m]odificación al momento actual y no [c]rea un archivo si este no existe:

touch {{[-c|--no-create]}} -{{a|m}} {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Establece los [t]iempos de un archivo a un valor específico y no [c]rea el archivo si no existe:

touch {{[-c|--no-create]}} -t {{YYYYMMDDHHMM.SS}} {{ruta/al/archivo1 ruta/al/archivo2 ...}}

Usa los tiempos de un archivo de [r]eferencia para establecer los tiempos en otro archivo y no [c]rea el archivo si no existe:

touch {{[-c|--no-create]}} {{[-r|--reference]}} {{ruta/al/archivo/de/referencia}} {{ruta/al/archivo1 ruta/al/archivo2 ...}}

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
tr [OPCIÓN]... CONJUNTO1 [CONJUNTO2]

Traducir o eliminar caracteres

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

Traducir, comprimir y/o eliminar caracteres de entrada estándar, escribiendo a salida estándar.

Examples

Sustituye todas las apariciones de un carácter en un archivo e imprime el resultado:

tr <{{ruta/al/archivo}} {{find_character}} {{replace_character}}

Sustituye todas las apariciones de un carácter de la salida de otro comando:

echo {{text}} | tr {{find_character}} {{replace_character}}

Mapea cada carácter del primer conjunto al carácter correspondiente del segundo:

tr <{{ruta/al/archivo}} '{{abcd}}' '{{jkmn}}'

Elimina todas las apariciones del conjunto de caracteres especificado de la entrada:

tr <{{ruta/al/archivo}} {{[-d|--delete]}} '{{input_characters}}'

Comprime una serie de caracteres idénticos a un solo carácter:

tr <{{ruta/al/archivo}} {{[-s|--squeeze-repeats]}} '{{input_characters}}'

Traduce el contenido de un archivo a mayúsculas:

tr <{{ruta/al/archivo}} "[:lower:]" "[:upper:]"

Elimina los caracteres no imprimibles de un archivo:

tr <{{ruta/al/archivo}} {{[-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

v0.13.0
Devuelve verdadero, un estado de salida exitoso.

Inmediatamente devuelve el estado de salida 0, excepto cuando se invoca con una de las opciones reconocidas. En esos casos intentará escribir el texto de ayuda o versión. Cualquier error de E/S durante esta operación hace que el programa devuelva 1 en su lugar.

Options

--help

Print help information

--version

Print version information

Examples

Devuelve un código de salida satisfactorio:

true

Hace que un comando siempre finalice con 0:

{{comando}} || 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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
truncate [OPCIÓN]... [ARCHIVO]...

Reducir o extender el tamaño de cada archivo al tamaño especificado.

Options

--io-blocks, -o

tratar TAMAÑO como el número de bloques de E/S del archivo en lugar de bytes (NO IMPLEMENTADO)

--no-create, -c

no crear archivos que no existen

--reference=<RFILE>, -r <RFILE>

basar el tamaño de cada archivo en el tamaño de RARCHIVO

--size=<SIZE>, -s <SIZE>

establecer o ajustar el tamaño de cada archivo según TAMAÑO, que está en bytes a menos que se especifique –io-blocks

TAMAÑO es un entero con un prefijo opcional y unidad opcional. Las unidades disponibles (K, M, G, T, P, E, Z, e Y) usan el siguiente formato: ‘KB’ => 1000 (kilobytes) ‘K’ => 1024 (kibibytes) ‘MB’ => 10001000 (megabytes) ‘M’ => 10241024 (mebibytes) ‘GB’ => 100010001000 (gigabytes) ‘G’ => 102410241024 (gibibytes) TAMAÑO también puede tener uno de los siguientes prefijos para ajustar el tamaño de cada archivo basado en su tamaño actual: ‘+’ => extender por ‘-’ => reducir por ‘<’ => a lo más ‘>’ => al menos ‘/’ => redondear hacia abajo a múltiplo de ‘%’ => redondear hacia arriba a múltiplo de

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
tsort [OPCIONES] ARCHIVO

Ordenamiento topológico de las cadenas en ARCHIVO. Las cadenas se definen como cualquier secuencia de tokens separados por espacios en blanco (tabulación, espacio, o nueva línea), ordenándolos basado en dependencias en un grafo acíclico dirigido (DAG). Útil para programación y determinar orden de ejecución. Si ARCHIVO no se pasa, se usa stdin en su lugar.

Options

-w

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
tty [OPCIÓN]...

Imprimir el nombre de archivo del terminal conectado a la entrada estándar.

Options

--silent, --quiet, -s

no imprimir nada, solo devolver un estado de salida

Examples

Muestra el nombre del archivo de este 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

v0.13.0
uname [OPCIÓN]...

Mostrar cierta información del sistema. Sin OPCIÓN, igual que -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

Muestra el nombre del kernel:

uname

Muestra toda la información disponible del sistema:

uname {{[-a|--all]}}

Muestra la arquitectura del sistema y la información del procesador:

uname {{[-mp|--machine --processor]}}

Muestra el nombre del kernel, el release y la versión:

uname {{[-srv|--kernel-name --kernel-release --kernel-version]}}

Muestra el nombre del host del sistema:

uname {{[-n|--nodename]}}

Muestra el nombre del sistema operativo actual:

uname {{[-o|--operating-system]}}

Muestra la ayuda:

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

v0.13.0
unexpand [OPCIÓN]... [ARCHIVO]...

Convertir espacios en blanco en cada ARCHIVO a tabulaciones, escribiendo a la salida estándar. Sin ARCHIVO, o cuando ARCHIVO es -, leer entrada estándar.

Options

--all, -a

convertir todos los espacios en blanco, en lugar de solo los espacios en blanco iniciales

--first-only, -f

convertir solo secuencias iniciales de espacios en blanco (anula -a)

--tabs=<N, LIST>, -t <N, LIST>

usar LISTA separada por comas de posiciones de tabulación o tener tabulaciones separadas por N caracteres en lugar de 8 (habilita -a)

--no-utf8, -U

interpretar archivo de entrada como ASCII de 8-bit en lugar de UTF-8

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

Some strings on this page have not been translated yet. You can help by translating them on Weblate.
v0.13.0
uniq [OPCIÓN]... [ENTRADA [SALIDA]]

Reportar u omitir líneas repetidas.

Options

-D

print all duplicate lines

--all-repeated=<delimit-method>

mostrar todas las líneas duplicadas. La delimitación se hace con líneas en blanco. [por defecto: none]

--group=<group-method>

mostrar todos los elementos, separando grupos con una línea vacía. [por defecto: separate]

--check-chars=<N>, -w <N>

comparar no más de N caracteres en las líneas

--count, -c

prefijar líneas por el número de ocurrencias

--ignore-case, -i

ignorar diferencias de mayúsculas al comparar

--repeated, -d

solo mostrar líneas duplicadas

--skip-chars=<N>, -s <N>

evitar comparar los primeros N caracteres

--skip-fields=<N>, -f <N>

evitar comparar los primeros N campos

--unique, -u

solo mostrar líneas únicas

--zero-terminated, -z

terminar líneas con byte 0, no nueva línea

Filtrar líneas coincidentes adyacentes de ENTRADA (o entrada estándar), escribiendo a SALIDA (o salida estándar).

Nota: uniq no detecta líneas repetidas a menos que sean adyacentes. Puede que quiera ordenar la entrada primero, o usar sort -u sin uniq.

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
unlink ARCHIVO
unlink OPCIÓN

Desenlazar el archivo en ARCHIVO.

Options

Examples

The examples have not been translated yet and are shown in English. You can help by translating them on tldr-pages.

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

v0.13.0
uptime [OPCIÓN]…

Exhibe la hora actual, la longitud del tiempo del sistema ha estado activo, el número de usuarios dentro del sistema, y el número promedio de tareas en la cola de ejecución durante los últimos 1, 5 y 15 minutos.

Options

--since, -s

system up since

--pretty, -p

show uptime in pretty format

file to search boot time from

Examples

Imprime la hora actual, el tiempo de encendido, el número de usuarios conectados y otros datos:

uptime

Muestra solo el tiempo que el sistema ha estado encendido:

uptime {{[-p|--pretty]}}

Imprime la fecha y hora en que el sistema se encendió:

uptime {{[-s|--since]}}

Muestra los datos de tiempo en segundos:

uptime {{[-r|--raw]}}

Muestra la versión:

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

v0.13.0
users [ARCHIVO]

Imprimir los nombres de usuario de usuarios actualmente conectados al host actual.

Options

Examples

Imprime los nombres de usuario conectados:

users

Muestra los nombres de usuario conectados según un archivo determinado:

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

v0.13.0

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

Vea la documentación del comando original:

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

v0.13.0
wc [OPCIÓN]... [ARCHIVO]...

Mostrar conteos de nueva línea, palabra y byte para cada ARCHIVO, y una línea total si se especifica más de un ARCHIVO.

Options

--bytes, -c

mostrar los conteos de bytes

--chars, -m

mostrar los conteos de caracteres

--files0-from=<F>

leer entrada de los archivos especificados por
nombres terminados en NUL en el archivo F;
Si F es - entonces leer nombres de entrada estándar

--lines, -l

mostrar los conteos de nueva línea

--max-line-length, -L

mostrar la longitud de la línea más larga

--total=<WHEN>

cuándo mostrar una línea con conteos totales;
CUÁNDO puede ser: auto, always, only, never

--words, -w

mostrar los conteos de palabras

--debug

Examples

Cuenta todas las líneas en un archivo:

wc {{[-l|--lines]}} {{ruta/al/archivo}}

Cuenta todas las palabras en un archivo:

wc {{[-w|--words]}} {{ruta/al/archivo}}

Cuenta todos los bytes en un archivo:

wc {{[-c|--bytes]}} {{ruta/al/archivo}}

Cuenta todos los caracteres en un archivo (considerando los caracteres de varios bytes):

wc {{[-m|--chars]}} {{ruta/al/archivo}}

Cuenta todas las líneas, palabras y bytes desde stdin:

{{find .}} | wc

Cuenta la longitud de la línea más larga en número de caracteres:

wc {{[-L|--max-line-length]}} {{ruta/al/archivo}}

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

v0.13.0
who [OPCIÓN]... [ ARCHIVO | ARG1 ARG2 ]

Imprimir información sobre usuarios que están actualmente conectados.

Options

--all, -a

igual que -b -d –login -p -r -t -T -u

--boot, -b

hora del último arranque del sistema

--dead, -d

imprimir procesos muertos

--heading, -H

imprimir línea de encabezados de columna

--login, -l

imprimir procesos de inicio de sesión del sistema

--lookup

intentar canonicalizar nombres de host vía DNS

-m

solo nombre de host y usuario asociado con stdin

--process, -p

imprimir procesos activos generados por init

--count, -q

todos los nombres de inicio de sesión y número de usuarios conectados

--runlevel, -r

imprimir nivel de ejecución actual

--short, -s

imprimir solo nombre, línea y hora (predeterminado)

--time, -t

imprimir último cambio de reloj del sistema

--users, -u

listar usuarios conectados

--mesg, --message, --writable, -T, -w

agregar estado de mensaje del usuario como +, - o ?

Examples

Muestra el nombre de usuario, la línea y la hora de todas las sesiones conectadas actualmente:

who

Muestra toda la información disponible:

who {{[-a|--all]}}

Muestra toda la información disponible con encabezados de tabla:

who {{[-aH|--all --heading]}}

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

v0.13.0
whoami

Mostrar el nombre de usuario actual.

Options

Examples

Vea la documentación del comando original:

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

v0.13.0
yes [CADENA]...

Mostrar repetidamente una línea con CADENA (o ‘y’)

Options

Examples

Retorna repetidamente “y”:

yes

Retorna repetidamente “mensaje”:

yes {{mensaje}}

Acepta todas las confirmaciones que muestre el comando apt-get:

yes | sudo apt-get install {{programa}}

Retorna repetidamente una nueva línea para aceptar siempre la opción predeterminada de una pregunta (prompt):

yes ''

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.