How can I make the find command show a slash after directories? For example, I want dir to show up as dir/ instead of dir. I'm using find . -print
|
|
|||
|
|
|
Portably:
If you're willing to list directories and files separately (you can merge the output by sorting):
With GNU find, see Shawn J. Goff's answer. If you're willing to risk non-printable characters being mangled even when not outputting to a terminal, see ddeimeke's answer. In zsh: |
|||||
|
|
Maybe
is an option as well. From a Solaris man page:
|
||||
|
|
This uses the printf command to format directory names and standard print for the rest. |
|||||||||
|