A lightweight console utility written in Java using only terminal that reads a text file, prints its content, and extracts comprehensive file metadata and text statistics.
This is a personal learning project built to achieve the following objectives:
- Practice core Java programming concepts, specifically file I/O operations (
java.nio). - Master version control workflows by interacting with Git entirely through the terminal (initializing repositories, staging changes, writing structured commit messages, managing
.gitignore, and pushing to GitHub).
- Content Streaming: Displays file contents directly in the console with explicit UTF-8 encoding support.
- Single-Pass Performance: Collects all text statistics efficiently in a single file read.
- Detailed Metadata:
- File timestamps (creation, last access, and last modification times).
- File attributes (type verification and read/write permission status).
- Formatted file size dynamically scaled to B, KB, or MB.
- Text metrics including precise line, word, and non-whitespace character counts.
-
Compile the source code (run from the project root directory):
javac -d bin src/Main.java
-
Execute the application by passing the path to a target file as an argument:
java -cp bin Main story.txt