fbpx

CuTt: Find file’s fullpath

June 8, 2017

Copper’s Tips & Tricks #1: Find file’s fullpath

Two ways to do this, the normal way, using `find`, and the hipster way, using `tree` and `grep`:

The normal way
find . -name '[filename].[extension]'

# E.g.:

$ find . -name 'wp-config.php'

./Documents/Sites/some-project/workspace/some-beep/wordpress/wp-config-sample.php
./Documents/Sites/some-project/workspace/some-beep/wordpress/wp-config.php
./Documents/Sites/some-project/workspace/some-boop/wordpress/wp-config-sample.php
./Documents/Sites/some-project/workspace/some-boop/wordpress/wp-config.php
./Documents/Sites/some-project/workspace/some-noise/wordpress/wp-config-sample.php
./Documents/Sites/some-project/workspace/some-noise/wordpress/wp-config.php
./Documents/Sites/some-project/workspace/some-censured/wordpress/wp-config-sample.php
./Documents/Sites/some-project/workspace/some-censured/wordpress/wp-config.php
The hipster way
$ tree -fi | grep SiteSettings
./wordpress/wp-content/themes/example/models/App_SiteSettings.php

Why use tree and grep when you have find??? Good question! Mostly because pipe grep is more instinctive than find, and easier to remember “tree fi grep” than “find dot SINGLEdash name”, I find myself using tldr all the time for find, non-pipe grep, and tar all the time.

This is arguably the least useful tip and trick, but, looking on the bright side, it’s also the MOST useful as of this writing, because it’s the first and only one! Protip: Call your gf “my prettiest gf” if you dislike lying

avatar
Fabio Pampin

Ver entradas

Most Recent

June 9, 2022

¿Qué son las DAO y cuáles son sus beneficios?

Es común en la historia contemporánea que haya cambios a partir de los avances en el campo de la...

Read More

June 2, 2022

¿Qué son las DeFi y por qué son el futuro de las finanzas?

Es común en la historia contemporánea que haya cambios a partir de los avances en el campo de la...

Read More

May 27, 2022

How to start a successful product build from scratch?

Creating a product from scratch could be a huge challenge. To achieve your business goals it’s important to develop...

Read More