Linux Using fd

Links: 104 Linux Index

It is not meant to replace find or have all its utilities.

It can be used in scenarios where you need to find things quickly It comes with sensible defaults

  • brew install fd
  • Ignores hidden directories and files by default and the patters from .gitignore
  • By default finds both files and directories
  • fd PATTERN == find . -iname "*PATTERN*"
    • By default finds both directories and files.
    • attachments/Pasted image 20220614155325.jpg
  • Smart case: the search is case-insensitive by default.
    • It switches to case-sensitive if the pattern contains an uppercase character.
  • Regular expression:
    fd '^x.*rc$' // beginning with x/X and ending with .*rc
  • Specifying a root directory: Second argument
    > fd passwd /etc
  • List Everything: fd
  • Searching for a file extension
    > fd -e md
  • Searching a specific file or folder
    > fd -g /usr
  • Hidden and Ignore files:
    • -H for hidden files
    • -I for .gitignore
      > fd pre-commit
      > fd -H pre-commit

Last updated: 2022-06-14