Question about "ls -f -l" command output in RHEL 5.2 and Red Hat 6
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.
Question about "ls -f -l" command output in RHEL 5.2 and Red Hat 6
Hey all, I am just here hoping someone can help me out with a problem.
I am having an issue that I need to get resolved. The background to the scenario is, a project at work is currently using a system running Red Hat 6. It is being accessed by another system (an HP system) to pull files for testing hardware. Basically, when it pulls the files, they are being pulled the same as what the "ls -f -l" command would return, so list format with the files listed alphabetically. So, an ls -f -l command outputs the files as A, B, C, D, etc.... in that order
The project has implemented a new Linux box to replace the Red Hat 6 system and it is now running RHEL 5.2. When the HP system accesses this new Linux box to pull the same files, the output is returned with the files out of order, no longer in alphabetical order. The ls -f -l command on this new system returns the same set of files as B, D, A, C.... consistently in that order.
The code that the HP box uses to access the files depends on the output to be in the A, B, C, D.... order (yeah, poor coding but it is an OLD system).
Is there a way to change the output order that the ls -f -l command displays in RHEL 5.2 so that it will return the alphabetical order rather than whatever order it is currently outputting?
I apologize if this is a bit confusing, I am not a Linux admin by any means but it has been handed to me to resolve. Any help would be greatly appreciated. Thanks in advance.
so you can rid of this peculiar output by not specifying -f. that may not be what you want, but it will be different.
If you really want to gain control, you may have to pipe the output through something else (sort, awk?) to sort it into the order that you want, if you can define that.
salasi, yeah, that is what we were thinking but the code that accesses the data depends on the order of the output looking like the order supplied by the -f command. It was coded poorly and the group using the code (who also wrote the code) said it is a ridiculous amount of code to change and are looking for a way to change the output through the OS. Unfortunately, from our IT department's standpoint, the code is not going to change unless it is the last resort. The output we need it to pull is what the standard ls -l output gives us (sorted) but unfortunately the code pulls it with the -f option (unsorted), which is now different in RHEL 5.2.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.