- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: make ls -al on linux look like ls -al on HP-UX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2005 03:57 AM
тАО01-21-2005 03:57 AM
I'm trying to figure out how to make
ls -al on Linux display like HP-UX so that the .files are displayed first in the list. I've tried various sort options, but don't know how to make the .files list first.
Would like to listing to be like...
.bashrc
.mozilla
dsamplefile
instead of ...
.bashrc
dsamplefile
.mozilla
Thanks in advance, Masaki
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2005 04:11 AM
тАО01-21-2005 04:11 AM
Re: make ls -al on linux look like ls -al on HP-UX
> ls -alXr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2005 06:46 AM
тАО01-21-2005 06:46 AM
Re: make ls -al on linux look like ls -al on HP-UX
davef@styx:~$ ls -a
.
..
.alias
.bash_history
.bash_profile
.bashrc
.cshrc
.viminfo
Maildir
net.log
test
davef@styx:~$
Here's the version output:
davef@styx:~$ ls --version
ls (coreutils) 5.2.1
Written by Richard Stallman and David MacKenzie.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
davef@styx:~$
hope that helps,
--Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2005 07:18 AM
тАО01-21-2005 07:18 AM
Re: make ls -al on linux look like ls -al on HP-UX
>ls --version
ls (coreutils) 4.5.3
Written by Richard Stallman and David MacKenzie.
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2005 09:03 AM
тАО01-21-2005 09:03 AM
SolutionYou can check your current locale by running the 'locale' command.
LANG=C ls -al
LC_COLLATE=C ls -al
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2005 09:13 AM
тАО01-21-2005 09:13 AM
Re: make ls -al on linux look like ls -al on HP-UX
my LANG was set to "en_US.UTF-8"
once I set it to "C ls -al" with
export LANG="C ls -al"
It sorts the way I want with ls -al
One curiosity, I had the same result with
"C ls -al" or "Cls-al"
Masaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2005 11:07 AM
тАО01-22-2005 11:07 AM
Re: make ls -al on linux look like ls -al on HP-UX
LANG=C ls -al
is something that you can type at the shell prompt to run the "ls -al" command after setting the LANG environment variable to "C".
That syntax tells /usr/bin/sh to set an environment variable for the single command that you run. The variable will go back to its previous setting when you get back to the shell prompt. It is a handy way to try out settings that might cause unwanted behavior.
If you set LANG to "C ls -al" or "Cls-al" I would guess that the LANG is invalid and the sorting functions are falling back to the default locale, which happens to be "C".