Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here is a command that really opened my eyes to how cool sed, grep and piping are:

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

courtesy of this site: http://www.centerkey.com/tree/



This ties in nicely to the threads about the necessity of comments. :)

As a bonus, most (all?) of the sed commands are also usable in vi's ex mode (the : prompt).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: