Combining options in find command

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












Using the find command is there a way to combine options:



i.e.



find . -type fd -name "somefile"


Although -type ignores the second option; I'm looking to find only files or directories.










share|improve this question























  • Note that f is for regular files, not files (other types are files as well).
    – Stéphane Chazelas
    Jan 18 '14 at 9:15














up vote
2
down vote

favorite
1












Using the find command is there a way to combine options:



i.e.



find . -type fd -name "somefile"


Although -type ignores the second option; I'm looking to find only files or directories.










share|improve this question























  • Note that f is for regular files, not files (other types are files as well).
    – Stéphane Chazelas
    Jan 18 '14 at 9:15












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





Using the find command is there a way to combine options:



i.e.



find . -type fd -name "somefile"


Although -type ignores the second option; I'm looking to find only files or directories.










share|improve this question















Using the find command is there a way to combine options:



i.e.



find . -type fd -name "somefile"


Although -type ignores the second option; I'm looking to find only files or directories.







find






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 18 '14 at 23:42









Gilles

510k12010081538




510k12010081538










asked Jan 18 '14 at 7:31









Ned Schneebly

134




134











  • Note that f is for regular files, not files (other types are files as well).
    – Stéphane Chazelas
    Jan 18 '14 at 9:15
















  • Note that f is for regular files, not files (other types are files as well).
    – Stéphane Chazelas
    Jan 18 '14 at 9:15















Note that f is for regular files, not files (other types are files as well).
– Stéphane Chazelas
Jan 18 '14 at 9:15




Note that f is for regular files, not files (other types are files as well).
– Stéphane Chazelas
Jan 18 '14 at 9:15










1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










You cannot combine characters after -type (unless you have a different find than I have). You have to do something like:



 find . ( -type f -o -type d ) -name "somefile"


On my system:



 $ find . -type fd -name "somefile"
find: Arguments to -type should contain only one letter


That messages comes from the function insert_type() at line 2601 in
findutils-4.4.2 find/parser.c. It just takes the first character, older/other versions of find did IIRC not even warn if there were multiple characters after -type.






share|improve this answer






















  • do you know why the find command in particular doesn't allow the combining of options?
    – Ned Schneebly
    Jan 25 '14 at 4:48










  • @NedSchneebly fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
    – Timo
    Jan 26 '14 at 15:03










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f109857%2fcombining-options-in-find-command%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote



accepted










You cannot combine characters after -type (unless you have a different find than I have). You have to do something like:



 find . ( -type f -o -type d ) -name "somefile"


On my system:



 $ find . -type fd -name "somefile"
find: Arguments to -type should contain only one letter


That messages comes from the function insert_type() at line 2601 in
findutils-4.4.2 find/parser.c. It just takes the first character, older/other versions of find did IIRC not even warn if there were multiple characters after -type.






share|improve this answer






















  • do you know why the find command in particular doesn't allow the combining of options?
    – Ned Schneebly
    Jan 25 '14 at 4:48










  • @NedSchneebly fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
    – Timo
    Jan 26 '14 at 15:03














up vote
4
down vote



accepted










You cannot combine characters after -type (unless you have a different find than I have). You have to do something like:



 find . ( -type f -o -type d ) -name "somefile"


On my system:



 $ find . -type fd -name "somefile"
find: Arguments to -type should contain only one letter


That messages comes from the function insert_type() at line 2601 in
findutils-4.4.2 find/parser.c. It just takes the first character, older/other versions of find did IIRC not even warn if there were multiple characters after -type.






share|improve this answer






















  • do you know why the find command in particular doesn't allow the combining of options?
    – Ned Schneebly
    Jan 25 '14 at 4:48










  • @NedSchneebly fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
    – Timo
    Jan 26 '14 at 15:03












up vote
4
down vote



accepted







up vote
4
down vote



accepted






You cannot combine characters after -type (unless you have a different find than I have). You have to do something like:



 find . ( -type f -o -type d ) -name "somefile"


On my system:



 $ find . -type fd -name "somefile"
find: Arguments to -type should contain only one letter


That messages comes from the function insert_type() at line 2601 in
findutils-4.4.2 find/parser.c. It just takes the first character, older/other versions of find did IIRC not even warn if there were multiple characters after -type.






share|improve this answer














You cannot combine characters after -type (unless you have a different find than I have). You have to do something like:



 find . ( -type f -o -type d ) -name "somefile"


On my system:



 $ find . -type fd -name "somefile"
find: Arguments to -type should contain only one letter


That messages comes from the function insert_type() at line 2601 in
findutils-4.4.2 find/parser.c. It just takes the first character, older/other versions of find did IIRC not even warn if there were multiple characters after -type.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 26 '14 at 15:07

























answered Jan 18 '14 at 7:43









Timo

4,6851625




4,6851625











  • do you know why the find command in particular doesn't allow the combining of options?
    – Ned Schneebly
    Jan 25 '14 at 4:48










  • @NedSchneebly fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
    – Timo
    Jan 26 '14 at 15:03
















  • do you know why the find command in particular doesn't allow the combining of options?
    – Ned Schneebly
    Jan 25 '14 at 4:48










  • @NedSchneebly fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
    – Timo
    Jan 26 '14 at 15:03















do you know why the find command in particular doesn't allow the combining of options?
– Ned Schneebly
Jan 25 '14 at 4:48




do you know why the find command in particular doesn't allow the combining of options?
– Ned Schneebly
Jan 25 '14 at 4:48












@NedSchneebly fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
– Timo
Jan 26 '14 at 15:03




@NedSchneebly fd would be the combination of an argument to option -type not an option itself. It is just programmed that way find's option handling with single dashes but long option names is IMHO strange anyway. I'll update the question.
– Timo
Jan 26 '14 at 15:03

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f109857%2fcombining-options-in-find-command%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?