Artificial intelligent assistant

Difference in cat sth vs cat < sth I realized that `cat sth` and `cat < sth` both happen to give same output. Are they the same?

They're not completely identical. In cases where it matters, the redirection approach will generally give more annoying and obscure results (of course that might be what you want though).


$ cat < /proc/self/maps
$ cat /proc/self/maps
55c61257e000-55c61258a000 r-xp 00000000 fd:00 1180143 /usr/bin/cat
...


Or try grep, the search program


$ grep "grep" /proc/self/exe
Binary file /proc/self/exe matches
$ grep "grep" < /proc/self/exe
$


Bit of a cheat, but you're most likely to run into this when using `sudo`, to run commands with `root` access:


$ sudo cat < /etc/shadow
bash: /etc/shadow: Permission denied
$ sudo cat /etc/shadow
root:!::0:99999:7:::
....

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy ad0bb99260ac513b1fbd554b5ff7bacc