LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2008, 01:46 AM   #1
vasulogin
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Red face Facing a Problem with "ls" command.


Hi..

can some tell me how to come out with "ls" command problem. the Problems is as shown bellow.

[root@vasant ~]# ls -h
ls: invalid option -- h
Try `ls --help' for more information.
[root@vasant ~]# ll -h
ls: invalid option -- h
Try `ls --help' for more information.


here with ls -h option is not working and when I checked with version it was changed to older.

i.e.,

[root@vasant ~]# ls --version
ls - GNU fileutils-3.13
[root@vasant ~]#


When the OS (I'm using CentOS 5 before this i was RHEL 5. due to same problem i went with reinstall option and i change over to CentOS 5) was installed it was working fine. after some days i started with above problem.

So please help me to come out with this problem. or else i need to keep re-installing the OS, which i cant do it as my system is a small server with nfs configured.


Thanks in advance.
 
Old 11-27-2008, 02:34 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,254

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Interesting. On my F8 I get

>ls --version
ls (GNU coreutils) 6.9

I wouldn't have expected that large a diff in version nums.

Try

which ls

Also, try re-installing fileutils from the DVD and then immediately check the -h flag and the version.
There's a small possibility someone has put a different (rogue ? ) version on your system.
 
Old 11-27-2008, 03:21 AM   #3
ArfaSmif
Member
 
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Always back to Fedora
Posts: 263

Rep: Reputation: 52
Also see if you have ls (or anything else for that matter) aliased. Use the "alias" command to find out whether ls is aliased.
 
1 members found this post helpful.
Old 11-27-2008, 03:49 AM   #4
jiobo
Member
 
Registered: Nov 2008
Posts: 180

Rep: Reputation: 36
FC10 "ls (GNU coreutils) 6.12", ls -h works fine.
 
Old 11-27-2008, 04:28 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
As already suggested check if ls is aliased to something else and/or points to an older installed package. Try:
Code:
type ls
which ls
whereis ls
The GNU fileutils package has been dismissed long time ago. Here it is the explanation from the GNU website:
Quote:
Fileutils, Shellutils, and Textutils have been combined into the GNU Coreutils package.
All further development and discussion is now taking place as Coreutils. The last separate
versions were fileutils-4.1.11, textutils-2.1, and sh-utils-2.0.15. The first major release
of coreutils-5.0 was announced on Fri, 4 April 2003.
 
Old 11-27-2008, 04:53 AM   #6
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 32
Quote:
Originally Posted by vasulogin View Post
Hi..

can some tell me how to come out with "ls" command problem. the Problems is as shown bellow.

[root@vasant ~]# ls -h
ls: invalid option -- h
Try `ls --help' for more information.
[root@vasant ~]# ll -h
ls: invalid option -- h
Try `ls --help' for more information.


here with ls -h option is not working and when I checked with version it was changed to older.

i.e.,

[root@vasant ~]# ls --version
ls - GNU fileutils-3.13
[root@vasant ~]#


When the OS (I'm using CentOS 5 before this i was RHEL 5. due to same problem i went with reinstall option and i change over to CentOS 5) was installed it was working fine. after some days i started with above problem.

So please help me to come out with this problem. or else i need to keep re-installing the OS, which i cant do it as my system is a small server with nfs configured.


Thanks in advance.
Run rootkit hunter to check if your system has been hacked. ls -h should work on any system
 
1 members found this post helpful.
Old 12-20-2016, 10:27 PM   #7
Lunar
Member
 
Registered: Feb 2005
Location: Texas, USA
Distribution: opensuse
Posts: 96

Rep: Reputation: 3
# ls: invalid option --'2'

I had a similar issue.
based on a reply by Matir to a post of a similar issue, I found that I had a file named -2016... whatever.
The issue was the - (hyphen) an ls -Option switch.. Never had issue before, but after renaming -2016..file to, well just minus the hyphen, all was well again.
Weird thing is I've always used hyphens and root didn't have the issue.

Landis.
 
Old 12-20-2016, 10:37 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 11,657
Blog Entries: 12

Rep: Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894
On CentOS 7 in a VM, I get this in my ~/Downloads directory.

Code:
$ ls -h
keepassx-0.4.4-1.el6.x86_64.rpm
It also seems to work properly in the Slackware --Current host.
 
Old 12-21-2016, 11:32 AM   #9
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,657
Blog Entries: 10

Rep: Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075
Quote:
Originally Posted by tajamari View Post
Run rootkit hunter to check if your system has been hacked. ls -h should work on any system
Not every thing is a "rootkit".
Terrible Advice IMO.
check for aliases, and exports?
Code:
bash --norc && ls -h
or
Code:
\ls -h
or
https://www.linuxquestions.org/quest...3/#post5644729

rootkit?
Yeah b/c hackers can be outed by ls ?
 
Old 12-21-2016, 12:44 PM   #10
MadeInGermany
Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 255

Rep: Reputation: 101Reputation: 101
Check integrity with
Code:
rpm --verify rpm && echo ok
rpm --verify bash && echo ok
rpm --verify coreutils && echo ok
 
Old 12-21-2016, 01:43 PM   #11
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 3,021

Rep: Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507
did you
Code:
ls --help
to see what is available to you, and how to use them with your ls command?
 
Old 12-21-2016, 11:45 PM   #12
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 639
Blog Entries: 7

Rep: Reputation: 220Reputation: 220Reputation: 220
and I thought someone had found my Yggdrasil cd

@vasulogin: haven't heard from you for 8LunarYEARS+1month!
ANNOUNCE: GNU file utilities 3.13 released Post Sun, 14 Jul 1996
Oh:rk!post#6beatsBOTH#9S! See "Figure 5" in: https://www.symantec.com/connect/art...three-rootkits

Last edited by Jjanel; 12-22-2016 at 12:22 AM.
 
Old 12-22-2016, 12:32 PM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,497
Blog Entries: 1

Rep: Reputation: 488Reputation: 488Reputation: 488Reputation: 488Reputation: 488
$ \ls --help

As previously mentioned, the \ before the command overrides any existing aliasing.

$ ls -l $(which ls)
-rwx-r-xr-x 1 root noob 118280 Mar 14 2015 /bin/ls -> /home/noob/hacked_you_bro

Just curious if the that is the ls you were looking for.

You might check the man page for ls, it might have just been different back then (doubt it). Although -h is the old notation, the --help is a fairly new "standard". Otherwise libc6 / binutils might have gotten corrupted. Check the partition for corruption and the device for any ailments (failings).
 
  


Reply

Tags
comand


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
Feeding the output of "diff" or "cat" command to dpkg --purge kushalkoolwal Debian 9 06-19-2008 08:27 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
"stalled" problem in " scp" command gentleshark Linux - Software 1 08-30-2005 03:08 AM
"stalled" problem in " scp" command gentleshark Linux - Networking 1 08-29-2005 01:41 PM
What can I do facing boot "kernel panic", except reinstallation? yuzuohong Linux - General 1 03-21-2003 10:15 PM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration