FG
💻 Software

List directories containing files that match a regular expression

Fresh5 days ago
Mar 15, 20264958 views
Confidence Score0%
0%

Problem

I would like to set up a simple filtering system on my FreeBSD server that allows me to create arbitrary "views" of directories. For instance, I'd like to be able to list all directories that match the pattern "*.mp3" but only display the directory name. For instance, if I ran the command on my mus…

Error Output

find . -name "*.mp3"

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: List directories containing files that match a regular expression

Low Risk

Hows about: find . -name '*.mp3' -print0 |xargs -0 -i dirname {} |uniq I get something like: ./mnt/mp3/Adicts/Complete Singles Collection(1995) ./mnt/mp3/Adicts/Rise and Shine(2002) ./mnt/mp3/Adicts/Songs of Praise(1981) ./mnt/mp3/Adicts/Twenty-seve…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment