Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkdika/lff-cr
Simple and straightforward large files finder utility
https://github.com/mkdika/lff-cr
crystal finder large-files linux osx unix-shell utility
Last synced: about 1 month ago
JSON representation
Simple and straightforward large files finder utility
- Host: GitHub
- URL: https://github.com/mkdika/lff-cr
- Owner: mkdika
- License: mit
- Created: 2020-05-02T04:56:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-15T02:23:32.000Z (over 3 years ago)
- Last Synced: 2024-11-02T13:42:14.978Z (about 1 month ago)
- Topics: crystal, finder, large-files, linux, osx, unix-shell, utility
- Language: Crystal
- Homepage:
- Size: 671 KB
- Stars: 17
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - lff - Simple and straightforward large files finder utility in command line (CLI Utils)
README
# lff-cr
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](/LICENSE)
[![Built with Crystal](https://img.shields.io/badge/built%20with-crystal-000000.svg?style=flat-square)](https://crystal-lang.org/)
[![Build Status](https://travis-ci.org/mkdika/lff-cr.svg?branch=master)](https://travis-ci.org/mkdika/lff-cr)
[![Latest release](https://img.shields.io/github/release/mkdika/lff-cr.svg)](https://github.com/mkdika/lff-cr/releases)
[![lff](https://snapcraft.io//lff/badge.svg)](https://snapcraft.io/lff)Simple and straightforward large files finder utility for *nix, optimize for human.
## Why?
There are workarounds about how to do it on *nix, for instance is using combination of `find`, `du`, `sort`, `head`.
```bash
find /your/directory -xdev -type f -exec du -sh {} ';' | sort -rh | head -n10
# will printout the top 10 largest files size within given directory
```But I'm to lazy to memorize them all :sweat_smile: I need a simpler solution instead!
```bash
# my way
lff /your/directory
```## Benchmark
I simple benchmarking with `time`, with searching the top largest files within moderate Java project directory and about 11.901 files:
```bash
# with: find, du, sort, head
find /my/project/directory -xdev -type f -exec du -sh {} ';' 6.63s user 14.03s system 85% cpu 24.131 total
sort -rh 0.08s user 0.07s system 0% cpu 24.145 total
head -n10 0.00s user 0.00s system 0% cpu 24.141 total
``````bash
# with: lff
./lff /my/project/directory 0.05s user 0.25s system 92% cpu 0.328 total
```It is faster!
_NOTE: Benchmarking is run on MBP2018 13" OSX 10.15.4._
## Installation
### MacOS
```bash
brew tap mkdika/brew
brew install lff
```### Linux via [snap](https://snapcraft.io/)
For more on installing & using `snap` with your Linux distribution, see the [official documentation](https://docs.snapcraft.io/installing-snapd).
```bash
snap install lff
```## Build from source
Install [Crystal](https://crystal-lang.org/install/) language.
```bash
git clone https://github.com/mkdika/lff-cr.git
cd lff-cr/
shards build --production --release
```The built binary will be available as `./bin/lff`
## Usage
```bash
# lff
lff ~/Downloads
# or simple `lff` only to run at current directory.
```## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Maikel Chandika](https://github.com/mkdika) - creator and maintainer
## Copyright and License
Copyright 2020 - 2021 Maikel Chandika ([email protected]). Code released under the MIT License. See [LICENSE](/LICENSE) file.