duc icon indicating copy to clipboard operation
duc copied to clipboard

duc ls return only file size or number of files

Open chrisdane opened this issue 4 years ago • 3 comments

Hi

I would like to have an option that duc ls returns the sizes (or number of files) only, without the corresponding directory names.

Thanks for this great software! Chris

chrisdane avatar Mar 04 '21 08:03 chrisdane

chrisdane> I would like to have an option that duc ls returns the chrisdane> sizes (or number of files) only, without the corresponding chrisdane> directory names.

So let me be sure I understand you.

If you have 10 files, 1 through 10 in the directory foo, along with the directories foo/a ... foo/z, which have a mix of files and directories on them, you want to only report on the files in the directory foo and how much space they take?

At that point, its really simpler to just do: 'ls -s -F

| sort -n' to get back useful data. The entire goal of duc is to make finding where in the filesystem the space is taken up, not in a single directory.

chrisdane> Thanks for this great software!

You're welcome, Zevv is the master though, I'm just the helper.

John

l8gravely avatar Mar 05 '21 02:03 l8gravely

Hi John

Your command suggestion does not what I have in mind:

duc ls path/
103.3T subpath1
duc ls -b path/
113631019048960 subpath1
duc ls -wb path/
113631019048960

with e.g. option w ('without') for showing the size only.

chrisdane avatar Mar 05 '21 08:03 chrisdane

"chrisdane" == chrisdane [email protected] writes:

chrisdane> Hi John chrisdane> Your command suggestion does not what I have in mind:

chrisdane> duc ls path/ chrisdane> 103.3T subpath1 chrisdane> duc ls -b path/ chrisdane> 113631019048960 subpath1 chrisdane> duc ls -wb path/ chrisdane> 113631019048960

chrisdane> with e.g. option w ('without') for showing the size only.

Ah... so how about:

duc ls -b path/ | awk '{print $1}'

l8gravely avatar Mar 05 '21 16:03 l8gravely