Quiz: portability of “find” command

by Wojciech Adam Koszek   ⋅   Nov 29, 2015   ⋅   Menlo Park, CA

Another portability issue when moving around the operating systems. How often do you use `find`? Exactly. Interesting for UNIX and macOS people.


On MacOSX:

wk:/w/repos/dockerfiles&> find wkoszek -type d -depth 1
wkoszek/base
wkoszek/nginx

On Linux you get:

find: warning: you have specified the -depth option after a non-option
argument -type, but options are not positional (-depth affects tests
specified before it as well as those specified after it). Please specify
options before other arguments.

Hint: compare manual pages of both commands.

Quiz: do you know offhand what’s the correct fix?



Subscribe for updates

Once a month I send updates on the new content and hints for software engineers.



Liked it? Share it!


About the author: I'm Wojciech Adam Koszek. I like software, business and design. Poland native. In Bay Area since 2010.   More about me