A Rust implementation of the classic Unix ls command.
rls aims to recreate the functionality of the ls command using Rust. This project serves as a learning exercise.
Note: This is a project for personal studies on how the file system API in rust functions.
The goal is to implement the following ls options:
-
rls: List all non-hidden files and directories in the current directory -
rls -a: List all files and directories, including hidden ones -
rls -A: List all files and directories except.and.. -
rls -l: Use long listing format -
rls -h: Print sizes in human-readable format (e.g., 1K, 234M, 2G) -
rls -R: List subdirectories recursively -
rls -d: List directories themselves, not their contents -
rls -r: Reverse order while sorting -
rls -S: Sort by file size, largest first -
rls -t: Sort by modification time, newest first -
rls -X: Sort alphabetically by entry extension
The implementation supports argument chaining. So you can use the command
rls -a -h -Xto list all files and directories sorted alphabetically and in a human readible format.