Mostra la pàginaRevisions anteriorsQuè hi enllaçaExporta a PDFTorna dalt Aquesta pàgina és només de lectura. Podeu veure'n el codi font, però no podeu canviar-la. Consulteu el vostre administrador si penseu que això és degut a algun error. = find - fd [[https://github.com/sharkdp/fd]] == install <code bash> sudo apt install fd-find sudo ln -s /usr/lib/cargo/bin/fd /usr/local/bin/fd </code> == regexp [[https://docs.rs/regex/latest/regex/#syntax]] * por defecto * ''^'': empieza * ''$'': acaba * buscar ''-'':<code bash>fd -- '-pattern' fd '[-]pattern'</code> == parámetros * ''%%--%%ignore-case'' * por defecto: todo minúsculas, no distingue. Si alguna mayúscula, distingue. * ''-e'': extensión * ''^c.*png$'' * ''.*.pdf'' * ''%%--%%type'' | ''-t'': tipo * ''f'': fichero * ''d'': directorio * ''l'': enlace simbólico * ''x'': ejecutable * ''e'': fichero vacío * ''%%--%%changed-whithin Nd'': busca ficheros cambiados en los N días * ''%%--%%exclude-dir '<PATRON>' '' | ''-E'': excluye de la búsqueda el patrón * ''%%--%%size '<SIZE>' '' * ''-x <comando>'': buscar y ejecutar comando para cada fichero * ''-X <comando>'': buscar y ejectuar comando una vez con todos los resultados * ''%%--%%regexp <regexp>'' * ''%%--%%perm <PERM 777>'' * ''%%--%%hidden'' | ''-H'': buscar en directorios o ficheros ocultos (dot) * ''%%--%%no-ignore'' | ''-I'': no ignorar ficheros contenidos en .gitignore * ''%%--%%full-path'' | ''-p'': busca por full path y no solo por nombre (de fichero o directorio) * ''%%--%%list-details'' | ''-l'': alias de ''fd . -X ls -lhd --color=always'', mostrando detalles del fichero (owner, perms, ...) * ''%%--%%threads'' | ''-j'': número de ejecuciones paralelas =1 es en serie (modo por defecto) * <code>The terminal output of commands run from parallel threads using -x will not be interlaced or garbled, so fd -x can be used to rudimentarily parallelize a task run over many files. An example of this is calculating the checksum of each individual file within a directory.</code> * ''%%--%%unrestricted'' | ''-u'': busca en ficheros ocultos e ignorados (parámetros HI) == placeholder Sustituciones usadas en búsquedas y ejecuciones sobre el nombre de los archivos * ''{}'': A placeholder token that will be replaced with the path of the search result (documents/images/party.jpg). * ''{.}'': Like {}, but without the file extension (documents/images/party). * ''{/}'': A placeholder that will be replaced by the basename of the search result (party.jpg). * ''{%%//%%}'': The parent of the discovered path (documents/images). * ''{/.}'': The basename, with the extension removed (party). == ignore * ''.ignore'' * ''~/.config/fd/ignore'': global == colors * variable ''LS_COLORS'' * varibale ''NO_COLOR''º == ejemplos * Recursively find all zip archives and unpack them:<code bash>fd -e zip -x unzip</code> * Find all test_*.py files and open them in your favorite editor. Note that we use capital -X here to open a single vim instance. If there are two such files, test_basic.py and lib/test_advanced.py, this will run vim test_basic.py lib/test_advanced.py.:<code bash>fd -g 'test_*.py' -X vim</code> * To see details like file permissions, owners, file sizes etc., you can tell fd to show them by running ls for each result:<code bash>fd … -X ls -lhd --color=always fd … -l</code> * Convert all *.jpg files to *.png files:<code bash>fd -e jpg -x convert {} {.}.png</code> * mirar placeholders * To format the output of fd as a file-tree you can use the tree command with --fromfile:<code bash>fd | tree --fromfile</code> linux/utils/find-fd.txt Darrera modificació: 19/11/2025 00:02per mate