du shows completely different folder size for * and folder name
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm trying to move some data over and to start with I'd like to make sure that the size is ok. I run into a problem however, if I check the folder with
du -sh myfolder/
780M myfolder/
but
du -sh *
..
71M myfolder
..
I thought it might be something to do with hidden files but this particular folder does not have any inside.
Am I missing something?
disk-usage
add a comment |Â
up vote
1
down vote
favorite
I'm trying to move some data over and to start with I'd like to make sure that the size is ok. I run into a problem however, if I check the folder with
du -sh myfolder/
780M myfolder/
but
du -sh *
..
71M myfolder
..
I thought it might be something to do with hidden files but this particular folder does not have any inside.
Am I missing something?
disk-usage
Do you have a ~709 MB file being added to / deleted frommyfolder
between operation? A file being written to? A file being linked tomyfolder
? If you don't then it looks like a bug in yourdu
.
â Satà  Katsura
Mar 29 '17 at 15:25
Do you have hidden files?ls -lhA myfolder
â Giacomo Catenazzi
Mar 29 '17 at 16:41
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to move some data over and to start with I'd like to make sure that the size is ok. I run into a problem however, if I check the folder with
du -sh myfolder/
780M myfolder/
but
du -sh *
..
71M myfolder
..
I thought it might be something to do with hidden files but this particular folder does not have any inside.
Am I missing something?
disk-usage
I'm trying to move some data over and to start with I'd like to make sure that the size is ok. I run into a problem however, if I check the folder with
du -sh myfolder/
780M myfolder/
but
du -sh *
..
71M myfolder
..
I thought it might be something to do with hidden files but this particular folder does not have any inside.
Am I missing something?
disk-usage
edited Mar 29 '17 at 10:08
Jeff Schaller
31.9k848109
31.9k848109
asked Mar 29 '17 at 7:13
Bart C
1354
1354
Do you have a ~709 MB file being added to / deleted frommyfolder
between operation? A file being written to? A file being linked tomyfolder
? If you don't then it looks like a bug in yourdu
.
â Satà  Katsura
Mar 29 '17 at 15:25
Do you have hidden files?ls -lhA myfolder
â Giacomo Catenazzi
Mar 29 '17 at 16:41
add a comment |Â
Do you have a ~709 MB file being added to / deleted frommyfolder
between operation? A file being written to? A file being linked tomyfolder
? If you don't then it looks like a bug in yourdu
.
â Satà  Katsura
Mar 29 '17 at 15:25
Do you have hidden files?ls -lhA myfolder
â Giacomo Catenazzi
Mar 29 '17 at 16:41
Do you have a ~709 MB file being added to / deleted from
myfolder
between operation? A file being written to? A file being linked to myfolder
? If you don't then it looks like a bug in your du
.â Satà  Katsura
Mar 29 '17 at 15:25
Do you have a ~709 MB file being added to / deleted from
myfolder
between operation? A file being written to? A file being linked to myfolder
? If you don't then it looks like a bug in your du
.â Satà  Katsura
Mar 29 '17 at 15:25
Do you have hidden files?
ls -lhA myfolder
â Giacomo Catenazzi
Mar 29 '17 at 16:41
Do you have hidden files?
ls -lhA myfolder
â Giacomo Catenazzi
Mar 29 '17 at 16:41
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
Chances are that myfolder
contains 709ÃÂ MB worth of files that have another hard link in a subdirectory that is sorted lexicographically before myfolder
. The du
command reports each distinct file only the first time it sees it, so if a file has multiple links inside the tree(s) covered by a run of du
, it's reported only once, under whichever directory was traversed first.
Here are a few ways you can look for hard links:
find myfolder -links +1 -type f
lists all the files that have at least a second hard link undermyfolder
(+1
means âÂÂmore than oneâÂÂ), regardless of where that link is.find . -samefile myfolder/foo
(with GNU find) lists all the hard links tomyfolder/foo
under the current directory. Sincemyfolder
is under the current directory, this includesmyfolder/foo
itself.find -type f -links +1 -printf '%i %pn' | sort -k1n
(with GNU find) produces a list of hard-linked files under the current directory, grouped by inode number. Two files are the same if they are located on the same filesystem and they have the same inode number.
This might be the case, I'll check this out. Thanks @Gillles
â Bart C
Mar 30 '17 at 11:22
Yes, withfind . -samefile ...
I found multiple hard links all over the place, thanks again.
â Bart C
Mar 30 '17 at 11:38
Following on the subject,ls -l
displays a number next to the permissions which indicates a count of hard links on the file
â Bart C
Apr 3 '17 at 9:50
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
Chances are that myfolder
contains 709ÃÂ MB worth of files that have another hard link in a subdirectory that is sorted lexicographically before myfolder
. The du
command reports each distinct file only the first time it sees it, so if a file has multiple links inside the tree(s) covered by a run of du
, it's reported only once, under whichever directory was traversed first.
Here are a few ways you can look for hard links:
find myfolder -links +1 -type f
lists all the files that have at least a second hard link undermyfolder
(+1
means âÂÂmore than oneâÂÂ), regardless of where that link is.find . -samefile myfolder/foo
(with GNU find) lists all the hard links tomyfolder/foo
under the current directory. Sincemyfolder
is under the current directory, this includesmyfolder/foo
itself.find -type f -links +1 -printf '%i %pn' | sort -k1n
(with GNU find) produces a list of hard-linked files under the current directory, grouped by inode number. Two files are the same if they are located on the same filesystem and they have the same inode number.
This might be the case, I'll check this out. Thanks @Gillles
â Bart C
Mar 30 '17 at 11:22
Yes, withfind . -samefile ...
I found multiple hard links all over the place, thanks again.
â Bart C
Mar 30 '17 at 11:38
Following on the subject,ls -l
displays a number next to the permissions which indicates a count of hard links on the file
â Bart C
Apr 3 '17 at 9:50
add a comment |Â
up vote
4
down vote
accepted
Chances are that myfolder
contains 709ÃÂ MB worth of files that have another hard link in a subdirectory that is sorted lexicographically before myfolder
. The du
command reports each distinct file only the first time it sees it, so if a file has multiple links inside the tree(s) covered by a run of du
, it's reported only once, under whichever directory was traversed first.
Here are a few ways you can look for hard links:
find myfolder -links +1 -type f
lists all the files that have at least a second hard link undermyfolder
(+1
means âÂÂmore than oneâÂÂ), regardless of where that link is.find . -samefile myfolder/foo
(with GNU find) lists all the hard links tomyfolder/foo
under the current directory. Sincemyfolder
is under the current directory, this includesmyfolder/foo
itself.find -type f -links +1 -printf '%i %pn' | sort -k1n
(with GNU find) produces a list of hard-linked files under the current directory, grouped by inode number. Two files are the same if they are located on the same filesystem and they have the same inode number.
This might be the case, I'll check this out. Thanks @Gillles
â Bart C
Mar 30 '17 at 11:22
Yes, withfind . -samefile ...
I found multiple hard links all over the place, thanks again.
â Bart C
Mar 30 '17 at 11:38
Following on the subject,ls -l
displays a number next to the permissions which indicates a count of hard links on the file
â Bart C
Apr 3 '17 at 9:50
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Chances are that myfolder
contains 709ÃÂ MB worth of files that have another hard link in a subdirectory that is sorted lexicographically before myfolder
. The du
command reports each distinct file only the first time it sees it, so if a file has multiple links inside the tree(s) covered by a run of du
, it's reported only once, under whichever directory was traversed first.
Here are a few ways you can look for hard links:
find myfolder -links +1 -type f
lists all the files that have at least a second hard link undermyfolder
(+1
means âÂÂmore than oneâÂÂ), regardless of where that link is.find . -samefile myfolder/foo
(with GNU find) lists all the hard links tomyfolder/foo
under the current directory. Sincemyfolder
is under the current directory, this includesmyfolder/foo
itself.find -type f -links +1 -printf '%i %pn' | sort -k1n
(with GNU find) produces a list of hard-linked files under the current directory, grouped by inode number. Two files are the same if they are located on the same filesystem and they have the same inode number.
Chances are that myfolder
contains 709ÃÂ MB worth of files that have another hard link in a subdirectory that is sorted lexicographically before myfolder
. The du
command reports each distinct file only the first time it sees it, so if a file has multiple links inside the tree(s) covered by a run of du
, it's reported only once, under whichever directory was traversed first.
Here are a few ways you can look for hard links:
find myfolder -links +1 -type f
lists all the files that have at least a second hard link undermyfolder
(+1
means âÂÂmore than oneâÂÂ), regardless of where that link is.find . -samefile myfolder/foo
(with GNU find) lists all the hard links tomyfolder/foo
under the current directory. Sincemyfolder
is under the current directory, this includesmyfolder/foo
itself.find -type f -links +1 -printf '%i %pn' | sort -k1n
(with GNU find) produces a list of hard-linked files under the current directory, grouped by inode number. Two files are the same if they are located on the same filesystem and they have the same inode number.
edited Apr 3 '17 at 11:33
answered Mar 29 '17 at 23:58
Gilles
507k12010031530
507k12010031530
This might be the case, I'll check this out. Thanks @Gillles
â Bart C
Mar 30 '17 at 11:22
Yes, withfind . -samefile ...
I found multiple hard links all over the place, thanks again.
â Bart C
Mar 30 '17 at 11:38
Following on the subject,ls -l
displays a number next to the permissions which indicates a count of hard links on the file
â Bart C
Apr 3 '17 at 9:50
add a comment |Â
This might be the case, I'll check this out. Thanks @Gillles
â Bart C
Mar 30 '17 at 11:22
Yes, withfind . -samefile ...
I found multiple hard links all over the place, thanks again.
â Bart C
Mar 30 '17 at 11:38
Following on the subject,ls -l
displays a number next to the permissions which indicates a count of hard links on the file
â Bart C
Apr 3 '17 at 9:50
This might be the case, I'll check this out. Thanks @Gillles
â Bart C
Mar 30 '17 at 11:22
This might be the case, I'll check this out. Thanks @Gillles
â Bart C
Mar 30 '17 at 11:22
Yes, with
find . -samefile ...
I found multiple hard links all over the place, thanks again.â Bart C
Mar 30 '17 at 11:38
Yes, with
find . -samefile ...
I found multiple hard links all over the place, thanks again.â Bart C
Mar 30 '17 at 11:38
Following on the subject,
ls -l
displays a number next to the permissions which indicates a count of hard links on the fileâ Bart C
Apr 3 '17 at 9:50
Following on the subject,
ls -l
displays a number next to the permissions which indicates a count of hard links on the fileâ Bart C
Apr 3 '17 at 9:50
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%2f354508%2fdu-shows-completely-different-folder-size-for-and-folder-name%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
Do you have a ~709 MB file being added to / deleted from
myfolder
between operation? A file being written to? A file being linked tomyfolder
? If you don't then it looks like a bug in yourdu
.â Satà  Katsura
Mar 29 '17 at 15:25
Do you have hidden files?
ls -lhA myfolder
â Giacomo Catenazzi
Mar 29 '17 at 16:41