joeldotdias / to-the-linux

A cli utility to execute Linux commands (with a few (definitely more than a few) tweaks) on Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ttl (To The Linux)

ttl is a lightweight command line utility that lets you execute Linux (or Unix based) commands on Windows. The syntax and output have been tweaked a little to be more understandable.
The intention behind making this project is simply to build a cli tool. This README is being written just in case anyone actually ends up using it. This will (hopefully) be my last project on Windows.

Usage

Every command is prefixed with ttl
A basic skeleton of each command would look like ttl <command> <opts>

  • cat

    • Reading a file
      ttl cat <filename> displays the contents of the file.

    • Writing to a file
      ttl cat to <filename> takes input from stdin and overwrite the contents of a file.
      ttl cat on <filename> takes input from stdin and appends it to the exisiting file contents.
      > and >> are not used simply because I have overwritten the file contents quite a few times when I intended to append. On the other hand, to and on make for a slightly more understandable syntax and might limit mistakes to some extent.
      Type :q to exit stdin and write to the file because Ctrl + D does not signify EOF on Windows.

    • Examples
      ttl cat example

  • wc

    • wc without any flags will return the number of lines, words and bytes in the file.
      wc <filename> displays lines, wordd and bytes in the flag
    • You can add -l, -w or -b to only get the info you need. Flags can be stacked to get multiple sets of info.
      wc -<flags> display only the info specified in the flags.
    • You can get info for multiple files simply by writing multiple files.
      wc -<flags> <filename 1> <filename 2> ... <filename n>
    • Examples
      ttl cat example

Piping

As of now, basic piping works. Example: Writing the word counts of multiple files to another file ttl cat example

About

A cli utility to execute Linux commands (with a few (definitely more than a few) tweaks) on Windows


Languages

Language:Rust 100.0%