Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #220061

Re: why is my local user (/dev/sda5) drive not being displayed by df?

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: why is my local user (/dev/sda5) drive not being displayed by df?
Date 2020-03-11 13:50 +0100
Message-ID <zJ8Ya-2TY-1@gated-at.bofh.it> (permalink)
References <zHG7T-4i8-1@gated-at.bofh.it> <zHGhz-4lF-1@gated-at.bofh.it> <zJ8ls-2FR-17@gated-at.bofh.it> <zJ8EO-2MT-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Mar 11, 2020 at 01:21:17PM +0100, tomas@tuxteam.de wrote:
> On Wed, Mar 11, 2020 at 01:02:59PM +0100, Albretch Mueller wrote:
> >  with your help I found a way around it (here is my silly scripting):
> > 
> > $ sudo _DF=$(df -h)
> 
> I don't think you need "sudo" for "df"?

And a good thing, too, because that syntax is completely wrong.

wooledg:~$ sudo x=$(id)
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-T timeout] [-u user] file ...
wooledg:~$ sudo x=$(df -h)
[sudo] password for wooledg: 
sudo: Size: command not found

I think what Albretch was *trying* to do was this:

_DF=$(sudo df -h)

which would work, but as Tomas said, the sudo is just not needed.

P.S. see <https://mywiki.wooledge.org/BashFAQ/094> for more information
on parsing df output, in general.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

why is my local user (/dev/sda5) drive not being displayed by df? Albretch Mueller <lbrtchx@gmail.com> - 2020-03-07 12:50 +0100
  Re: why is my local user (/dev/sda5) drive not being displayed by df? Reco <recoverym4n@enotuniq.net> - 2020-03-07 13:00 +0100
    Re: why is my local user (/dev/sda5) drive not being displayed by df? Albretch Mueller <lbrtchx@gmail.com> - 2020-03-11 13:10 +0100
      Re: why is my local user (/dev/sda5) drive not being displayed by df? <tomas@tuxteam.de> - 2020-03-11 13:30 +0100
        Re: why is my local user (/dev/sda5) drive not being displayed by df? Greg Wooledge <wooledg@eeg.ccf.org> - 2020-03-11 13:50 +0100
          Re: why is my local user (/dev/sda5) drive not being displayed by df? <tomas@tuxteam.de> - 2020-03-11 14:00 +0100
            Re: why is my local user (/dev/sda5) drive not being displayed by df? Greg Wooledge <wooledg@eeg.ccf.org> - 2020-03-11 15:50 +0100
              Re: why is my local user (/dev/sda5) drive not being displayed by df? David Wright <deblis@lionunicorn.co.uk> - 2020-03-11 16:20 +0100
            Re: why is my local user (/dev/sda5) drive not being displayed by df? David Wright <deblis@lionunicorn.co.uk> - 2020-03-11 15:50 +0100
              Re: why is my local user (/dev/sda5) drive not being displayed by df? rhkramer@gmail.com - 2020-03-11 16:20 +0100
                Re: why is my local user (/dev/sda5) drive not being displayed by df? David Wright <deblis@lionunicorn.co.uk> - 2020-03-11 16:50 +0100
  Re: why is my local user (/dev/sda5) drive not being displayed by df? Eduardo M KALINOWSKI <eduardo@kalinowski.com.br> - 2020-03-07 13:10 +0100

csiph-web