cat - View Files in Linux

From the Linux Essential Commands cheat sheet · File Viewing & Editing · verified Jul 2026

cat - View Files

Display file contents, concatenate files, or create new files

bash
# Display file contents
cat file.txt

# Display multiple files
cat file1.txt file2.txt

# Display with line numbers
cat -n file.txt

# Create file with content
cat > newfile.txt
(type content, then Ctrl+D to save)
✅ Best for viewing small files
💡 -n adds line numbers to output
🔍 Use less or more for large files
filesviewdisplay

More Linux tasks

Back to the full Linux Essential Commands cheat sheet