https://github.com/aditya-a-garwal/agfilesystemscanner
A nifty command line tool to scan and search through the filesystem and get the sizes of directories
https://github.com/aditya-a-garwal/agfilesystemscanner
cpp filesystem filesystem-library std
Last synced: 4 months ago
JSON representation
A nifty command line tool to scan and search through the filesystem and get the sizes of directories
- Host: GitHub
- URL: https://github.com/aditya-a-garwal/agfilesystemscanner
- Owner: Aditya-A-garwal
- License: gpl-3.0
- Created: 2022-08-04T06:04:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-28T09:26:24.000Z (almost 4 years ago)
- Last Synced: 2025-04-09T17:11:38.750Z (about 1 year ago)
- Topics: cpp, filesystem, filesystem-library, std
- Language: C++
- Homepage:
- Size: 124 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AgFileSystemScanner
[](https://github.com/Aditya-A-garwal/AgFileSystemScanner/issues)
[](https://github.com/Aditya-A-garwal/AgFileSystemScanner/network)
[](https://github.com/Aditya-A-garwal/AgFileSystemScanner/stargazers)
[](https://github.com/Aditya-A-garwal/AgFileSystemScanner)
This is a high performance, nifty, command-line tool written in c++ to navigate through the filesystem. It can be used to -
- Find Directories, Symlinks and Files by their full/partial name.
- Find the sizes of Directories recursively.
- Find permissions of Filesystem Entries (POSIX-style permissions only).
- General Navigation and exploration of the filesystem through the command-line.
## Usage
fss [PATH] [options] [-r [DEPTH]] [-S|--search|--search-noext|--contains PATTERN]
## Options
-r, --recursive Recursively scan directories (can be followed by a positive integer to indicate the depth)
-p, --permissions Show permissions of all entries
-t, --modification-time Show time of last modification of entries
-f, --files Show Regular Files (normally hidden)
-l, --symlinks Show Symlinks (normally hidden)
-s, --special Show Special Files such as sockets, pipes, etc. (normally hidden)
-d, --dir-size Recursively calculate and display the size of each directory
-a, --abs Show the absolute path of each entry without any indentation
-S, --search Only show entries whose name completely matches the following string completely
--search-noext Only show entries whose name(except for the extension) completely matches the following string completely
--contains Only show entries whose name contains the following string completely
-e, --show-err Show errors
-h, --help Print Usage Instructions
```PATH``` is the path to the directory from which to start the scan.
Only one of the search options(```-S```, ```--search```, ```--search-noext```, ```--contains```) can be set at a time.
The argument after the search flag is treated as the search pattern.
## Examples
Print the directories in the current directory, recursively going down two levels -
fss -r 2
Print the contents of ```/proc```, including files, symlinks and special files with their permissions -
fss "/proc" -f -l -s -p
Recursively search for all directories named ```proc``` in ```C://``` and show their sizes, last modification times -
fss "C:/" -r -d -t -S "proc"
## How to Build
### Dependencies
- Cmake (version 3.16 or above)
- Build system such as Make or Ninja
- Compiler with c++20 support
CMake has been used as a build system generator. Create a build directory in the root ```AgFileSystemScanner``` directory and run the following command to configure CMake -
cmake -S .. -B .
Then, to build the main executable, the following command can be run (in the build directory itself) -
cmake --build .
If the generator or compiler-toolchain needs to be changed, it can be done while configuring CMake. For example, to use NMake as a generator and GCC for compilation on Windows (instead of VS proj and the MSVC compiler), the command can be modified as follows -
cmake -S .. -B . -G "NMake Makefiles" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
The generated program is ```build/src/fss``` (on Linux/MacOS) or ```build/src/fss.exe``` (on Windows).
## How to generate Documentation
Doxygen has been used for documentating this project. The HTML files can be generated by running the following command in the ```docs``` directory -
doxygen config