Giter Site home page Giter Site logo

fu's Introduction

Overview

fu is a CLI tool to get different types of information about the files and directories and get is as fast as possible. It's in an experimental stage, so things might not work as expected and the API may change with each minor version upgrade.

Capabilities:

  • Count the number of files and directories in a given directory
  • Get the size of a directory and its subdirectories
    • Find the largest directories
  • Count the number of files groupped by extension
    • Count code files only
  • Count lines in a file(s)
  • Display a tree of directories and files in a given directory

Motivation

In the past few months I often needed to get different info about my file systems (Linux, Win, and sometimes OSX). du, df, ls, wc, find work well but have issues:

  • too slow on large volumes.
  • don't group/order things the way I needed - even via grep and sort.
  • limited functionality.
  • not cross-platform.

The alternatives:

  • du - too slow and not cross-platform; not the output I needed which made me to pipe it to several other commands.
  • fd - fast, cross-platform, but is very limited on the info it can extract.

Build and Run

cd /repo/folder

dotnet build
dotnet run --project .\FileInformation\FileInformation.Cli.csproj

Publish AOT

cd /repo/folder

dotnet publish -c Release

Install

It's only published to NuGet so far, so you can install it using the following command. I'm planning to publish it to Snap and Homebrew in the future + add an install.sh script to make it easier to install.

On Linux

dotnet tool install --global fileinformation.cli

Make sure you follow any additional directions printed to the screen. You may need to update your PATH variable in order to use .NET global tools.

On Windows

dotnet tool install --global fileinformation.cli

For PowerShell, the following command will enable UTF8 and Emoji support. You can add this to your profile.ps1 file:

[console]::InputEncoding = [console]::OutputEncoding = [System.Text.UTF8Encoding]::new()

On Mac

dotnet tool install --global fileinformation.cli

Make sure you follow any additional directions printed to the screen. You may need to update your PATH variable in order to use .NET global tools.

Usage

# Show help
fu -h
fu count -h
fu size -h
# Available commands
fu count [searchPath] [OPTIONS]
fu size [searchPath] [OPTIONS]
fu tree [searchPath] [OPTIONS]

Examples:

# Count the size of all files in the home directory and its subdirectories 
fu size ~/ -r --hidden

# Count the size of regular files in the current directory
fu size

# Count the size of all files in the current directory and its subdirectories and display the top 10 largest directories
fu size -r --hidden --head 10

# Display all direcotries and files in the current directory and its subdirectories
fu tree -r --hidden

fu's People

Contributors

iseiryu avatar

Stargazers

 avatar Matt DeMuth avatar sh4h31m avatar Peter Steele avatar Lucas Buccilli avatar  avatar

Watchers

 avatar

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.