-   Linux - Server (
-   -   hostname command not found (

L1nuxn00b703 03-25-2014 11:34 AM

hostname command not found
hello all,

Im getting the strangest error. When I attempt to run the hostname command, I keep getting the following error:

/bin/hostname: Command not found

I've verified that the hostname command exists and installed:

# which hostname

# ls -l /bin/hostname
-rwxr-xr-x 1 root root 17848 Apr 26 2012 /bin/hostname

# /bin/hostname
/bin/hostname: Command not found

# rpm -qa | grep net-tools

Also there is another user logging into this server via ssh and they are getting another error:

$ hostname
hostname: hostname: cannot execute [Exec format error]

This is user is in the ksh shell compared to the BASH shell I'm in above. All $PATH variables are correct. I'm out of ideas.... Has anyone experienced this issue before?


AlucardZero 03-25-2014 12:46 PM

what is the output of

file /bin/hostname
uname -m

rknichols 03-25-2014 12:55 PM

And, if those don't yield a clue, the output from

ldd /bin/hostname
might be instructive.

smallpond 03-25-2014 12:58 PM

Also "alias"

L1nuxn00b703 03-25-2014 01:07 PM

Please see below:

# uname -a
Linux or1dlxvp002 2.6.32-358.23.2.el6.x86_64 #1 SMP Sat Sep 14 05:32:37 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
# file /bin/hostname
/bin/hostname: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
# uname -m
# ldd /bin/hostname => (0x00007fffc5cdb000) => /lib64/ (0x0000003de7e00000) => /lib64/ (0x0000003de6600000) => /lib64/ (0x0000003de6200000)
/lib64/ (0x0000003de5e00000)

voleg 03-30-2014 02:49 AM


# rpm -V net-tools
Let's see if binary really broken.

All times are GMT -5. The time now is 04:01 PM.