LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   hostname command not found (https://www.linuxquestions.org/questions/linux-server-73/hostname-command-not-found-4175499415/)

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
/bin/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
net-tools-1.60-110.el6_2.x86_64


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?

Thanks

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
Code:

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
x86_64
# ldd /bin/hostname
linux-vdso.so.1 => (0x00007fffc5cdb000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003de7e00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003de6600000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003de6200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003de5e00000)

voleg 03-30-2014 02:49 AM

Code:

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


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