Giter Site home page Giter Site logo

util-linux's Introduction

Crates.io Discord License dependency status

CodeCov

util-linux

This projects aims at doing the same as https://github.com/uutils/coreutils for util-linux.

We are rewriting these tools in Rust as drop-in replacements.

First, reimplement the most important tools from util-linux:

System Information

  • dmesg: Displays kernel messages.
  • lscpu: Shows CPU architecture information. Started
  • lsipc: Lists IPC facilities.
  • lslocks: Lists system locks.
  • lsmem: Lists memory ranges and status.
  • lsns: Lists namespaces.

Hardware Management

  • chcpu: Manages CPU state.
  • rtcwake: Manages system sleep states.
  • zramctl: Manages zram devices.
  • wdctl: Shows watchdog status.
  • chmem: Manages kernel memory usage.

Filesystem Tools

  • findmnt: Lists mounted filesystems.
  • mountpoint: Checks if a directory is a mountpoint. Started
  • fsck: Checks and repairs filesystems.
  • fsfreeze: Freezes/unfreezes filesystems.
  • fstrim: Discards unused blocks on filesystems.
  • wipefs: Wipes filesystem signatures.

Partition Management

  • blkdiscard: Discards sectors on a device.
  • blkid: Identifies block device attributes.
  • blkzone: Manages zoned block device parameters.
  • blockdev: Performs block device operations.
  • mkswap: Sets up swap space.
  • swaplabel: Manages swap space labels.
  • addpart: Adds a partition.
  • delpart: Deletes a partition.
  • partx: Manages partition entries.
  • resizepart: Resizes a partition.

Process and Resource Management

  • runuser: Runs a shell with different user/group IDs.
  • sulogin: Provides single-user mode login.
  • chrt: Manages real-time process attributes.
  • ionice: Sets process I/O scheduling class/priority.
  • kill: Sends signals to processes.
  • renice: Alters process priority.
  • prlimit: Sets/gets process resource limits.
  • taskset: Sets/gets process CPU affinity.
  • uclampset: Manages process utilization clamping.

User and Session Management

  • su: Changes user ID or becomes superuser.
  • agetty: Manages TTYs for login prompts.
  • ctrlaltdel: Configures Ctrl-Alt-Del action.
  • pivot_root: Changes the root filesystem.
  • switch_root: Switches to a different root filesystem.
  • last: Lists last logged-in users.
  • lslogins: Displays user information.
  • mesg: Controls write access to terminal.
  • setsid: Runs a program in a new session.
  • setterm: Sets terminal attributes.
  • getty: Manages virtual console login prompts.

Networking and IPC

  • ipcmk: Creates IPC resources.
  • ipcrm: Removes IPC resources.
  • ipcs: Shows IPC facilities status.
  • nsenter: Enters different namespaces.

Utility Tools

  • lsblk: Lists block devices.
  • fallocate: Preallocates file space.
  • flock: Manages file locks.
  • getopt: Parses command options.
  • hardlink: Creates hard links.
  • mcookie: Generates random numbers.
  • namei: Follows a pathname to its endpoint.
  • rename.ul: Renames files.
  • rev: Reverses lines in a file.
  • setarch: Sets architecture emulation.
  • setpriv: Runs a program with different privileges.
  • unshare: Runs a program with unshared namespaces.
  • utmpdump: Dumps UTMP/WTMP files.
  • whereis: Locates binaries, sources, and manuals.
  • ldattach: Attaches line discipline to a serial line.
  • readprofile: Reads kernel profiling info.
  • i386, linux32, linux64, x86_64: Set personality flags for execution environment.

Note:

Project: http://www.kernel.org/pub/linux/utils/util-linux/

Installation

Ensure you have Rust installed on your system. You can install Rust through rustup.

Clone the repository and build the project using Cargo:

git clone https://github.com/uutils/util-linux.git
cd util-linux
cargo build --release
cargo run --release

License

util-linux is licensed under the MIT License - see the LICENSE file for details

util-linux's People

Contributors

sylvestre avatar cakebaker avatar renovate[bot] avatar jonathonreinhart avatar dependabot[bot] avatar

Stargazers

nexryai avatar GreyXor avatar Adam Safitra avatar John Magdy Lotfy Kamel avatar Malte Poll avatar Akmal avatar Larson T. avatar  avatar

Watchers

 avatar  avatar  avatar

util-linux's Issues

Implement program `lsipc`

       lsipc - show information on IPC facilities currently employed in the system

example on my system:

RESOURCE DESCRIPTION                                              LIMIT  USED  USE%
MSGMNI   Number of message queues                                 32000     0 0.00%
MSGMAX   Max size of message (bytes)                                 8K     -     -
MSGMNB   Default max size of queue (bytes)                          16K     -     -
SHMMNI   Shared memory segments                                    4096     3 0.07%
SHMALL   Shared memory pages                       18446744073692774399 16576 0.00%
SHMMAX   Max size of shared memory segment (bytes)                  16E     -     -
SHMMIN   Min size of shared memory segment (bytes)                   1B     -     -
SEMMNI   Number of semaphore identifiers                          32000     0 0.00%
SEMMNS   Total number of semaphores                          1024000000     0 0.00%
SEMMSL   Max semaphores per semaphore set.                        32000     -     -
SEMOPM   Max number of operations per semop(2)                      500     -     -
SEMVMX   Semaphore max value                                      32767     -     -

Implement `getopt`

getopt is a GNU-specific command, which is still missing from uutils.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update rust crate rand to 0.8.5
  • chore(deps): update rust crate sysinfo to 0.30.11
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • pretty_assertions 1
  • procfs 0.16
  • rlimit 0.10.1
  • uucore 0.0.25
  • clap 4.4
  • clap_complete 4.4
  • clap_mangen 0.2
  • regex 1.10.2
  • sysinfo 0.30
  • libc 0.2.152
  • phf 0.11.2
  • phf_codegen 0.11.2
  • textwrap 0.16.0
  • xattr 1.3.1
  • tempfile 3.9.0
  • rand 0.8
src/uu/lscpu/Cargo.toml
src/uu/mountpoint/Cargo.toml
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • codecov/codecov-action v3

  • Check this box to trigger a request for Renovate to run again on this repository

Implement program `lslocks`

       lslocks - list local system locks

example on my system:

COMMAND           PID  TYPE   SIZE MODE  M      START        END PATH
firefox-bin      4154 POSIX    10K WRITE 0 1073741826 1073742335 /home/sylvestre/.mozilla/firefox/hr52vsgc.default-nightly/storage/default/https+++calendar.google.com/ls/data.sqlite
firefox-bin      4154 POSIX   1.9M WRITE 0 1073741826 1073742335 /home/sylvestre/.mozilla/firefox/hr52vsgc.default-nightly/storage/default/https+++discord.com/ls/data.sqlite

Typo in "About" text

Currently, the "About" text is:

Rust reimplemtation of the util-linux project

It should be reimplementation instead of reimplemtation.

`lscpu`: Add option `--hex`

       -x, --hex
           Use hexadecimal masks for CPU sets (for example "ff"). The default is to print the
           sets in list format (for example 0,1). Note that before version 2.30 the mask has been
           printed with 0x prefix.

`lscpu`: Add option `--bytes`

       -B, --bytes
           Print the sizes in bytes rather than in a human-readable format.

           By default, the unit, sizes are expressed in, is byte, and unit prefixes are in power
           of 2^10 (1024). Abbreviations of symbols are exhibited truncated in order to reach a
           better readability, by exhibiting alone the first letter of them; examples: "1 KiB"
           and "1 MiB" are respectively exhibited as "1 K" and "1 M", then omitting on purpose
           the mention "iB", which is part of these abbreviations.

`lscpu`: Add option `--json`

       -J, --json
           Use JSON output format for the default summary or extended output (see --extended).
           For backward compatibility, JSON output follows the default summary behavior for
           non-terminals (e.g., pipes) where subsections are missing. See also --hierarchic.

Implement program `lsmem`

       lsmem - list the ranges of available memory with their online status

example on my system:

RANGE                                  SIZE  STATE REMOVABLE  BLOCK
0x0000000000000000-0x000000008fffffff  2.3G online       yes   0-17
0x0000000100000000-0x000000085fffffff 29.5G online       yes 32-267

Memory block size:       128M
Total online memory:    31.8G
Total offline memory:      0B

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.