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:
Pipe any output to "grep ." and blank lines will not be printed.
There are 6 alternatives - vote for the best!
Remove newlines from output.
One character shorter than awk /./ filename and doesn't use a superfluous cat.
To be fair though, I'm pretty sure fraktil was thinking being able to nuke newlines from any command is much more useful than just from one file.
?Cat and grep? You can use only grep ("grep \. filename"). Better option is awk.
The ^$ within the quotes is a regular expression: ^=beginning of line, $=end of line, with no characters between.
If you can do better, submit your command here.
You must be signed in to comment.