Git Product home page Git Product logo

pydf's People

Contributors

garabik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pydf's Issues

Colors even with --bw

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

image

I have to use
| sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"
to remove the colors.
image

bind mounts are not hidden by default

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.

graph bar width enhancement

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                             

"Use%" only as an integer

"Use%" is currently displayed with one decimal place. I don't know what this accuracy is supposed to be for. I changed my local version so that the values ​​are displayed there as whole numbers and with the "%" character. This is quicker to grasp with the eye than the elongated numbers.

screenshot-2021 11 26-174104

Grep+awk % usage

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.