How to match * with hidden files inside a directory
How to match the hidden files inside the given directories
for example
If I give the below command it's not giving the result of the hidden files,
du -b maybehere*/*
how to achieve this simple using a single command instead of using
du -b maybehere*/.* maybehere*/*
as I need to type maybehere twice.
bash shell wildcards dot-files
add a comment |
How to match the hidden files inside the given directories
for example
If I give the below command it's not giving the result of the hidden files,
du -b maybehere*/*
how to achieve this simple using a single command instead of using
du -b maybehere*/.* maybehere*/*
as I need to type maybehere twice.
bash shell wildcards dot-files
Try for just hiddenmaybehere*/.*
and append to above for all
– Costas
Feb 22 '15 at 12:49
1
Your edit makes a new question with additional restrictions, that makes the Q into a moving target, possible invalidating the answer(s) already given. That is bad manners, just ask a new question if you have one.
– Anthon
Feb 22 '15 at 13:09
add a comment |
How to match the hidden files inside the given directories
for example
If I give the below command it's not giving the result of the hidden files,
du -b maybehere*/*
how to achieve this simple using a single command instead of using
du -b maybehere*/.* maybehere*/*
as I need to type maybehere twice.
bash shell wildcards dot-files
How to match the hidden files inside the given directories
for example
If I give the below command it's not giving the result of the hidden files,
du -b maybehere*/*
how to achieve this simple using a single command instead of using
du -b maybehere*/.* maybehere*/*
as I need to type maybehere twice.
bash shell wildcards dot-files
bash shell wildcards dot-files
edited Feb 22 '15 at 15:51
Gilles
527k12710561581
527k12710561581
asked Feb 22 '15 at 12:46
vidhan
1652210
1652210
Try for just hiddenmaybehere*/.*
and append to above for all
– Costas
Feb 22 '15 at 12:49
1
Your edit makes a new question with additional restrictions, that makes the Q into a moving target, possible invalidating the answer(s) already given. That is bad manners, just ask a new question if you have one.
– Anthon
Feb 22 '15 at 13:09
add a comment |
Try for just hiddenmaybehere*/.*
and append to above for all
– Costas
Feb 22 '15 at 12:49
1
Your edit makes a new question with additional restrictions, that makes the Q into a moving target, possible invalidating the answer(s) already given. That is bad manners, just ask a new question if you have one.
– Anthon
Feb 22 '15 at 13:09
Try for just hidden
maybehere*/.*
and append to above for all– Costas
Feb 22 '15 at 12:49
Try for just hidden
maybehere*/.*
and append to above for all– Costas
Feb 22 '15 at 12:49
1
1
Your edit makes a new question with additional restrictions, that makes the Q into a moving target, possible invalidating the answer(s) already given. That is bad manners, just ask a new question if you have one.
– Anthon
Feb 22 '15 at 13:09
Your edit makes a new question with additional restrictions, that makes the Q into a moving target, possible invalidating the answer(s) already given. That is bad manners, just ask a new question if you have one.
– Anthon
Feb 22 '15 at 13:09
add a comment |
4 Answers
4
active
oldest
votes
Take advantage of the brace expansion:
du -b maybehere*/{*,.[^.],.??*}
or alternatively
du -b maybehere*/{,.[^.],..?}*
The logic behind this is probably not obvious, so here is explanation:
*
matches all non-hidden files
.[^.]
matches files which names started with single dot followed by not a dot; that are only 2 character filenames in the first form.
.??*
matches hidden files which are at least 3 character long
..?*
like above, but second character must be a dot
The whole point is to exclude hard links to current and parent directory (.
and ..
), but include all normal files in such a way that each of them will be counted only once!
For example the simplest would be to just write
du -b maybehere*/{.,}*
It means that that the list contains a dot .
and "nothing" (nothing is between ,
and closing }
), thus all hidden files (which start from a dot) and all non-hidden files (which start from "nothing") would match. The problem is that this would also match .
and ..
, and this is most probably not what you want, so we have to exclude it somehow.
Final word about brace expansion.
Brace expansion is a mechanism by which you can include more files/strings/whatever to the commandline by writing fewer characters. The syntax is {word1,word2,...}
, i.e. it is a list of comma separated strings which starts from {
and end with }
. bash
manual gives a very basic and at the same time very common example of usage:
$ echo a{b,c,d}e
abe ace ade
what is the use of the{ }
I have no idea :( can you give me a direction to get more info about it
– vidhan
Feb 22 '15 at 13:12
@vidhan see the edit, and look look atman bash
for "Brace Expansion" chapter.
– jimmij
Feb 22 '15 at 13:18
would you mind giving me more explanation for the above ans little bit more clearly explaining how every thing works as I am new with these things @jimmij
– vidhan
Feb 22 '15 at 13:27
6
.??*
fails to match.a
,.b
....[^.]*
fails to match..foo
.
– Stéphane Chazelas
Feb 22 '15 at 13:53
4
.foo
matches both.[^.]*
and.??*
. You want{.[!.],..?,}*
.
– Stéphane Chazelas
Feb 22 '15 at 14:25
|
show 2 more comments
Since you're already using GNU specific syntax (-b
):
du -abd1 maybehere*/
That way, it's du
that lists the files in the maybehere*
directories (and it doesn't exclude dot files). -d1
limits the reporting of disk usage to one level down (including non-directories with -a
).
Otherwise, for globs to include hidden files (except .
and ..
), each shell has its own syntax:
zsh
:
du -b maybehere*/*(D)
ksh93
:
(FIGNORE='@(.|..)'; du -b maybehere*/*)
bash
:
(shopt -s dotglob; du -b maybehere*/*)
tcsh
:
(set globdot; du -b maybehere*/*)
yash
:
(set -o dot-glob; du -b maybehere*/*)
though beware it includes
.
and..
on systems that include them in the result ofreaddir()
which makes it hardly usable.
add a comment |
Another option is available here :
du -sm .[!.]* *
Why would you want to skip filenames starting with..
?
– Kusalananda
Aug 10 at 6:53
1
Presumably, because they don't want to list everything in../
and below.
– Shadur
Aug 10 at 7:35
add a comment |
If you want to just list hidden directories or operate on hidden directories then as Costas said you can use
du -b maybehere*/.*
This will allow you to operate on hidden files and directories. If you want only hidden directories then you can specify that with
du -b maybehere*/.*/
can you please see the question once again @SailorCire I have edited it a bit
– vidhan
Feb 22 '15 at 13:03
@vidhan so you only want to work on hidden inside one directory? Is that correct?
– SailorCire
Feb 22 '15 at 13:04
no I want to match both hidden and non-hidden files inside the one directory instead of using both dumaybehere*/.*
andmaybehere*/*
one of hidden and another for non hidden
– vidhan
Feb 22 '15 at 13:06
@vidhandu -b
picks up both hidden and non hidden.
– SailorCire
Feb 22 '15 at 13:12
no :( unfortunately @SailorCire
– vidhan
Feb 22 '15 at 13:20
|
show 1 more comment
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f186214%2fhow-to-match-with-hidden-files-inside-a-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Take advantage of the brace expansion:
du -b maybehere*/{*,.[^.],.??*}
or alternatively
du -b maybehere*/{,.[^.],..?}*
The logic behind this is probably not obvious, so here is explanation:
*
matches all non-hidden files
.[^.]
matches files which names started with single dot followed by not a dot; that are only 2 character filenames in the first form.
.??*
matches hidden files which are at least 3 character long
..?*
like above, but second character must be a dot
The whole point is to exclude hard links to current and parent directory (.
and ..
), but include all normal files in such a way that each of them will be counted only once!
For example the simplest would be to just write
du -b maybehere*/{.,}*
It means that that the list contains a dot .
and "nothing" (nothing is between ,
and closing }
), thus all hidden files (which start from a dot) and all non-hidden files (which start from "nothing") would match. The problem is that this would also match .
and ..
, and this is most probably not what you want, so we have to exclude it somehow.
Final word about brace expansion.
Brace expansion is a mechanism by which you can include more files/strings/whatever to the commandline by writing fewer characters. The syntax is {word1,word2,...}
, i.e. it is a list of comma separated strings which starts from {
and end with }
. bash
manual gives a very basic and at the same time very common example of usage:
$ echo a{b,c,d}e
abe ace ade
what is the use of the{ }
I have no idea :( can you give me a direction to get more info about it
– vidhan
Feb 22 '15 at 13:12
@vidhan see the edit, and look look atman bash
for "Brace Expansion" chapter.
– jimmij
Feb 22 '15 at 13:18
would you mind giving me more explanation for the above ans little bit more clearly explaining how every thing works as I am new with these things @jimmij
– vidhan
Feb 22 '15 at 13:27
6
.??*
fails to match.a
,.b
....[^.]*
fails to match..foo
.
– Stéphane Chazelas
Feb 22 '15 at 13:53
4
.foo
matches both.[^.]*
and.??*
. You want{.[!.],..?,}*
.
– Stéphane Chazelas
Feb 22 '15 at 14:25
|
show 2 more comments
Take advantage of the brace expansion:
du -b maybehere*/{*,.[^.],.??*}
or alternatively
du -b maybehere*/{,.[^.],..?}*
The logic behind this is probably not obvious, so here is explanation:
*
matches all non-hidden files
.[^.]
matches files which names started with single dot followed by not a dot; that are only 2 character filenames in the first form.
.??*
matches hidden files which are at least 3 character long
..?*
like above, but second character must be a dot
The whole point is to exclude hard links to current and parent directory (.
and ..
), but include all normal files in such a way that each of them will be counted only once!
For example the simplest would be to just write
du -b maybehere*/{.,}*
It means that that the list contains a dot .
and "nothing" (nothing is between ,
and closing }
), thus all hidden files (which start from a dot) and all non-hidden files (which start from "nothing") would match. The problem is that this would also match .
and ..
, and this is most probably not what you want, so we have to exclude it somehow.
Final word about brace expansion.
Brace expansion is a mechanism by which you can include more files/strings/whatever to the commandline by writing fewer characters. The syntax is {word1,word2,...}
, i.e. it is a list of comma separated strings which starts from {
and end with }
. bash
manual gives a very basic and at the same time very common example of usage:
$ echo a{b,c,d}e
abe ace ade
what is the use of the{ }
I have no idea :( can you give me a direction to get more info about it
– vidhan
Feb 22 '15 at 13:12
@vidhan see the edit, and look look atman bash
for "Brace Expansion" chapter.
– jimmij
Feb 22 '15 at 13:18
would you mind giving me more explanation for the above ans little bit more clearly explaining how every thing works as I am new with these things @jimmij
– vidhan
Feb 22 '15 at 13:27
6
.??*
fails to match.a
,.b
....[^.]*
fails to match..foo
.
– Stéphane Chazelas
Feb 22 '15 at 13:53
4
.foo
matches both.[^.]*
and.??*
. You want{.[!.],..?,}*
.
– Stéphane Chazelas
Feb 22 '15 at 14:25
|
show 2 more comments
Take advantage of the brace expansion:
du -b maybehere*/{*,.[^.],.??*}
or alternatively
du -b maybehere*/{,.[^.],..?}*
The logic behind this is probably not obvious, so here is explanation:
*
matches all non-hidden files
.[^.]
matches files which names started with single dot followed by not a dot; that are only 2 character filenames in the first form.
.??*
matches hidden files which are at least 3 character long
..?*
like above, but second character must be a dot
The whole point is to exclude hard links to current and parent directory (.
and ..
), but include all normal files in such a way that each of them will be counted only once!
For example the simplest would be to just write
du -b maybehere*/{.,}*
It means that that the list contains a dot .
and "nothing" (nothing is between ,
and closing }
), thus all hidden files (which start from a dot) and all non-hidden files (which start from "nothing") would match. The problem is that this would also match .
and ..
, and this is most probably not what you want, so we have to exclude it somehow.
Final word about brace expansion.
Brace expansion is a mechanism by which you can include more files/strings/whatever to the commandline by writing fewer characters. The syntax is {word1,word2,...}
, i.e. it is a list of comma separated strings which starts from {
and end with }
. bash
manual gives a very basic and at the same time very common example of usage:
$ echo a{b,c,d}e
abe ace ade
Take advantage of the brace expansion:
du -b maybehere*/{*,.[^.],.??*}
or alternatively
du -b maybehere*/{,.[^.],..?}*
The logic behind this is probably not obvious, so here is explanation:
*
matches all non-hidden files
.[^.]
matches files which names started with single dot followed by not a dot; that are only 2 character filenames in the first form.
.??*
matches hidden files which are at least 3 character long
..?*
like above, but second character must be a dot
The whole point is to exclude hard links to current and parent directory (.
and ..
), but include all normal files in such a way that each of them will be counted only once!
For example the simplest would be to just write
du -b maybehere*/{.,}*
It means that that the list contains a dot .
and "nothing" (nothing is between ,
and closing }
), thus all hidden files (which start from a dot) and all non-hidden files (which start from "nothing") would match. The problem is that this would also match .
and ..
, and this is most probably not what you want, so we have to exclude it somehow.
Final word about brace expansion.
Brace expansion is a mechanism by which you can include more files/strings/whatever to the commandline by writing fewer characters. The syntax is {word1,word2,...}
, i.e. it is a list of comma separated strings which starts from {
and end with }
. bash
manual gives a very basic and at the same time very common example of usage:
$ echo a{b,c,d}e
abe ace ade
edited Dec 13 at 12:26
answered Feb 22 '15 at 13:08
jimmij
30.8k870105
30.8k870105
what is the use of the{ }
I have no idea :( can you give me a direction to get more info about it
– vidhan
Feb 22 '15 at 13:12
@vidhan see the edit, and look look atman bash
for "Brace Expansion" chapter.
– jimmij
Feb 22 '15 at 13:18
would you mind giving me more explanation for the above ans little bit more clearly explaining how every thing works as I am new with these things @jimmij
– vidhan
Feb 22 '15 at 13:27
6
.??*
fails to match.a
,.b
....[^.]*
fails to match..foo
.
– Stéphane Chazelas
Feb 22 '15 at 13:53
4
.foo
matches both.[^.]*
and.??*
. You want{.[!.],..?,}*
.
– Stéphane Chazelas
Feb 22 '15 at 14:25
|
show 2 more comments
what is the use of the{ }
I have no idea :( can you give me a direction to get more info about it
– vidhan
Feb 22 '15 at 13:12
@vidhan see the edit, and look look atman bash
for "Brace Expansion" chapter.
– jimmij
Feb 22 '15 at 13:18
would you mind giving me more explanation for the above ans little bit more clearly explaining how every thing works as I am new with these things @jimmij
– vidhan
Feb 22 '15 at 13:27
6
.??*
fails to match.a
,.b
....[^.]*
fails to match..foo
.
– Stéphane Chazelas
Feb 22 '15 at 13:53
4
.foo
matches both.[^.]*
and.??*
. You want{.[!.],..?,}*
.
– Stéphane Chazelas
Feb 22 '15 at 14:25
what is the use of the
{ }
I have no idea :( can you give me a direction to get more info about it– vidhan
Feb 22 '15 at 13:12
what is the use of the
{ }
I have no idea :( can you give me a direction to get more info about it– vidhan
Feb 22 '15 at 13:12
@vidhan see the edit, and look look at
man bash
for "Brace Expansion" chapter.– jimmij
Feb 22 '15 at 13:18
@vidhan see the edit, and look look at
man bash
for "Brace Expansion" chapter.– jimmij
Feb 22 '15 at 13:18
would you mind giving me more explanation for the above ans little bit more clearly explaining how every thing works as I am new with these things @jimmij
– vidhan
Feb 22 '15 at 13:27
would you mind giving me more explanation for the above ans little bit more clearly explaining how every thing works as I am new with these things @jimmij
– vidhan
Feb 22 '15 at 13:27
6
6
.??*
fails to match .a
, .b
... .[^.]*
fails to match ..foo
.– Stéphane Chazelas
Feb 22 '15 at 13:53
.??*
fails to match .a
, .b
... .[^.]*
fails to match ..foo
.– Stéphane Chazelas
Feb 22 '15 at 13:53
4
4
.foo
matches both .[^.]*
and .??*
. You want {.[!.],..?,}*
.– Stéphane Chazelas
Feb 22 '15 at 14:25
.foo
matches both .[^.]*
and .??*
. You want {.[!.],..?,}*
.– Stéphane Chazelas
Feb 22 '15 at 14:25
|
show 2 more comments
Since you're already using GNU specific syntax (-b
):
du -abd1 maybehere*/
That way, it's du
that lists the files in the maybehere*
directories (and it doesn't exclude dot files). -d1
limits the reporting of disk usage to one level down (including non-directories with -a
).
Otherwise, for globs to include hidden files (except .
and ..
), each shell has its own syntax:
zsh
:
du -b maybehere*/*(D)
ksh93
:
(FIGNORE='@(.|..)'; du -b maybehere*/*)
bash
:
(shopt -s dotglob; du -b maybehere*/*)
tcsh
:
(set globdot; du -b maybehere*/*)
yash
:
(set -o dot-glob; du -b maybehere*/*)
though beware it includes
.
and..
on systems that include them in the result ofreaddir()
which makes it hardly usable.
add a comment |
Since you're already using GNU specific syntax (-b
):
du -abd1 maybehere*/
That way, it's du
that lists the files in the maybehere*
directories (and it doesn't exclude dot files). -d1
limits the reporting of disk usage to one level down (including non-directories with -a
).
Otherwise, for globs to include hidden files (except .
and ..
), each shell has its own syntax:
zsh
:
du -b maybehere*/*(D)
ksh93
:
(FIGNORE='@(.|..)'; du -b maybehere*/*)
bash
:
(shopt -s dotglob; du -b maybehere*/*)
tcsh
:
(set globdot; du -b maybehere*/*)
yash
:
(set -o dot-glob; du -b maybehere*/*)
though beware it includes
.
and..
on systems that include them in the result ofreaddir()
which makes it hardly usable.
add a comment |
Since you're already using GNU specific syntax (-b
):
du -abd1 maybehere*/
That way, it's du
that lists the files in the maybehere*
directories (and it doesn't exclude dot files). -d1
limits the reporting of disk usage to one level down (including non-directories with -a
).
Otherwise, for globs to include hidden files (except .
and ..
), each shell has its own syntax:
zsh
:
du -b maybehere*/*(D)
ksh93
:
(FIGNORE='@(.|..)'; du -b maybehere*/*)
bash
:
(shopt -s dotglob; du -b maybehere*/*)
tcsh
:
(set globdot; du -b maybehere*/*)
yash
:
(set -o dot-glob; du -b maybehere*/*)
though beware it includes
.
and..
on systems that include them in the result ofreaddir()
which makes it hardly usable.
Since you're already using GNU specific syntax (-b
):
du -abd1 maybehere*/
That way, it's du
that lists the files in the maybehere*
directories (and it doesn't exclude dot files). -d1
limits the reporting of disk usage to one level down (including non-directories with -a
).
Otherwise, for globs to include hidden files (except .
and ..
), each shell has its own syntax:
zsh
:
du -b maybehere*/*(D)
ksh93
:
(FIGNORE='@(.|..)'; du -b maybehere*/*)
bash
:
(shopt -s dotglob; du -b maybehere*/*)
tcsh
:
(set globdot; du -b maybehere*/*)
yash
:
(set -o dot-glob; du -b maybehere*/*)
though beware it includes
.
and..
on systems that include them in the result ofreaddir()
which makes it hardly usable.
edited Oct 24 at 13:30
answered Feb 22 '15 at 13:49
Stéphane Chazelas
299k54563912
299k54563912
add a comment |
add a comment |
Another option is available here :
du -sm .[!.]* *
Why would you want to skip filenames starting with..
?
– Kusalananda
Aug 10 at 6:53
1
Presumably, because they don't want to list everything in../
and below.
– Shadur
Aug 10 at 7:35
add a comment |
Another option is available here :
du -sm .[!.]* *
Why would you want to skip filenames starting with..
?
– Kusalananda
Aug 10 at 6:53
1
Presumably, because they don't want to list everything in../
and below.
– Shadur
Aug 10 at 7:35
add a comment |
Another option is available here :
du -sm .[!.]* *
Another option is available here :
du -sm .[!.]* *
answered Aug 10 at 6:34
Fábio
15115
15115
Why would you want to skip filenames starting with..
?
– Kusalananda
Aug 10 at 6:53
1
Presumably, because they don't want to list everything in../
and below.
– Shadur
Aug 10 at 7:35
add a comment |
Why would you want to skip filenames starting with..
?
– Kusalananda
Aug 10 at 6:53
1
Presumably, because they don't want to list everything in../
and below.
– Shadur
Aug 10 at 7:35
Why would you want to skip filenames starting with
..
?– Kusalananda
Aug 10 at 6:53
Why would you want to skip filenames starting with
..
?– Kusalananda
Aug 10 at 6:53
1
1
Presumably, because they don't want to list everything in
../
and below.– Shadur
Aug 10 at 7:35
Presumably, because they don't want to list everything in
../
and below.– Shadur
Aug 10 at 7:35
add a comment |
If you want to just list hidden directories or operate on hidden directories then as Costas said you can use
du -b maybehere*/.*
This will allow you to operate on hidden files and directories. If you want only hidden directories then you can specify that with
du -b maybehere*/.*/
can you please see the question once again @SailorCire I have edited it a bit
– vidhan
Feb 22 '15 at 13:03
@vidhan so you only want to work on hidden inside one directory? Is that correct?
– SailorCire
Feb 22 '15 at 13:04
no I want to match both hidden and non-hidden files inside the one directory instead of using both dumaybehere*/.*
andmaybehere*/*
one of hidden and another for non hidden
– vidhan
Feb 22 '15 at 13:06
@vidhandu -b
picks up both hidden and non hidden.
– SailorCire
Feb 22 '15 at 13:12
no :( unfortunately @SailorCire
– vidhan
Feb 22 '15 at 13:20
|
show 1 more comment
If you want to just list hidden directories or operate on hidden directories then as Costas said you can use
du -b maybehere*/.*
This will allow you to operate on hidden files and directories. If you want only hidden directories then you can specify that with
du -b maybehere*/.*/
can you please see the question once again @SailorCire I have edited it a bit
– vidhan
Feb 22 '15 at 13:03
@vidhan so you only want to work on hidden inside one directory? Is that correct?
– SailorCire
Feb 22 '15 at 13:04
no I want to match both hidden and non-hidden files inside the one directory instead of using both dumaybehere*/.*
andmaybehere*/*
one of hidden and another for non hidden
– vidhan
Feb 22 '15 at 13:06
@vidhandu -b
picks up both hidden and non hidden.
– SailorCire
Feb 22 '15 at 13:12
no :( unfortunately @SailorCire
– vidhan
Feb 22 '15 at 13:20
|
show 1 more comment
If you want to just list hidden directories or operate on hidden directories then as Costas said you can use
du -b maybehere*/.*
This will allow you to operate on hidden files and directories. If you want only hidden directories then you can specify that with
du -b maybehere*/.*/
If you want to just list hidden directories or operate on hidden directories then as Costas said you can use
du -b maybehere*/.*
This will allow you to operate on hidden files and directories. If you want only hidden directories then you can specify that with
du -b maybehere*/.*/
answered Feb 22 '15 at 13:00
SailorCire
1,8581921
1,8581921
can you please see the question once again @SailorCire I have edited it a bit
– vidhan
Feb 22 '15 at 13:03
@vidhan so you only want to work on hidden inside one directory? Is that correct?
– SailorCire
Feb 22 '15 at 13:04
no I want to match both hidden and non-hidden files inside the one directory instead of using both dumaybehere*/.*
andmaybehere*/*
one of hidden and another for non hidden
– vidhan
Feb 22 '15 at 13:06
@vidhandu -b
picks up both hidden and non hidden.
– SailorCire
Feb 22 '15 at 13:12
no :( unfortunately @SailorCire
– vidhan
Feb 22 '15 at 13:20
|
show 1 more comment
can you please see the question once again @SailorCire I have edited it a bit
– vidhan
Feb 22 '15 at 13:03
@vidhan so you only want to work on hidden inside one directory? Is that correct?
– SailorCire
Feb 22 '15 at 13:04
no I want to match both hidden and non-hidden files inside the one directory instead of using both dumaybehere*/.*
andmaybehere*/*
one of hidden and another for non hidden
– vidhan
Feb 22 '15 at 13:06
@vidhandu -b
picks up both hidden and non hidden.
– SailorCire
Feb 22 '15 at 13:12
no :( unfortunately @SailorCire
– vidhan
Feb 22 '15 at 13:20
can you please see the question once again @SailorCire I have edited it a bit
– vidhan
Feb 22 '15 at 13:03
can you please see the question once again @SailorCire I have edited it a bit
– vidhan
Feb 22 '15 at 13:03
@vidhan so you only want to work on hidden inside one directory? Is that correct?
– SailorCire
Feb 22 '15 at 13:04
@vidhan so you only want to work on hidden inside one directory? Is that correct?
– SailorCire
Feb 22 '15 at 13:04
no I want to match both hidden and non-hidden files inside the one directory instead of using both du
maybehere*/.*
and maybehere*/*
one of hidden and another for non hidden– vidhan
Feb 22 '15 at 13:06
no I want to match both hidden and non-hidden files inside the one directory instead of using both du
maybehere*/.*
and maybehere*/*
one of hidden and another for non hidden– vidhan
Feb 22 '15 at 13:06
@vidhan
du -b
picks up both hidden and non hidden.– SailorCire
Feb 22 '15 at 13:12
@vidhan
du -b
picks up both hidden and non hidden.– SailorCire
Feb 22 '15 at 13:12
no :( unfortunately @SailorCire
– vidhan
Feb 22 '15 at 13:20
no :( unfortunately @SailorCire
– vidhan
Feb 22 '15 at 13:20
|
show 1 more comment
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f186214%2fhow-to-match-with-hidden-files-inside-a-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try for just hidden
maybehere*/.*
and append to above for all– Costas
Feb 22 '15 at 12:49
1
Your edit makes a new question with additional restrictions, that makes the Q into a moving target, possible invalidating the answer(s) already given. That is bad manners, just ask a new question if you have one.
– Anthon
Feb 22 '15 at 13:09