Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252
Rep:
Quote:
Originally Posted by vasulogin
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
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.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.