cat
Program: cat
Shows the contents of files.
Usage
cat [OPTION]... [FILE]...
Description
Print the contents of each FILE, one after the other. A FILE named -, or no FILE at all, means the keyboard or pipe.
Options in the simulator
10 more options of the real program, not in the simulator yet
Examples
cat "Documents/Holiday 2027.txt"
Where: the coast
When: July
Budget: 1200 cat notes.txt
Buy milk
Call the dentist
Water the plants cat Documents/Holiday\ 2027.txt
Where: the coast
When: July
Budget: 1200 cat notes.txt missing.txt
Buy milk
Call the dentist
Water the plants
cat: missing.txt: No such file or directory
cat notes.txt missing.txt 2>/dev/null
Buy milk
Call the dentist
Water the plants cat /etc/hostname
web-01
cat /etc/app/app.conf
# web-01
port = 8080
workers = 2
log_level = info
log_dir = /var/log/app cat /proc/meminfo
MemTotal: 15728640 kB
MemFree: 943718 kB
MemAvailable: 8703181 kB
Buffers: 307200 kB
Cached: 8500000 kB
SwapCached: 0 kB
Active: 0 kB
Inactive: 0 kB
Active(anon): 0 kB
Inactive(anon): 0 kB
Active(file): 0 kB
Inactive(file): 0 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 2097152 kB
SwapFree: 1887436 kB
Zswap: 0 kB
Zswapped: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 0 kB
Mapped: 0 kB
Shmem: 51200 kB
KReclaimable: 0 kB
Slab: 0 kB
SReclaimable: 0 kB
SUnreclaim: 0 kB
KernelStack: 0 kB
PageTables: 0 kB
SecPageTables: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 0 kB
Committed_AS: 0 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
Percpu: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
FileHugePages: 0 kB
FilePmdMapped: 0 kB
Unaccepted: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 0 kB
DirectMap2M: 0 kB
DirectMap1G: 0 kB cat -n todo.txt
1 1. tidy up Downloads
2 2. read the log Where you learn it
Lessons
- Paths: absolute, relative, ~ and .. Terminal start
- Looking into files: cat, less, head and tail Terminal start
- Faster Terminal start
- Chaining commands Terminal start
- Reading logs without drowning Linux Basics, Module 1: Survival basics
- Reading memory Linux Basics, Module 7: Memory and performance