Quick tricks to view, merge, and create files on the command line. 25.02.2026 | reading time: 2 min Want to peek into a file or glue several together? `cat` prints file contents to standard output and lets you concatenate files or create new ones with redirection, so use it whenever you need a fast, no-frills way to inspect or combine text. Hands-on: view and combine Do this in a shell to see `cat` in action: ```bash echo "First line" > a.txt echo "Second line" > b.txt cat a.txt cat a.txt b.txt > both.txt cat -n both.txt ``` Beyond simple display Try options and patterns that solve real tasks: `cat -n` numbers lines, `cat -A` reveals nonprinting characters, and appending with `>>` preserves files; create files with a here-doc for reproducible content: ```bash cat > note.txt <<'EOF' Line one Line two EOF cat note.txt ``` When cat is not enough For paging use `less`, for reversed output use `tac`, and for structured processing prefer `nl`, `sed` or `awk`; combine `cat` with pipes to feed further text-processing tools and keep each tool focused on its strength. Next steps and mastery `cat` is a tiny tool that unlocks bigger workflows when combined with redirection, pipes and text processors; practice these patterns, then deepen knowledge with focused courses and certified paths such as CompTIA Linux+ or LPIC-1 offered by intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. utilities filesystem scripting