Skip to content
Advertisement

how to linux command find many types

my command

find / (-type d -type f) name

but this command return error

find: Arguments to -type should contain only one letter

i want only file or directory search

how to many types in linux command find

Advertisement

Answer

You need spaces around the parentheses, since they have to be separate arguments to the find command.

The way you wrote it, it thinks that it should start in the directories named / and (-type, and look for something whose type is f), but that’s not a valid type abbreviation.

Also, of you want to search for multiple types, you have to connect them with -o for OR. The default connector is AND, and there are no files that are both ordinary files and directories.

find / ( -type d -o -type f )
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement