https://github.com/passcod/ct
Cats files, lists dirs
https://github.com/passcod/ct
Last synced: 9 months ago
JSON representation
Cats files, lists dirs
- Host: GitHub
- URL: https://github.com/passcod/ct
- Owner: passcod
- License: mit
- Created: 2019-12-10T08:56:29.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2020-06-02T23:45:54.000Z (over 5 years ago)
- Last Synced: 2025-03-31T13:27:27.673Z (10 months ago)
- Language: Rust
- Homepage:
- Size: 17.6 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# $ ct
[](https://github.com/passcod/ct/releases)
[](./LICENSE)
[](https://travis-ci.com/passcod/ct)


_Cats files, lists dirs._
Tiny tool that lists directories and prints files. Replacement for cat and ls
all in one. Uses [exa] to list files, and accepts all its options.
[exa]: https://the.exa.website
## Install
Pre-built binaries are available [on the Github Releases tab](https://github.com/passcod/ct/releases).
From source:
```bash
$ cargo install --force --git https://github.com/passcod/ct --branch main
```
Or clone and build with `$ cargo build --release` then place in your $PATH.
## Usage
Use it like you would cat and ls (or rather [exa]), except you never again have
to switch which based on what the target is:
```bash
$ ct file
all of the
file contents
$ ct dir
a-file a-folder an-archive.tar.xz etc-etc-etc
```
Passed nothing, it lists the working directory:
```bash
$ ct
bin README.md target Cargo.lock Cargo.toml src
```
Passed multiple arguments, it acts on each in turn:
```bash
$ ct file dir
=> file <=
all of the
file contents
=> dir <=
a-file a-folder an-archive.tar.xz etc-etc-etc
```
Given [exa] options, it formats listings:
```bash
$ ct -l
drwxr-xr-x - passcod 10 Dec 21:33 bin
.rw-r--r-- 23k passcod 10 Dec 21:27 Cargo.lock
.rw-r--r-- 558 passcod 10 Dec 21:21 Cargo.toml
.rw-r--r-- 9.0k passcod 10 Dec 21:19 LICENSE
.rw-r--r-- 14k passcod 10 Dec 21:38 README.md
drwxr-xr-x - passcod 10 Dec 21:14 src
drwxr-xr-x - passcod 10 Dec 21:35 target
```
If it encounters errors, it will attempt to skip and continue as best it can:
```bash
$ ct forbidden allowed /dev/sda /proc/filesystems
failed to open file: forbidden
Permission denied (os error 13)
=> allowed <=
yes you can look here
not a dir or regular file: /dev/sda
=> /proc/filesystem <=
nodev sysfs
nodev tmpfs
nodev bdev
nodev proc
nodev cgroup
...
```
If something fails, it will exit with the last non-zero code it got.
## Windows support?
[Unfortunately not yet](https://github.com/ogham/exa/issues/32).