# How list every file into each folder that starts with a certain character...



## ziomario (Jan 3, 2023)

Hello.

when I'm using Linux and I want to list every file located in every directory which starts with a certain character,I would issue a command like this :


```
find /compat/ubuntu -name _*
```

but it does not work like this in FreeBSD. Can someone tell me what's the correct command to issue on FreeBSD to achieve the same result ?

maybe this ? :

*find / -type d -name 'x_*'*

it seems that it does not always work :





thanks.


----------



## VladiBG (Jan 3, 2023)

It's just in the first example of the manual page





						find(1)
					






					www.freebsd.org
				




`find / -name "X_*" -print`
This will print all files and directories which start with X_
If you want to print only the directories then use "-type d" or if you want only files then "-type f"
`find / -type f -name "X_*" -print`


----------

