2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-17 09:25:32 +00:00
cheat.sheets/sheets/cat

17 lines
515 B
Plaintext
Raw Normal View History

2020-02-17 01:43:23 +00:00
# POSIX-ly correct way in which to cat(1); see cat(1posix).
cat -u [FILE_1 [FILE_2] ...]
2020-02-29 23:53:25 +00:00
# Output a file, expanding any escape sequences (default). Using this short
# one-liner let's you view the boot log how it was show at boot-time.
cat /var/log/boot.log
# This is an ever-popular useless use of cat.
cat /etc/passwd | grep '^root'
# The sane way:
grep '^root' /etc/passwd
# If in bash(1), this is often (but not always) a useless use of cat(1).
Buffer=`cat /etc/passwd`
# The sane way:
Buffer=`< /etc/passwd`