Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'View a Lord of the Rings timeline easter egg in calendar' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View a Lord of the Rings timeline easter egg in calendar
Authored by: dhrakar on Jan 13, '04 08:55:42PM
Another perfectly valid reason to use cat foo | grep is when you need an alias for quickly getting information out of a log. For example, I have several aliases (I use the AT&T ksh for my shell) that look like:
alias gethist 'cat /var/log/foo.log | grep'
This allows me to type only gethist dude to grep 'dude' out of the foo.log log. Saves typing the log path out...

Another use is for looking into files that I do not have read permission on (I'm a user consultant here at work and frequently need to look at user and/or system files). Since I do not have sudo (e.g. root) access to the grep command, I often wind up doing sudo cat /root/owned/file | grep foo. This way only cat has to run as root.

[ Reply to This | # ]
View a Lord of the Rings timeline easter egg in calendar
Authored by: fuerst on Jan 15, '04 06:14:17AM
alias gethist 'grep \!^ /var/log/foo.log' would do the same, but optimized.

[ Reply to This | # ]
View a Lord of the Rings timeline easter egg in calendar
Authored by: fuerst on Jan 15, '04 06:17:09AM
Try
alias gethist 'grep \!^ /var/log/system.log'
. I forgot the backslash away in my first post..

[ Reply to This | # ]