What’s the differences between /home/zzz and /home/zzz/ when used in bash?
I just found that when /home/zzz is a link to another dir, find /home/zzz -type f will get nothing, but find /home/zzz/ -type f will return all files under that dir. I think bash treat /home/zzz a link type file, but /home/zzz/ a dir in this case.
Is there any other differences?
The trailing slash is interpreted by most Unix utilities (
findin this case) to mean “follow the symlink”.From the POSIX Symbolic Link Specification:
Also see GNU Coreutils: Trailing slashes.