garabik / pydf Goto Github PK
View Code? Open in Web Editor NEWdf(1) clone with colour output
License: Other
df(1) clone with colour output
License: Other
Hi,
Seems to see have some colors even with --bw flag
pydf -h --bw | cat -v
Filesystem Size Used Avail Use% Mounted on
/dev/root 914G 862G 24G 94.3 [#########.] /
/dev/mmcblk0p1 252M 48M 204M 19.1 [##........] /boot
/dev/loop2 46M 46M ^[[36m 0 ^[[36m100.0 ^[[36m[##########] ^[[36m/snap/core18/1889
/dev/loop3 46M 46M ^[[36m 0 ^[[36m100.0 ^[[36m[##########] ^[[36m/snap/core18/1937
/dev/loop0 46M 46M ^[[36m 0 ^[[36m100.0 ^[[36m[##########] ^[[36m/snap/core18/2126
/dev/loop1 72M 72M ^[[36m 0 ^[[36m100.0 ^[[36m[##########] ^[[36m/snap/scrcpy/250
/dev/loop5 72M 72M ^[[36m 0 ^[[36m100.0 ^[[36m[##########] ^[[36m/snap/scrcpy/255
/dev/loop4 72M 72M ^[[36m 0 ^[[36m100.0 ^[[36m[##########] ^[[36m/snap/scrcpy/286
/dev/root 914G 862G 24G 94.3 [#########.] /var/hdd.log
I have to use
| sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"
to remove the colors.
bind mounts no longer contain bind
or rbind
in opts, so they're shown by default. pydf
should be updated to read from /proc/self/mountinfo
as it is now (since Linux 2.6.26) the most comprehensive place to look for mount details. man proc
explains the format.
Enhancement request: It would be nice to have a -w (--width) argument to manually set the width of the graph bar to n characters. When piping the output of pydf to grep, the graph bar becomes very narrow, so this option would let us widen the graph bar when using pydf in conjunction with grep.
Example from Ubuntu, the graph bar is only 5 characters wide, 7 including the square brackets. There's plenty of room on my terminal for a wider graph bar. I would like to use the option to set the width to 15-20 characters, including the square brackets.
$ pydf | egrep -v "/loop|/snap"
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 107G 39G 64G 36.4 [##...] /
/dev/sda1 3764M 193M 3360M 5.1 [.....] /boot
/dev/sdb1 2015G 23G 1889G 1.2 [.....] /home
kirk 2748G 1962G 786G 71.4 [####.] /kirk
picard 5545G 3181G 2363G 57.4 [###..] /picard
spock 5542G 3481G 2062G 62.8 [###..] /spock
Hi,
I am trying to grep the usage% from pydf.
It works fine under old fashioned df
df -H | grep -vE "^Filesystem|tmpfs|cdrom" | awk '{print $5 " " $6}'
98% /
100% /snap/scrcpy/250
100% /snap/core18/1889
100% /snap/scrcpy/286
100% /snap/core18/2126
100% /snap/scrcpy/255
100% /snap/core18/1937
20% /boot
13% /var/log
However I cant it to work under pydf.. It sort of works but not fully.
pydf -H | grep -vE "^Filesystem|tmpfs|cdrom" | awk '{print $7 " "$1}'
Filesystem
94.3 /dev/root
/dev/mmcblk0p1
0 /dev/loop2
0 /dev/loop5
0 /dev/loop0
0 /dev/loop1
0 /dev/loop4
0 /dev/loop3
94.3 /dev/root
You can see it sort of works. it grabs the 94.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.