- No shell features are involved.
- Only outputs to
stdout
.
cat file.txtawk 1 file.txtpaste file.txtpv -q file.txtpr -t file.txtsed b file.txtgrep ^ file.txtgrep $ file.txtsed'' file.txtgrep'' file.txtsort -m file.txtlook'' file.txtjq -rR. file.txtsed -n p file.txtcut -b 1- file.txtjq -jRs. file.txtperl -pe1 file.txttail -n +1 file.txthead -n -0 file.txt# GNU headcp file.txt /dev/fd/1gcc -E -P -xc file.txtscp file.txt /dev/fd/1column -t -l 1 file.txtcomm file.txt /dev/null# BSD commw3m -dump_source file.txtdd status=none if=file.txt# GNU ddhexdump -ve'"%c"' file.txtsplit --filter=tee file.txt# GNU splitjoin -a 1 file.txt /dev/nullopenssl enc -none -in file.txtcurl file:///proc/self/cwd/file.txtgit -P grep --no-index -h ^ file.txtshuf --random-source=/dev/zero file.txtbat --color=never --style=plain file.txtdiff --line-format=%L /dev/null file.txtvim -es --clean'+w! /dev/fd/1''+q!' file.txtpython -c'print(open("file.txt").read()[:-1])'ffmpeg -v quiet -f data -i file.txt -map 0:0 -c text -f data -emacs -Q --batch --eval'(princ (with-temp-buffer (insert-file-contents "file.txt") (buffer-string)))'
- Can use shell feature like pipes, redirect etc to work.
tee< file.txt< file.txt>&1# assuming zsh and default NULLCMDtr a a< file.txtrev file.txt| revtac file.txt| tacecho',p'| ed -s file.txtxxd -p file.txt| xxd -p -r
- May not handle every character.
- May not handle every file length.
sed'/*/p' file.txtgcc -E -P -xc file.txt
- Same as "Pure league", but errors on
stdout
and/orstderr
are acceptable.
dd if=file.txtgcc -xc file.txt
- Same as "Error league", but most of the output bytes are from the file.
m4 file.txt# Does not handle lines that starts with `#` or looks like definitions.fold file.txt# Works for files without long lineswall -n file.txt# I hope your file doesn't have any secretsuniq -Dw0 file.txt# Doesn't work for single-line filesxargs -d\n -a a.txtecho# Ends up with a trailing newlinemore -e -n 65535 file.txt# Works for files with less than 65k lines.nl -bn -w 1 -s'' file.txt# Each line has an extra spacewhileread l;doecho$l;done< file.txt# See emanuele6's comment: https://github.com/wader/catgolf/pull/63#issuecomment-2164030897