Combining options in find command
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
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
add a comment |Â
up vote
2
down vote
favorite
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
Note thatf
is for regular files, not files (other types are files as well).
â Stéphane Chazelas
Jan 18 '14 at 9:15
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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
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
find
edited Jan 18 '14 at 23:42
Gilles
510k12010081538
510k12010081538
asked Jan 18 '14 at 7:31
Ned Schneebly
134
134
Note thatf
is for regular files, not files (other types are files as well).
â Stéphane Chazelas
Jan 18 '14 at 9:15
add a comment |Â
Note thatf
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
add a comment |Â
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
.
do you know why the find command in particular doesn't allow the combining of options?
â Ned Schneebly
Jan 25 '14 at 4:48
@NedSchneeblyfd
would be the combination of an argument to option-type
not an option itself. It is just programmed that wayfind
'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
add a comment |Â
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
.
do you know why the find command in particular doesn't allow the combining of options?
â Ned Schneebly
Jan 25 '14 at 4:48
@NedSchneeblyfd
would be the combination of an argument to option-type
not an option itself. It is just programmed that wayfind
'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
add a comment |Â
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
.
do you know why the find command in particular doesn't allow the combining of options?
â Ned Schneebly
Jan 25 '14 at 4:48
@NedSchneeblyfd
would be the combination of an argument to option-type
not an option itself. It is just programmed that wayfind
'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
add a comment |Â
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
.
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
.
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
@NedSchneeblyfd
would be the combination of an argument to option-type
not an option itself. It is just programmed that wayfind
'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
add a comment |Â
do you know why the find command in particular doesn't allow the combining of options?
â Ned Schneebly
Jan 25 '14 at 4:48
@NedSchneeblyfd
would be the combination of an argument to option-type
not an option itself. It is just programmed that wayfind
'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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Note that
f
is for regular files, not files (other types are files as well).â Stéphane Chazelas
Jan 18 '14 at 9:15