fu
is a du
alike CLI. It comes with a set of new features and a better output. For example, it allows you to sort and limit the number of entries and provides a colorized output to highlight heaviest entries.
To install it using view, run the following commands:
brew tap Angelmmiguel/tap
brew install Angelmmiguel/tap/fu
Install fu
without brew
Run the following commands to:
- Download the file from the GitHub releases page
- Uncompress it
- Remove the quarantine attribute from MacOS
- Move the CLI binary to /usr/local/bin
- Remove any remaining file
curl -L \
https://github.com/Angelmmiguel/fu/releases/latest/download/fu-x86_64-apple-darwin.tar.gz \
-o /tmp/fu-x86_64-apple-darwin.tar.gz && \
tar -xvf /tmp/fu-x86_64-apple-darwin.tar.gz -C /tmp && \
xattr -d com.apple.quarantine /tmp/fu-x86_64-apple-darwin/fu && \
mv /tmp/fu-x86_64-apple-darwin/fu /usr/local/bin && \
rm -r /tmp/fu-x86_64-apple-darwin.tar.gz /tmp/fu-x86_64-apple-darwin
The xattr
call is required because downloaded binaries are marked as "quarantine" by MacOS. In addition to that, the system may block fu
CLI due to unknown signature. You can allow it by accessing the Security and Privacy system preference panel and clicking on the Allow anyway button.
This will install the fu
CLI in the /usr/local/bin
folder.
Run the following commands in a terminal:
curl -L \
https://github.com/Angelmmiguel/fu/releases/latest/download/fu-x86_64-unknown-linux-gnu.tar.gz \
-o /tmp/fu-x86_64-unknown-linux-gnu.tar.gz && \
tar -xvf /tmp/fu-x86_64-unknown-linux-gnu.tar.gz -C /tmp && \
mv /tmp/fu-x86_64-unknown-linux-gnu/fu /usr/local/bin && \
rm -r /tmp/fu-x86_64-unknown-linux-gnu.tar.gz /tmp/fu-x86_64-unknown-linux-gnu
This will install the fu
CLI in the /usr/local/bin
folder.
For Windows, please run the following commands to install it with Scoop:
scoop bucket add extras
scoop install fu
Install fu
without Scoop
Follow these steps:
- Download the latest release from the releases page
- Uncompress it
- Place the
fu.exe
binary in a folder that it's referenced in yourPATH
$ fu --help
fu
Search for a pattern in a file and display the lines that contain it
USAGE:
fu [OPTIONS] <PATH>
ARGS:
<PATH> The path to the file to read
OPTIONS:
-h, --help Print help information
--no-colors Disable the colors in the output
--no-header Hide the headers from the output
-s, --sort Sort the output based on the size
-t, --top <TOP> Sort and limit the output to the N heaviest entries
$ fu --sort ./
DISK BYTES PATH
258M 238M target
492K 71K .git
12K 11K LICENSE
8K 6K Cargo.lock
12K 4K src
4K 1K README.md
4K 361B Cargo.toml
4K 263B .github
4K 131B .gitignore
$ fu .
DISK BYTES PATH
259M 239M .
$ fu --top 2 ./
DISK BYTES PATH
258M 238M target
492K 71K .git
$ fu ./*.md
DISK BYTES PATH
4K 1K ./README.md
$ fu --top 2 --no-headers ./
258M 238M target
492K 71K .git
To develop fu
you need to install the Rust language on your environment:
Then, you need to clone the project and start exploring the CLI:
# Clone the repo
git clone https://github.com/Angelmmiguel/fu.git && cd fu
# Run the CLI (development) against the current folder
cargo run -- ./
# Run tests
cargo tests
# Build the CLI
cargo build
# Build using the release profile
cargo build --release
I developed fu
for two main reasons:
- I love to use small projects to learn new languages, frameworks, patterns, etc. So, I use
fu
as an excuse to start learning Rust language. - Try to offer an alternative and add missing features for well known CLIs I use everyday. I use
du
, although most of the times I combine it with other CLIs that helps me to filter and sort.
That's all! Feel free to request new features and let's discuss about how we can improve fu
:)
- Thanks to @Slach for including fu in the Scoop Extras repository (See #40)
fu
is released under the Apache License v2.0 (See LICENSE).
Copyright 2022 Angel M Miguel.