commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
The better alternative to #9756.
I don't think I'd ever use the original command, but this one was so bad I had to post this. Sorry.
1. $(ls) is dumb, and will give errors if you have an alias like "ls -Fs"
2. clear is better and more portable than reset state.
3. if you're interested in differences, then use diff, not cat.
There are 4 alternatives - vote for the best!
Original submitted version would break if any filenames had whitespaces in them. The command is a Bad Idea anyhow, because you will end up `cat`ing a binary or something else specacularly bad.
no need for a for loop when cat takes multiple arguments
If you can do better, submit your command here.
You must be signed in to comment.