Tag Archives: sed

One Line Linux Command to Print Out Directory Tree Listing 4

My professor sent us this little one liner (ok, I had to format it to 2 lines to fit in this blog. You know what I mean) which prints out the current directory tree:
ls -R | grep “:$” | sed -e ’s/:$//’ -e ’s/[^-][^\/]*\//–/g’ \
-e ’s/^/ /’ -e ’s/-/|/’
What’s going on here?

Set Operations Using Bash Commands 2

Found a great post over at good coders code, great reuse. This one deals with performing operations on sets using only unix (bash) command line operations on files of text.
* Set Membership. Test if an element belongs to a set.
* Set Equality. Test if two sets [...]