Operating System - HP-UX
1825139 Members
4827 Online
109679 Solutions
New Discussion юеВ

Re: problem with command df -h

 
Hector Flores_1
New Member

problem with command df -h

I need execute the command df -h at HPUX 11.31, but Igot the following error:

[12:54:59] monitor1:~$ df -h
df: illegal option -- h
usage : df [-F FStype] [-V] [-egiklnvfb] [-t|-P] [-o specific_options]
[special | directory ...]

HPUX 11.11 with this version there is no problem:
[12:56:28] monitor2:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vg00/lvol3 2.0G 218M 1.7G 11% /
/dev/vg00/lvol1 500M 109M 341M 25% /stand
/dev/vgaxis02/wrk 6.0G 5.3G 740M 88% /wrk
/dev/vg00/lvol5 8.0G 6.6G 1.4G 82% /var
9 REPLIES 9
Jeff_Traigle
Honored Contributor

Re: problem with command df -h

Are you sure you're running HP's version of df on the 11.11 system? The -h option is available on Linux so it seems like you might be using the GNU version of df on the 11.11 box. The HP version in 11.11 doesn't have that option either.
--
Jeff Traigle
James R. Ferguson
Acclaimed Contributor

Re: problem with command df -h

Hi Hector:

The '-h' switch isn't valid on 11.11 either. It appears that someone has created a command (script) that accepts the '-h' switch as an "alias" for 'bdf'. In GNU/Linux, 'df -h' is valid.

What does this show?

# whereis df

Regards!

...JRF...
Hector Flores_1
New Member

Re: problem with command df -h

this appear with #wheris df:

[13:18:37] monitor-pgcaxis:/$ whereis df
df: /usr/bin/df /usr/local/bin/df /usr/old/bin/df /usr/local/man/man1/df.1 /usr/share/man/man1m.Z/df.1m


Sajjad Sahir
Honored Contributor

Re: problem with command df -h

dear Hector

whereis df
whereis ls
etc... this way u have to use
not whereis ls -a whereis df -k etc...

thanks and regards

sajjad
Sajjad Sahir
Honored Contributor

Re: problem with command df -h


dear hector
if u are using
whereis xntpd
then will display

/usr/sbin/xntpd that means i can understand

xntpd is under /usr/sbin directory ok

thanks and regards

sajjad
Sajjad Sahir
Honored Contributor

Re: problem with command df -h

dear
/usr/bin/df
/usr/local/bin/df

u command is present in /usr/bin/df and /usr/local/bin/df

thanks

sajjad
James R. Ferguson
Acclaimed Contributor

Re: problem with command df -h

Hi (again) Hector:

Examine your PATH to see which is first: '/usr/bin' or '/usr/local/bin'. If it is the 'local' path, then when you do 'df' you are targeting the version therein, which must be a non-standard 'df'.

Otherwise, you may have an alias set in your '.profile' like:

# alias df='/usr/local/bin/df -h'

TO see if this is the case, do:

# whence -v df

If you have an alias this will return something like:

df is an alias for /usr/local/bin/df -h

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: problem with command df -h

You have two versions of df but HP-UX has only one which is located in /usr/bin. Someone has installed another version in /usr/local/bin. For OS utilities, that is a bad thing since your PATH may select the wrong one. You can try the what command to see if one is a GNU version:

what /usr/bin/df /usr/local/bin/df

NOTE: Make sure that /usr/local directories are 755 permission. The default value has been 777 (a very bad thing) for many years) as anyone can create anything in a 777 directory. If someone decided to install GNU utilities, there is a very important step to rename duplicate programs (ie, df should be called gdf). Using other versions of OS commands can cause a lot of problems with scripts and other tools.

The whereis command is not very useful as it does not tell you which version you are running. Always use the "type" command (or whence -v which is aliased to type):

type df

This will change whenever your $PATH variable is modified.


Bill Hassell, sysadmin
Sajjad Sahir
Honored Contributor

Re: problem with command df -h


dear
please assign points

sajjad