Dumb Question to Tiny Tip

Dumb Question Becomes a Tiny Tip – Finding Full Pathname to Files

Long Path Name in Spotlight
John’s Long Path Name in Spotlight

In our awesome Slack community at podfeet.com/slack, John Endahl asked what he dubbed a Dumb Question. I thought I had a clever answer to his question, but Calum B came up with an answer that is a fabulous Tiny Tip. First, the problem to be solved. John asked:

This might be a “dumb question” (trademark NosillaCast) but… does anyone know of a way to easily show the entire path of a file when using Spotlight? I know I can hold down the command key and the path appears at the bottom of the screen, but it is truncated due to my overly deep folder structure.

The Spotlight window cannot be resized, so what you see is all you can see. Screenshot attached, with personal info blurred. The actual path for this file is “/Volumes/Sabrent/jendahl/Library/Mobile Documents/com~apple~CloudDocs/LCB/Children’s Programs/2020 (16, 12, 08, 04) – Music From Around the World/2020/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx cropped.jpg”, which I found by opening the file from Spotlight in Affinity Photo, and then doing a “Save As…“. That’s a poor workaround though. Thanks for any suggestions.

Finder View Show Path Bar
Finder View Show Path Bar

Calum B jumped in right away and explained that he didn’t know if it was possible in Spotlight, but he suggested doing the search from within the Finder instead. In order to achieve the goal, in Finder go to the View menu and select Show Path Bar. From now on, all Finder windows will show you the full path down at the bottom of the window to your selected file.

To clarify, Calum is talking about using the little search magnifying glass in all Finder windows, which is actually Spotlight but perhaps a more direct way of searching the file system.

At this point, we were partway to a good solution. But in studying John’s problem description, it occurred to me that if he had enough depth to his file structure, he might not even be able to see the full path on a super-wide Finder window. A more efficient solution would be if he could have a text representation of the path rather than graphical.

My solution was to use the Terminal for the path, and I invoked another Tiny Tip to make John’s life easier. I wrote:

Let’s say you want to do this often and a screenshot of a long path might not be very useful. Remember a while back Frank Vos gave us a tiny tip about how to put an icon in your Finder window(s) to go straight to the terminal in that enclosing folder? I use it ALL the time, and it comes in handy here.

If you follow Calum’s advice and use “show in enclosing folder”, and then click the icon Frank suggested, you can then type simply pwd for “print working directory” and you’ll get the path in text. If you only need this once in a blue moon, the Terminal icon might not be something you want there all the time, but if it is a frequent requirement it’s awesome.

I included a screenshot of a file buried 7 levels deep in the finder which illustrates how long the pathname gets, and then the output of the Terminal command pwd which is much shorter and probably more useful.

Finder with Super Long Path Name
Finder with Super Long Path Name
Terminal with Smaller Path Name
Terminal with Smaller Path Name

I was pretty smug about my solution, but then Calum came back with a far better solution than invoking the Terminal.

You don’t even need to do that these days – you can right-click any element in the path bar and select “copy as pathname”. (If you right-click a folder, you also get the option to “Open in Terminal”.) You can even just select the file in the results list, then copy it with Cmd-C. When you try to paste it somewhere, it will just paste the pathname if it’s not appropriate to paste the actual file.

Copy File as Pathname
Copy File as Pathname

This is SO cool! I had no idea this option was available. To reiterate, Calum is saying to right-click on the file name in the Path Bar, not the file name where you see it in the main part of the Finder window. I love my little Open Terminal icon in my Finder toolbar windows that Frank Vos gave us, but it’s pretty cool that you can right-click on any folder in the Path Bar and do the same thing. That will be super useful for when I’m on someone else’s computer and I need to jump into the Terminal.

Thank you to John for the “Dumb” question, and thank you to Calum for a super cool Tiny Tip to solve the problem. If you’re reading or listening to this and haven’t joined our Slack community, see what you’re missing? Come join us at podfeet.com/slack.

Leave a Reply

Your email address will not be published.

Scroll to top