Tue 22 Jan 2008
Have you ever been surprised by obvious, even trivial facts which you have been overlooking for years?
Today it hit me:
I used shell metacharacters for expansion and even wrote quite complex bash scripts and used tree (not installed by default in ubuntu) to look into a given display depth of the directory tree. But a combination of ls and shell expansion can do quite the same:
ls */*
ls */*/*
Another interesting example from the same category is
echo */
to list all directories in working directory.
One more example – List only the directories :
ls -d */
works similiar to
find . -type d -maxdepth 1 -mindepth 1