This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to display Free Space in byte?

Tags: None
(comma "," separated)
shurato
Registered Member
Posts
17
Karma
0

How to display Free Space in byte?

Wed Apr 01, 2020 9:43 am
As above.
I know there are settings to enable size of files and folders to be displayed in byte.
But I can't find the setting to display free space of my partitions in byte.
And "Disk", "Partition Manager", "FileLight", etc, also not able to display free space in byte.

Is there any way to do so?
Or I need a Dolphin plug in? Pls recommend me.
Or I need other app?

Thanks.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
What is the use case to display it in byte? You can always do this in a konsole, btw, I just wonder why you would have to do this in Dolphin?


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
shurato
Registered Member
Posts
17
Karma
0
Mamarok wrote:What is the use case to display it in byte? You can always do this in a konsole, btw, I just wonder why you would have to do this in Dolphin?

I manage a vast collection of HDDs.
And before i transfer my data to these HDDs, I need to know whether the data would fit or not.
And sometimes, it is down to byte.

I came from Win10, and it can be done in File Explorer.
Nemo can also display it.
I'm still learning Linux, and it seems like the df command only show free space in 1k-block size?
What would be the correct command to display it in byte?

Btw, isn't Dolphin a file manager?
Is there no native setting to enable it?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hi!

You may use different utilities for displaying the size in bytes, but you must be aware of the filesystem used. So a file using 123 byte on e.g. ext4 may use a different value on another filesystem.

Useful would be:
Code: Select all
df  # display total size of mounts. You may alter the output with -B option
du -b # disk-usage with -b for bytes
ls -la  # for folder content, with -s you get the block size

The easiest way to fit your needs will be to open a Konsole-Part in Dolphin with F4 (default) and type the command you want. You may think about a service file too, which would calculate summaries, if you need this.
shurato
Registered Member
Posts
17
Karma
0
koffeinfriedhof wrote:Hi!

You may use different utilities for displaying the size in bytes, but you must be aware of the filesystem used. So a file using 123 byte on e.g. ext4 may use a different value on another filesystem.

Useful would be:
Code: Select all
df  # display total size of mounts. You may alter the output with -B option
du -b # disk-usage with -b for bytes
ls -la  # for folder content, with -s you get the block size

The easiest way to fit your needs will be to open a Konsole-Part in Dolphin with F4 (default) and type the command you want. You may think about a service file too, which would calculate summaries, if you need this.

Thanks!
I'm pretty new to Linux, and when i typed
Code: Select all
df -B
i need to specify the options? And is there an option to specify size by byte?
My data partitions are in NTFS, and those are the partitions I need to know the size by byte.
Thanks.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
df has not bytes as output available. But you may use --block-size=KiB and use factor 1000 to get close to the used bytes.

As I do not use ntfs-format at all, I have no idea if its bigger or smaller after copied. Try it with some files in different sizes and compare the output of ls -la /path/to/original and ls -la /path/to/copy/on/ntfs-partition

Another way is using Krusader as file-browser for these cases which has byte as default display format available. But as already mentioned, you cannot use everything but the last byte on manual calculating sizes.
shurato
Registered Member
Posts
17
Karma
0
koffeinfriedhof wrote:df has not bytes as output available. But you may use --block-size=KiB and use factor 1000 to get close to the used bytes.

As I do not use ntfs-format at all, I have no idea if its bigger or smaller after copied. Try it with some files in different sizes and compare the output of ls -la /path/to/original and ls -la /path/to/copy/on/ntfs-partition

Another way is using Krusader as file-browser for these cases which has byte as default display format available. But as already mentioned, you cannot use everything but the last byte on manual calculating sizes.

Thanks koffeinfriedhof and noted on that.
As DF doesn't have byte as output, I might as well use Nemo to do it.

I like Dolphin, but it feels like a crippled FM to me:
- no bulk renamer like Thunar's.
- funny behaviour when deleting from data partition (viewtopic.php?f=224&t=165278)
- cannot display free space by byte, like Nemo.

Past 2 months have been crazy months to me - i have been doing distro hopping, and tried 10 different installations.
KDE with Manjaro is my fav combo, but lots of issue with Kontact, Dolphin, vlc.

I hope KDE team can iron out the issues soon, and i'm quite confident KDE can become the most fav DE.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
I would prefer native arch over Manjaro, but that is up to the user :)

As mentioned, you could give krusader a try. It is another approach of a file manager with more options integrated in the application than need for hacking configuration files or searching the web for addons. I rarely need a file manager, so there may be others knowing which plugins or service-menues are the best for your needs.
shurato
Registered Member
Posts
17
Karma
0
koffeinfriedhof wrote:I would prefer native arch over Manjaro, but that is up to the user :)

As mentioned, you could give krusader a try. It is another approach of a file manager with more options integrated in the application than need for hacking configuration files or searching the web for addons. I rarely need a file manager, so there may be others knowing which plugins or service-menues are the best for your needs.

My 1st Linux has been Ubuntu, and all subsequent installations were Ubuntu derivatives.
I was a bit phobia to try non-Ubuntu distros, but after seeing Manjaro's ranking and their videos, I decided to give it a try.
Only then, I realize Manjaro is built upon Arch.
;D
Anyway, I thought being chosen to replace Krusader, Dolphin should have better functionality than Krusader?
Is there any reason you were recommending Krusader over Dolphin?
More importantly, can it show "free space in byte" or similar bulk rename functionality as Thunar?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
shurato wrote:Is there any reason you were recommending Krusader over Dolphin?

No, only saw it has byte-view available. That was the only point. I'm using Yakuake (Drop down terminal) and Emacs for most file actions.

I also do not know what the bulk renaming in Thunar works like, but have a look at krename which should be already installed. There you have regex-replacement und stuff like this.
shurato
Registered Member
Posts
17
Karma
0
koffeinfriedhof wrote:
shurato wrote:Is there any reason you were recommending Krusader over Dolphin?

No, only saw it has byte-view available. That was the only point. I'm using Yakuake (Drop down terminal) and Emacs for most file actions.

I also do not know what the bulk renaming in Thunar works like, but have a look at krename which should be already installed. There you have regex-replacement und stuff like this.

Ok, I think Krusader's byte view is for file and folder, not for free space.
The Bulk Renamer in Thunar, can delete X number of characters at Y position.
This feature is missing in EVERY other renamer that i have tried, including KRename.
In Windows, there is a ANT renamer - it is portable, and can do multiple strings replacement at the same time.
This "multiple string" is not available in EVERY Linux renamer.
The best alternative I can find now, is the Thunar version.
:(
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
KRename can do this by using RegEx. On the 4th page there is a "Find and Replace"-Button, where you can enter (multiple) values. Keeping only a part from a filename does work with "Insert part of filename"-Button where you select the part you want - or the one you not want and check "inverted".

But this does not show you the space available :)

So you do not need every file in bytes, just a summary? Then du is your friend. To only see the sum itself you may use
Code: Select all
du -b -d0 .
where -b is the switch to display bytes, -d0 means no split up in subfolders.

Example:
Code: Select all
me@x220arch[~]› du -b -d1 /bin/
43543   /bin/lou_maketable.d
391980  /bin/vendor_perl
406445  /bin/core_perl
4096    /bin/site_perl
1130764142      /bin/
me@x220arch[~]› du -b -d0 /bin/
1130764142      /bin/
me@x220arch[~]›
shurato
Registered Member
Posts
17
Karma
0
Hi koffeinfriedhof.

Unfortunately in my list of files, the file name pattern is like this:

Prefix ABC [num] [random code] suffix MNO.xyz

So i need to replace "Prefix ABC" with "Prefix EFG" by using search and replace.
Remove [random code] by delete x character by position
Search and replace suffix MNO with suffix PQR.

KRename unable to do delete x character by position.

Code: Select all
du -b -d0
display the usage of space, not the free space.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Free space is available with df using the -B argument.
Code: Select all
df -P --block-size=1 .
for the space available in the current folder.

KRename is another topic. But have a try with [$;6]PQR for ABC with a two-digit number. Perhaps it would be easier with regex in awk, perl or python to handle things like this. KRename has its own syntax.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]