This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
Nigel.
On Tue, Mar 06, 2007 at 10:01:38PM +0100, Nigel Henry wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files. What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
du -sh /your/directory
Nigel Henry escribió:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
man du
On Tuesday 06 March 2007 22:03, Matthew Miller wrote:
On Tue, Mar 06, 2007 at 10:01:38PM +0100, Nigel Henry wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files. What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
du -sh /your/directory
-- Matthew Miller mattdm@mattdm.org http://mattdm.org/ Boston University Linux ------> http://linux.bu.edu/
Thanks for that Matthew. I've been puzzling about this problem for ages. Just found that I've got 2.6G of music made on Linux in my Music directory. Wow.
Can't check the contents of the "Sounds Library" directory at the mo, because it was on an NTFS partition, and have just moved it to a FAT32 partition, so I could change the NTFS partition to FAT32 using webmin. That done I'm moving the files back to the ex NTFS now FAT32 partition.
Thanks for the quick reply.
Nigel.
On Tue, Mar 06, 2007 at 22:01:38 +0100, Nigel Henry cave.dnb@tiscali.fr wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
du -k
Em Ter 06 Mar 2007, Nigel Henry escreveu:
On Tuesday 06 March 2007 22:03, Matthew Miller wrote:
On Tue, Mar 06, 2007 at 10:01:38PM +0100, Nigel Henry wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files. What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
du -sh /your/directory
Also, if you're looking for a GUI solution, have you looked at the "file size view" view mode in Konqueror? It's very useful when you're trying to find out what's eating away your disk space.
[]'s Marcelo
On 3/8/07, Marcelo Magno T. Sales marcelo.sales@sefaz.pe.gov.br wrote:
Also, if you're looking for a GUI solution, have you looked at the "file size view" view mode in Konqueror? It's very useful when you're trying to find out what's eating away your disk space.
Another GUI-based solution is Treesize; http://treesize.sourceforge.net/.
Daniel
On Thursday 08 March 2007 16:49, Daniel Parish wrote:
On 3/8/07, Marcelo Magno T. Sales marcelo.sales@sefaz.pe.gov.br wrote:
Also, if you're looking for a GUI solution, have you looked at the "file size view" view mode in Konqueror? It's very useful when you're trying to find out what's eating away your disk space.
Another GUI-based solution is Treesize; http://treesize.sourceforge.net/.
Daniel
I've been using du, and am quite happy with the CLI, but thanks to Marcelo, and you Daniel for the GUI suggestions, and I will look at them.
Nigel.
On Wednesday 07 March 2007 04:32, Bruno Wolff III wrote:
On Tue, Mar 06, 2007 at 22:01:38 +0100,
Nigel Henry cave.dnb@tiscali.fr wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
du -k
Hi Bruno. That's interesting as it lists all the subdirectories in my "Music" directory, with their individual filesizes, and ending with the total content of the "Music" directory. That's not usually a problem with individual subdirectories though, as hovering the mouse over them shows the total size of the files in them.
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
Thanks.
Nigel.
On Thu, Mar 08, 2007 at 20:35:12 +0100, Nigel Henry cave.dnb@tiscali.fr wrote:
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
Probably what happened is you typed: du -k Sounds Library instead of: du -k "Sounds Library"
The first command tries to run du on two directories named "Sounds" and "Library", whereas the second looks at just the directory named "Sounds Library".
Nigel Henry wrote:
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
It's not likely a du issue, but a matter of quoting the dir.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
If you left it as Sounds Library you could use du as:
du -sh "/mnt/hdb5/Sounds Library"
or
du -sh /mnt/hdb5/Sounds\ Library
If you just use:
du -sh /mnt/hdb5/Sounds Library
then the shell passes du two separate arguments, /mnt/hdb5/Sounds and Library; neither of which are likely to exist or be the intended arguments.
HTH,
On Thursday 08 March 2007 20:49, Todd Zullinger wrote:
Nigel Henry wrote:
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
It's not likely a du issue, but a matter of quoting the dir.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
If you left it as Sounds Library you could use du as:
du -sh "/mnt/hdb5/Sounds Library"
or
du -sh /mnt/hdb5/Sounds\ Library
If you just use:
du -sh /mnt/hdb5/Sounds Library
then the shell passes du two separate arguments, /mnt/hdb5/Sounds and Library; neither of which are likely to exist or be the intended arguments.
HTH,
Yes that's what I was getting. du was complaining that it couldn't find "Sounds", and on the next line it complained that it couldn't find "Library".
Thanks Todd, and you Bruno. Now I've learned a bit about using quotes, but why does that apply to the directory you are accessing using du, but doesn't apply to the subdirectories within that directory?
I'm not intentionally trying to appear thick, and the man pages for bash are huge. I'm getting a bit old and a lot of this stuff takes a while to absorb.
Nigel.
On Thu, Mar 08, 2007 at 22:01:24 +0100, Nigel Henry cave.dnb@tiscali.fr wrote:
Thanks Todd, and you Bruno. Now I've learned a bit about using quotes, but why does that apply to the directory you are accessing using du, but doesn't apply to the subdirectories within that directory?
It is a feature of the command line. Internally the names don't need to be quoted. (Though some commands will run other commands using a shell and shell expansion and quoting will apply to those commands.)
If you want to read more about shell commands, try man bash. (There are other shells, but bash is the normal default.)
On Thursday 08 March 2007 22:11, Bruno Wolff III wrote:
On Thu, Mar 08, 2007 at 22:01:24 +0100,
Nigel Henry cave.dnb@tiscali.fr wrote:
Thanks Todd, and you Bruno. Now I've learned a bit about using quotes, but why does that apply to the directory you are accessing using du, but doesn't apply to the subdirectories within that directory?
It is a feature of the command line. Internally the names don't need to be quoted. (Though some commands will run other commands using a shell and shell expansion and quoting will apply to those commands.)
If you want to read more about shell commands, try man bash. (There are other shells, but bash is the normal default.)
Thanks Bruno. I'll have another go in man bash, and see if I can learn a bit more.
Many thanks for the reply.
Nigel.
Nigel Henry wrote:
Thanks Bruno. I'll have another go in man bash, and see if I can learn a bit more.
It's odd to me that none suggested sorting to find the largest etc.
When I'm pruning, I usually use this...
$ du -s /path/to/directories/* | sort -gr | head
This gives me the largest several entries.
Often, this is a repeated procedure, and the output all gets catenated (IOW, I use ">>") and edited into place, so I know where stuff is.
Mike
On Thu, 2007-03-08 at 20:35 +0100, Nigel Henry wrote:
On Wednesday 07 March 2007 04:32, Bruno Wolff III wrote:
On Tue, Mar 06, 2007 at 22:01:38 +0100,
Nigel Henry cave.dnb@tiscali.fr wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
du -k
Hi Bruno. That's interesting as it lists all the subdirectories in my "Music" directory, with their individual filesizes, and ending with the total content of the "Music" directory. That's not usually a problem with individual subdirectories though, as hovering the mouse over them shows the total size of the files in them.
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
Hi, Nigel, The reason a command won't parse correctly with a space in the file name is due to the tokenizer used by the shell. It cannot deal with spaces in filenames. A space is the end of the word to the tokenizer unless it is inside Quotes or escaped in some way. Thus the command du xxx yyy is going to look for files xxx and then yyyy. This is true of most systems. otherwise there would be no way to chose which way to parse a command with several arguments, for example: cat xxx yyy aaa bbb ccc ddd > temp.txt
In this case should the result consist of files xxx, yyy, zzz, bbb, ccc, and ddd all being concatenated to a file called temp.txt, or should it be xxx yyy, zzz bbb, and ccc ddd? Moreover how would an unambiguous error message tell the operator what was wrong? What if files xxx, yyy zzz, bbb zzz, and ddd were all present? Is this what the operator meant? This is why a good administrator doesn't put spaces in system control files. It leads to ambigousity when working on the system, leading to errors and system corruption. Typo's that would be caught might not be if spaces are allowed into filenames.
On the other hand, once a directory is opened, the file names are read via a special command designed for the OS, and if the OS permits spaces, the entire file name up to the end charactor (generally control-Z or NULL). Thus the sub directories and files will be correctly handled. But with spaces in the names, error messages regarding parsing, or tracing the file contents may be ambiguous to the operator. It is not illegal to put spaces in filenames, but is should be considered a bad practice, and avoided. But it is your system, so YMMV.
Regards, Les H
On Friday 09 March 2007 01:13, Les wrote:
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
Hi, Nigel, The reason a command won't parse correctly with a space in the file name is due to the tokenizer used by the shell. It cannot deal with spaces in filenames. A space is the end of the word to the tokenizer unless it is inside Quotes or escaped in some way. Thus the command du xxx yyy is going to look for files xxx and then yyyy. This is true of most systems. otherwise there would be no way to chose which way to parse a command with several arguments, for example: cat xxx yyy aaa bbb ccc ddd > temp.txt
In this case should the result consist of files xxx, yyy, zzz, bbb, ccc, and ddd all being concatenated to a file called temp.txt, or should it be xxx yyy, zzz bbb, and ccc ddd? Moreover how would an unambiguous error message tell the operator what was wrong? What if files xxx, yyy zzz, bbb zzz, and ddd were all present? Is this what the operator meant? This is why a good administrator doesn't put spaces in system control files. It leads to ambigousity when working on the system, leading to errors and system corruption. Typo's that would be caught might not be if spaces are allowed into filenames.
On the other hand, once a directory is opened, the file names are read via a special command designed for the OS, and if the OS permits spaces, the entire file name up to the end charactor (generally control-Z or NULL). Thus the sub directories and files will be correctly handled. But with spaces in the names, error messages regarding parsing, or tracing the file contents may be ambiguous to the operator. It is not illegal to put spaces in filenames, but is should be considered a bad practice, and avoided. But it is your system, so YMMV.
Regards, Les H
Thanks Les for that very thorough explanation. I will be more carefull about spaces in the future.
A related question, is. How do I find out how many files are in the Sounds-Library directory, including all subdirectories. I looked at ls, but that will only give a list of files, as far as I can see.
Thanks.
Nigel.
On Sat, 2007-03-10 at 16:03 +0100, Nigel Henry wrote:
On Friday 09 March 2007 01:13, Les wrote:
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
Hi, Nigel, The reason a command won't parse correctly with a space in the file name is due to the tokenizer used by the shell. It cannot deal with spaces in filenames. A space is the end of the word to the tokenizer unless it is inside Quotes or escaped in some way. Thus the command du xxx yyy is going to look for files xxx and then yyyy. This is true of most systems. otherwise there would be no way to chose which way to parse a command with several arguments, for example: cat xxx yyy aaa bbb ccc ddd > temp.txt
In this case should the result consist of files xxx, yyy, zzz, bbb, ccc, and ddd all being concatenated to a file called temp.txt, or should it be xxx yyy, zzz bbb, and ccc ddd? Moreover how would an unambiguous error message tell the operator what was wrong? What if files xxx, yyy zzz, bbb zzz, and ddd were all present? Is this what the operator meant? This is why a good administrator doesn't put spaces in system control files. It leads to ambigousity when working on the system, leading to errors and system corruption. Typo's that would be caught might not be if spaces are allowed into filenames.
On the other hand, once a directory is opened, the file names are read via a special command designed for the OS, and if the OS permits spaces, the entire file name up to the end charactor (generally control-Z or NULL). Thus the sub directories and files will be correctly handled. But with spaces in the names, error messages regarding parsing, or tracing the file contents may be ambiguous to the operator. It is not illegal to put spaces in filenames, but is should be considered a bad practice, and avoided. But it is your system, so YMMV.
Regards, Les H
Thanks Les for that very thorough explanation. I will be more carefull about spaces in the future.
A related question, is. How do I find out how many files are in the Sounds-Library directory, including all subdirectories. I looked at ls, but that will only give a list of files, as far as I can see.
Thanks.
Nigel.
There may be better techniques, but I have used something like: % ls -al | grep -c '\n' Which does the recursive list and then counts the lines. This will include the directories I think, but you can try it. There are also varients of the du, df, and ls commands that can provide this sort of functionality.
Try: % man -k file
To see a list of commands that work on files. Some of the Admin specific folks can offer help on this as well.
Regards, Les H.
On Saturday 10 March 2007 18:11, Les wrote:
On Sat, 2007-03-10 at 16:03 +0100, Nigel Henry wrote:
On Friday 09 March 2007 01:13, Les wrote:
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
Hi, Nigel, The reason a command won't parse correctly with a space in the file name is due to the tokenizer used by the shell. It cannot deal with spaces in filenames. A space is the end of the word to the tokenizer unless it is inside Quotes or escaped in some way. Thus the command du xxx yyy is going to look for files xxx and then yyyy. This is true of most systems. otherwise there would be no way to chose which way to parse a command with several arguments, for example: cat xxx yyy aaa bbb ccc ddd > temp.txt
In this case should the result consist of files xxx, yyy, zzz, bbb, ccc, and ddd all being concatenated to a file called temp.txt, or should it be xxx yyy, zzz bbb, and ccc ddd? Moreover how would an unambiguous error message tell the operator what was wrong? What if files xxx, yyy zzz, bbb zzz, and ddd were all present? Is this what the operator meant? This is why a good administrator doesn't put spaces in system control files. It leads to ambigousity when working on the system, leading to errors and system corruption. Typo's that would be caught might not be if spaces are allowed into filenames.
On the other hand, once a directory is opened, the file names are read via a special command designed for the OS, and if the OS permits spaces, the entire file name up to the end charactor (generally control-Z or NULL). Thus the sub directories and files will be correctly handled. But with spaces in the names, error messages regarding parsing, or tracing the file contents may be ambiguous to the operator. It is not illegal to put spaces in filenames, but is should be considered a bad practice, and avoided. But it is your system, so YMMV.
Regards, Les H
Thanks Les for that very thorough explanation. I will be more carefull about spaces in the future.
A related question, is. How do I find out how many files are in the Sounds-Library directory, including all subdirectories. I looked at ls, but that will only give a list of files, as far as I can see.
Thanks.
Nigel.
There may be better techniques, but I have used something like: % ls -al | grep -c '\n' Which does the recursive list and then counts the lines. This will include the directories I think, but you can try it. There are also varients of the du, df, and ls commands that can provide this sort of functionality.
I only got a count of 30 from that, which is way out.
Try: % man -k file
Looked at that. My there's loads to absorb there, but nothing seemed to match what I was looking for. I also tried man -k dir, without success.
To see a list of commands that work on files. Some of the Admin specific folks can offer help on this as well.
I posted also to the KDE list after your reply to see if there was an option for Konqueror to show total files in a directory, and also asked about a CLI solution.
Kevin Krammer gave me this CLI one which works.
$ find /path/to/folder -type f | wc -l
My 8.4GB of used space in Sounds-Library is taken up by 17480 .wav files. As I said to Kevin, it's little wonder I have problems finding the right sound to use.
Nigel.
Regards, Les H.
On Sat, 2007-03-10 at 16:03 +0100, Nigel Henry wrote:
On Friday 09 March 2007 01:13, Les wrote:
I have a question about du though. On the other machine where I wanted to find out the size of my soundfiles directory, du couldn't access it because it was named "Sounds Library" , without the quotes. I renamed it putting a hyphen between the 2 words, and then du accessed the directory ok, but all of the subdirectories are multi worded without any hyphens, and du didn't have any problem with them. Any reason why du will not access the main directory without hyphenated words, and yet has no problem with all the subdirectories?
It's not a big deal, just puzzling.
btw. The now Sounds-Library (with the hyphen) is on a separate harddrive so I have to run du as.
du -sh /mnt/hdb5/Sounds-Library
Hi, Nigel, The reason a command won't parse correctly with a space in the file name is due to the tokenizer used by the shell. It cannot deal with spaces in filenames. A space is the end of the word to the tokenizer unless it is inside Quotes or escaped in some way. Thus the command du xxx yyy is going to look for files xxx and then yyyy. This is true of most systems. otherwise there would be no way to chose which way to parse a command with several arguments, for example: cat xxx yyy aaa bbb ccc ddd > temp.txt
In this case should the result consist of files xxx, yyy, zzz, bbb, ccc, and ddd all being concatenated to a file called temp.txt, or should it be xxx yyy, zzz bbb, and ccc ddd? Moreover how would an unambiguous error message tell the operator what was wrong? What if files xxx, yyy zzz, bbb zzz, and ddd were all present? Is this what the operator meant? This is why a good administrator doesn't put spaces in system control files. It leads to ambigousity when working on the system, leading to errors and system corruption. Typo's that would be caught might not be if spaces are allowed into filenames.
On the other hand, once a directory is opened, the file names are read via a special command designed for the OS, and if the OS permits spaces, the entire file name up to the end charactor (generally control-Z or NULL). Thus the sub directories and files will be correctly handled. But with spaces in the names, error messages regarding parsing, or tracing the file contents may be ambiguous to the operator. It is not illegal to put spaces in filenames, but is should be considered a bad practice, and avoided. But it is your system, so YMMV.
Regards, Les H
Thanks Les for that very thorough explanation. I will be more carefull about spaces in the future.
A related question, is. How do I find out how many files are in the Sounds-Library directory, including all subdirectories. I looked at ls, but that will only give a list of files, as far as I can see.
Thanks.
Nigel.
try ls -a or ls -al
man on ls will give you some options to try. The best way to get at the commands is through man or Xman (an old utility that would list the man pages available by category).
Regards, Les H
On Sunday 11 March 2007 22:06, Les wrote:
Hi, Nigel, The reason a command won't parse correctly with a space in the file name is due to the tokenizer used by the shell. It cannot deal with spaces in filenames. A space is the end of the word to the tokenizer unless it is inside Quotes or escaped in some way. Thus the command du xxx yyy is going to look for files xxx and then yyyy. This is true of most systems. otherwise there would be no way to chose which way to parse a command with several arguments, for example: cat xxx yyy aaa bbb ccc ddd > temp.txt
In this case should the result consist of files xxx, yyy, zzz, bbb, ccc, and ddd all being concatenated to a file called temp.txt, or should it be xxx yyy, zzz bbb, and ccc ddd? Moreover how would an unambiguous error message tell the operator what was wrong? What if files xxx, yyy zzz, bbb zzz, and ddd were all present? Is this what the operator meant? This is why a good administrator doesn't put spaces in system control files. It leads to ambigousity when working on the system, leading to errors and system corruption. Typo's that would be caught might not be if spaces are allowed into filenames.
On the other hand, once a directory is opened, the file names are read via a special command designed for the OS, and if the OS permits spaces, the entire file name up to the end charactor (generally control-Z or NULL). Thus the sub directories and files will be correctly handled. But with spaces in the names, error messages regarding parsing, or tracing the file contents may be ambiguous to the operator. It is not illegal to put spaces in filenames, but is should be considered a bad practice, and avoided. But it is your system, so YMMV.
Regards, Les H
Thanks Les for that very thorough explanation. I will be more carefull about spaces in the future.
A related question, is. How do I find out how many files are in the Sounds-Library directory, including all subdirectories. I looked at ls, but that will only give a list of files, as far as I can see.
Thanks.
Nigel.
try ls -a or ls -al
man on ls will give you some options to try. The best way to get at the commands is through man or Xman (an old utility that would list the man pages available by category).
Regards, Les H
Hi Les. You may have missed the reply to you that I sent to the list.
I posted also to the KDE list to see if Konqueror's file manager would show file numbers including all files in subdirectories. The answer was yes, but in my FC2 with an older version of KDE this is not displayed, but in FC5, if you right click on for example my Sounds-Library directory, and go to properties, it does show a total for all files in the directory, including files in subdirectories. With my Sounds-Library that amounts to 17480 files.
Kevin Krammer at KDE also gave a CLI solution as below, and that works also.
$ find /path/to/folder -type f | wc -l
I did try ls -a, and ls -al, but both just give a subdirectory list, one with a bit more info than the other.
Thanks for the reply.
Nigel.
On Sun, Mar 11, 2007 at 22:42:41 +0100, Nigel Henry cave.dnb@tiscali.fr wrote:
$ find /path/to/folder -type f | wc -l
I did try ls -a, and ls -al, but both just give a subdirectory list, one with a bit more info than the other.
find is probably the best solution in this case. But if you do want a recursive directory list use the -R option. (On commands where recursion is an option, it is usually -r or -R. Use the man command or the --help option to get more information about the command.)
On Tue, Mar 06, 2007 at 10:01:38PM +0100, Nigel Henry wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
Nigel.
I wrote this a long time back for myself. It might suffice your needs. Cut paste the following code in a file say: dirsize, chmod +x dirsize and execute.
#-CUT & PASTE--------------------------------------------------------- #/bin/bash
IGNORE='proc /dev /sys /initrd /mnt /media'
# This script produces a list of dir size. Selects only MB and above entries.
# Arg is the dir name else pwd is selected if [ -z "$1" ]; then SDIR=`pwd` OutPut=/tmp`pwd` else SDIR=$1 OutPut=/tmp/${USER}/${1} fi
echo "Output file is ${OutPut}/dir-size.out"
mkdirhier ${OutPut} && ls -lAR --si --ignore="${IGNORE}" ${SDIR}|grep 'total' -B1|grep '^total[[:space:]][0-9.]*[mMgG][[:space:]]*' -B1 >${OutPut}/dir-size.out 2>&1 echo -e "\nTotal Size Of Dir $SDIR" >>${OutPut}/dir-size.out 2>&1 du -ach ${SDIR}|grep "[[:space:]]total$" >>${OutPut}/dir-size.out 2>&1
less ${OutPut}/dir-size.out #-CUT & PASTE---------------------------------------------------------
On Sun, Mar 18, 2007 at 01:44:10PM +0530, Vikram Goyal wrote:
Please update the code, if you chose to use it. It'll run with spaces in names also, just needed to quote...
#-CUT & PASTE--------------------------------------------------------- #/bin/bash
IGNORE='proc /dev /initrd /mnt'
# This script produces a list of dir size. Selects only MB and above entries.
# Arg is the dir name else pwd is selected if [ -z "$1" ]; then SDIR=`pwd` OutPut=/tmp`pwd` else SDIR=$1 OutPut=/tmp/${USER}/${1} fi
echo "Output file is ${OutPut}/dir-size.out"
mkdirhier "${OutPut}" && ls -lAR --si --ignore="${IGNORE}" "${SDIR}"|grep 'total' -B1|grep '^total[[:space:]][0-9.]*[mMgG][[:space:]]*' -B1 >"${OutPut}/dir-size.out" 2>&1 echo -e "\nTotal Size Of Dir $SDIR" >>"${OutPut}/dir-size.out" 2>&1 du -ach "${SDIR}"|grep "[[:space:]]total$" >>"${OutPut}/dir-size.out" 2>&1
less "${OutPut}/dir-size.out" #-CUT & PASTE---------------------------------------------------------
On 3/6/07, Nigel Henry cave.dnb@tiscali.fr wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
Nigel.
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Hi, I hope you appreciate this great one-liner I found for enhaced 'du' - it even knows how to sort kB, MB and GB sizes right!
ls -A | grep -v -e '^..$' |xargs -i du -ks {} |sort -rn |head -11 | awk '{print $2}' | xargs -i du -hs {}
Hope you like it.
On Mon, 2007-07-16 at 19:35 +0200, Valent Turkovic wrote:
On 3/6/07, Nigel Henry cave.dnb@tiscali.fr wrote:
This is a silly question perhaps. I have my soundfiles in a directory named Sounds Library, this contains many subdirectories, which contain the .wav files.
What command can I use to find out the disk space this directory is taking up, including all the files that are in the subdirectories?
Nigel.
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Hi, I hope you appreciate this great one-liner I found for enhaced 'du' - it even knows how to sort kB, MB and GB sizes right!
ls -A | grep -v -e '^..$' |xargs -i du -ks {} |sort -rn |head -11 | awk '{print $2}' | xargs -i du -hs {}
Very nice, but only summarizes the biggest 11 files (or directories). To get more, modify the "-11" option to the "head" command or remove the head command altogether (to get everything).
---------------------------------------------------------------------- - Rick Stevens, Principal Engineer rstevens@internap.com - - VitalStream, Inc. http://www.vitalstream.com - - - - What is a "free" gift? Aren't all gifts free? - ----------------------------------------------------------------------
ls -A | grep -v -e '^..$' |xargs -i du -ks {} |sort -rn |head -11 | awk '{print $2}' | xargs -i du -hs {}
Very clever, but a bit of a mouthful ;)
Just to clarify things for the original poster, you will probably find a simple,
du -sh /path/to/directory
is more than enough... e.g.
localhost ~ > du -sh ~/Pictures 5.2G /home/jonesc/Pictures
if you want something graphical, checkout the application 'filelight' - Its quite neat. (available via a 'yum install filelight').
Chris
On 3/8/07, Daniel Parish wrote:
Another GUI-based solution is Treesize; http://treesize.sourceforge.net/.
You can download kdirstat via yum. kdirstat provides a simple interface to view the size of your files.
yum install kdirstat
Chitlesh
On Monday 16 July 2007 20:40, Chris Jones wrote:
ls -A | grep -v -e '^..$' |xargs -i du -ks {} |sort -rn |head -11 | awk '{print $2}' | xargs -i du -hs {}
Very clever, but a bit of a mouthful ;)
Just to clarify things for the original poster, you will probably find a simple,
du -sh /path/to/directory
is more than enough... e.g.
localhost ~ > du -sh ~/Pictures 5.2G /home/jonesc/Pictures
if you want something graphical, checkout the application 'filelight' - Its quite neat. (available via a 'yum install filelight').
Chris
Being the original poster, du -sh /path/to/directory worked fine for me.
Just where did Valent find this posting so as to reply to it? I asked the question ages ago.
Nigel.
On Mon, 16 Jul 2007 19:40:54 +0100 Chris Jones jonesc@hep.phy.cam.ac.uk wrote:
if you want something graphical, checkout the application 'filelight' - Its quite neat. (available via a 'yum install filelight').
Baobab comes with the gnome-utils rpm that is installed by default.
Main Menu - System Tools - Disk Usage Analyzer
On 7/16/07, Chris Jones jonesc@hep.phy.cam.ac.uk wrote:
ls -A | grep -v -e '^..$' |xargs -i du -ks {} |sort -rn |head -11 | awk '{print $2}' | xargs -i du -hs {}
Very clever, but a bit of a mouthful ;)
Just to clarify things for the original poster, you will probably find a simple,
du -sh /path/to/directory
is more than enough... e.g.
localhost ~ > du -sh ~/Pictures 5.2G /home/jonesc/Pictures
if you want something graphical, checkout the application 'filelight' - Its quite neat. (available via a 'yum install filelight').
Chris
-- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
I have been trying to install ncdu[1] Ncourses version of du which should provide graphical presentation in cli of disk usage. I love filelight but I would also like to have a cli graphical tool for disk usage.
Has anybody suceeded in compiling ncdu for FC6 or F7? If you did please tell me how - I can't make it compile.
[1] http://dev.yorhel.nl/ncdu/
On 7/16/07, Nigel Henry cave.dnb@tiscali.fr wrote:
On Monday 16 July 2007 20:40, Chris Jones wrote:
ls -A | grep -v -e '^..$' |xargs -i du -ks {} |sort -rn |head -11 | awk '{print $2}' | xargs -i du -hs {}
Very clever, but a bit of a mouthful ;)
Just to clarify things for the original poster, you will probably find a simple,
du -sh /path/to/directory
is more than enough... e.g.
localhost ~ > du -sh ~/Pictures 5.2G /home/jonesc/Pictures
if you want something graphical, checkout the application 'filelight' - Its quite neat. (available via a 'yum install filelight').
Chris
Being the original poster, du -sh /path/to/directory worked fine for me.
Just where did Valent find this posting so as to reply to it? I asked the question ages ago.
Nigel.
Ah Nigel I was on one of mine google search sprees :) I got stuck with one tool (ncdu[1]) and couldn't remember where I read about it so I searched all about it so this email poped up in my gmail search....
[1] http://dev.yorhel.nl/ncdu/