Hasty Briefsbeta

Bilingual

PSA about abuse of cat(1) command. Don't abuse cats

4 hours ago
  • #cat abuse
  • #command-line efficiency
  • #Unix tools
  • Piping a single file through 'cat' to another command is inefficient as it spawns an extra process, while tools like 'grep', 'head', 'awk', and 'sort' can directly read files.
  • The website abuseofcats.com humorously criticizes unnecessary use of 'cat' with examples like 'grep -v '^#' /etc/app/config' being more humane and efficient than 'cat /etc/app/config | grep -v '^#''.
  • Examples show better alternatives to common 'cat' abuses: using input redirection for 'wc -l', direct file arguments for 'head', 'awk', and 'sort', emphasizing that 'cat' is meant for concatenating files, not single-file piping.