Post4VPS Forum | Free VPS Provider
cat - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: Geek World (https://post4vps.com/Forum-Geek-World)
+--- Forum: Scripting & Programming (https://post4vps.com/Forum-Scripting-Programming)
+--- Thread: cat (/Thread-cat)



cat - catfan - 09-12-2015

cat is a popular command in unix. It has nothing to do with the animal but only maybe the inventors liked writing the name lots of times per day (many people do i think). I dont know but it is possible because they could have called it dog but did not do it. Also many people use cat and in over 40 years noone has tried renaming it to dog or anything else. Only Bill Gates made a cheap copy named type that is worse. Maybe he is alergic to some hair and dont want to be reminded. I dont know but it can be and enough with history now. Here is some useful example of how to use cat:

Basic usage (print some file):
Code:
cat /path/to/file

Inform yourself about your CPU:
Code:
cat /proc/cpuinfo

Write a file without any editor:
Code:
cat > /path/to/file

Continue write a file without any editor:
Code:
cat >> /path/to/file

Look at garbage (and maybe break terminal):
Code:
cat /dev/urandom

Get information about your OS:
Code:
cat /etc/issue /proc/version

Inspect your harddisk (only on linux as root and not recommended):
Code:
cat $( fdisk -l | grep 'Linux$' | sed 's/ .*//' )

Show every file on your system:
Code:
find / -type f -exec cat {} \;

Print message of the day:
Code:
cat /etc/motd

If you know some other good usage please post because i like this command very much!