LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 12: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, 01:34 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,238

Rep: Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712
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, 02:21 AM   #3
ArfaSmif
Member
 
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Fedora, Centos, Manjaro
Posts: 317

Rep: Reputation: 70
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, 02: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, 03:28 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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, 03: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, 09:27 PM   #7
Lunar
Member
 
Registered: Feb 2005
Location: Texas, USA
Distribution: opensuse
Posts: 106
Blog Entries: 1

Rep: Reputation: 8
# 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, 09:37 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 18,774
Blog Entries: 28

Rep: Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977
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, 10:32 AM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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, 11:44 AM   #10
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,452

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
Check integrity with
Code:
rpm --verify rpm && echo ok
rpm --verify bash && echo ok
rpm --verify coreutils && echo ok
 
Old 12-21-2016, 12:43 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,258

Rep: Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207
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, 10:45 PM   #12
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
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-21-2016 at 11:22 PM.
 
Old 12-22-2016, 11:32 AM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
$ \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 07:27 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
"stalled" problem in " scp" command gentleshark Linux - Software 1 08-30-2005 02:08 AM
"stalled" problem in " scp" command gentleshark Linux - Networking 1 08-29-2005 12:41 PM
What can I do facing boot "kernel panic", except reinstallation? yuzuohong Linux - General 1 03-21-2003 09:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:00 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
Open Source Consulting | Domain Registration