fd sh --type f
fd sh --type f --type l
Filter search by type:
f, file
regular files
d, directory
directories
l, symlink
symbolic links
x, executable
executable (files)
e, empty
empty files or directories
s, socket
sockets
p, pipe
named pipes (FIFOs)
This option can be used repeatedly to allow for multiple file types.
-H (--hidden) & -i (--ignore-case)
fd -Hi '.*\.ttf' '/usr/share/fonts'
-H : Search hidden files and directories
-i : Case-insensitive search
fd -e conf --base-directory /etc
fd -Hie conf -E BackUP -E .config
fd -S=+1Gi # search file which size bigger than or equal 1GiB
fd -S=-10Mi # search file which size smaller than or equal 10MiB
fd -S=1B # search file which size exactly 1Byte
'b' bytes
'k' kilobytes (base ten, 10^3 = 1000 bytes)
'm' megabytes
'g' gigabytes
't' terabytes
'ki' kibibytes (base two, 2^10 = 1024 bytes)
'mi' mebibytes
'gi' gibibytes
'ti' tebibytes
fd -Hi '.*\.ttf$' '/usr/share/fonts' -X sh -c '
for file in "$@"
do
ln -sf "$file" "${file##*/}"
done' sh {}
# sh {} is better than just {}
fd -Hi '.*\.ttf$' '/usr/share/fonts' -x ln -sf {} {/}
fd -Hi '.*\.ttf$' '/usr/local/share/fonts' -X sh -c '
for file do
echo ln -sf "$file" "${file##*/}"
done
' sh {}