wcat-command is a powerful CLI tool for displaying and manipulating file content directly in the terminal. It allows you to view and process files with various options for formatting and redirection.
- Display content of one or more files.
- Format output with line numbers or compact line breaks.
- Redirect output to files with options to overwrite or append.
Open your terminal and clone the repository:
git clone https://github.com/abhinab-choudhury/wcat-command.git
Change into the project directory:
cd wcat-command
Ensure the script is executable:
chmod +x index.cjs
Install the CLI tool globally for testing:
npm link
-
Display File Content:
wcat filepath
Displays the content of the specified file in the terminal.
-
Display Multiple Files:
wcat filepath1 filepath2 filepath3...
Concatenates and displays the content of multiple files in the specified order.
-
Convert Multiple Line Breaks to a Single Line Break:
wcat -s filepath
Removes extra blank lines, leaving only single line breaks.
-
Number All Lines:
wcat -n filepath
Adds line numbers to every line in the output.
-
Number Non-Empty Lines:
wcat -b filepath
Adds line numbers only to non-empty lines in the output.
-
Overwrite File: Redirect output to a file, creating it if it doesn't exist.
wcat filepath > filename2path
-
Append to File: Append output to an existing file.
wcat filepath >> filename2path
-
Remove Large Spaces and Save:
node wcat -s filename > filename2
Processes the file to remove extra spaces and saves the output to another file.
You can combine options to tailor the output to your needs. For example:
wcat -n -s filepath > filename2path
This command numbers all lines and removes extra line breaks, saving the result to filename2path
.
Contributions are welcome! Please fork the repository and submit a pull request with your improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.