LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-25-2014, 11:34 AM   #1
L1nuxn00b703
Member
 
Registered: Sep 2009
Posts: 117

Rep: Reputation: 15
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
 
Old 03-25-2014, 12:46 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
what is the output of

file /bin/hostname
uname -m
 
Old 03-25-2014, 12:55 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,535

Rep: Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077Reputation: 2077
And, if those don't yield a clue, the output from
Code:
ldd /bin/hostname
might be instructive.
 
Old 03-25-2014, 12:58 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 7
Posts: 3,532

Rep: Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974Reputation: 974
Also "alias"
 
Old 03-25-2014, 01:07 PM   #5
L1nuxn00b703
Member
 
Registered: Sep 2009
Posts: 117

Original Poster
Rep: Reputation: 15
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)
 
Old 03-30-2014, 02:49 AM   #6
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 353

Rep: Reputation: 51
Code:
# rpm -V net-tools
Let's see if binary really broken.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HOSTNAME = hostname -> HOSTNAME: command not found ? thomas2004ch Linux - Software 2 08-26-2013 08:25 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
hostname not found? iansworld SUSE / openSUSE 1 12-08-2004 07:03 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM
hostname: not found php Linux - General 2 11-19-2001 06:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration