mfind(1)

πŸ“¦ version 5.4.2, in nixos 26.05, nixpkgs unstable

πŸ’… mfind(1) β€” the Manta Commands era ✨

okay so welcome to mfind, bestie. it lives in the Manta Commands family and it's genuinely one of my faves. quick heads up before we dive in: the page header up top is mfind(1) and the whole thing is filed under the Manta Commands manual β€” but like, that's just the paperwork, the actual vibe is down here πŸŽ€


✨ NAME ✨

mfind β€” search for objects in a directory hierarchy. that's it, that's the whole job. it descends, it finds, it slays πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

mfind [OPTION...] PATH...

you give it options (optional, obvs) and then one or more PATHs. multiple paths? totally allowed. we love a flexible icon.


🌸 DESCRIPTION 🌸

so mfind recursively descends the directory tree for each path you list, and it lists the names that are the specified type β€” or literally all of them if you didn't specify a type. no type? no problem. main character energy either way πŸ‘‘

here's the tea though: unlike GNU/BSD find, mfind is not yet sophisticated enough to support full expression matching. not yet!! she's growing!! 🌱 but she does (currently) allow a --name option that supports Regular Expression matching, which is honestly the part you'll use 90% of the time. iykyk.

and when you pass the --json option, a stream of JSON objects gets printed. each JSON object contains the fields from the Manta ListDirectory API endpoint (https://apidocs.tritondatacenter.com/manta/api.html#ListDirectory), PLUS these client-side added fields:

  • depth β€” an integer directory depth under the given directory, starting from 0.
  • parent β€” the full directory path of the entry.

so you get the API fields and extra bonus fields. it's giving overachiever and i'm obsessed 🫢


πŸ”₯ EXAMPLES πŸ”₯

okay this one is iconic, look:

$ mfind -t o -n '.+.log$' ~~/stor/logs/foo/2013/04/29
~~/stor/logs/foo/2013/04/29/00/gandalf.log
/$USER/stor/logs/foo/2013/04/29/00/frodo.log
~~/stor/logs/foo/2013/04/29/01/sam.log
/$USER/stor/logs/foo/2013/04/29/01/aragorn.log

objects only (-t o), names matching '.+.log$', under that one path. and out come the logs. gandalf, frodo, sam, aragorn β€” the whole fellowship showed up πŸ˜­πŸ’€


πŸ’œ OPTIONS πŸ’œ

  • -a, --account login β€” authenticate as account (login name). like, who are you logging in as, bestie.
  • -h, --help β€” print a help message and exit. bless.
  • -i, --insecure β€” this option explicitly allows "insecure" SSL connections and transfers. all SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. so like, it's a deliberate "yes i know, do it anyway" move πŸ™ˆ
  • -j, --json β€” output a newline-separated JSON stream of find results. json girlies rise 🌈
  • -k, --key fingerprint β€” authenticate using the SSH key described by FINGERPRINT. the key must either be in ~/.ssh or loaded in the SSH agent via ssh-add.
  • -l, --limit β€” limit number of entries returned per request. pacing herself 😌
  • -n, --name regexp β€” only return entries that have a name matching RegExp. RegExp is a Javascript Regular Expression. js regex? in my find? it's more likely than you think ✨
  • -p, --parallel NUM β€” limit concurrent operations to NUM. default is 50. fifty!! she's busy.
  • -s, --size SIZE β€” only list objects that are greater than SIZE bytes.
  • -t, --type type β€” specify d for directories, and o for objects. if specified, only names of that type will be returned. pick your fighter πŸ’…
  • --maxdepth β€” only print items items less than this depth. (yes, "items items" β€” i don't make the rules, i just report them πŸ“)
  • --mindepth β€” only print items with at least this depth.
  • --role=ROLE,ROLE,... β€” specify which roles to assume for the request. comma-separated list, go off πŸ‘‘
  • --user user β€” authenticate as user under account.
  • -u, --url url β€” Manta base URL (such as https://us-central.manta.mnx.io).
  • -v, --verbose β€” print debug output to stderr. repeat option to increase verbosity. stack those vs, bestie πŸ”₯

🧚 ENVIRONMENT 🧚

nature is healing, the environment variables are doing the work for you:

  • MANTA_USER β€” in place of -a, --account.
  • MANTA_SUBUSER β€” in place of --user.
  • MANTA_KEY_ID β€” in place of -k, --key.
  • MANTA_ROLE β€” in place of --role.
  • MANTA_URL β€” in place of -u, --url.
  • MANTA_TLS_INSECURE β€” in place of -i, --insecure.

and one more little shortcut that lives here: the shortcut ~~ is equivalent to /:login where :login is the account login name. so ~~/stor is basically "my stor". cute, convenient, iconic πŸ’–


⭐ DIAGNOSTICS ⭐

when using the -v option, diagnostics will be sent to stderr in bunyan output format. as an example of tracing all information about a request, try:

$ mfind -vv ~~/stor 2>&1 | bunyan

two vs for full trace, pipe it into bunyan, and enjoy the show. 2>&1 is doing the heavy lifting there so don't skip it 🫢


πŸ’€ BUGS πŸ’€


okay that's the whole page!! every flag, every env var, every example, gone through, nothing skipped, nothing invented. now go find some objects, bestie 🌟

β€” with love, from the Manta era, July 2016, mfind(1) out πŸ’œ

πŸ“¦ where this page comes from