You are not logged in.
I don't know if this is specific to Arch or every other Linux distro but one thing that really bugs me in Arch is how files and folders are sorted. I use Windows as my main OS (don't start on that please) and I have one folder properly organized exactly as I want it and I like it how Windows sorts this. I access that same folder from my Arch installation, the problem is that the sorting is different and it gets on my nerves lol...
This is how Windows sorts that specific folder:
C:\Users\Nazgulled\Documents\University>dir /O
Volume in drive C is Vista
Volume Serial Number is F84E-02BE
Directory of C:\Users\Nazgulled\Documents\University
05-08-2009 15:34 <DIR> .
05-08-2009 15:34 <DIR> ..
05-08-2009 11:10 <DIR> [Archives]
05-08-2009 14:38 <DIR> [Developers]
05-08-2009 11:17 <DIR> [X] 1) Cálculo II
05-08-2009 11:18 <DIR> [X] 2) Análise de Custos
05-08-2009 11:18 <DIR> [X] 2) Cálculo de Programas
05-08-2009 11:18 <DIR> [X] 2) Laboratórios de Informática III
05-08-2009 11:18 <DIR> 2) Algoritmos e Complexidade
05-08-2009 11:18 <DIR> 2) Arquitectura de Computadores
05-08-2009 11:18 <DIR> 2) Comunicaçao de Dados
05-08-2009 11:18 <DIR> 2) Engenharia Económica
05-08-2009 11:18 <DIR> 2) Estatística Aplicada
0 File(s) 0 bytes
13 Dir(s) 24.700.485.632 bytes free
And this is how Arch does it:
nazgulled ~/University $ ls -l
total 7
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Algoritmos e Complexidade
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Arquitectura de Computadores
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Comunicação de Dados
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 2) Engenharia Económica
drwxr-xr-x 1 nazgulled nazgulled 8192 2009-08-05 11:18 2) Estatística Aplicada
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:10 [Archives]
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 14:38 [Developers]
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:17 [X] 1) Cálculo II
drwxr-xr-x 1 nazgulled nazgulled 12288 2009-08-05 11:18 [X] 2) Análise de Custos
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 [X] 2) Cálculo de Programas
drwxr-xr-x 1 nazgulled nazgulled 4096 2009-08-05 11:18 [X] 2) Laboratórios de Informática III
How can I get Arch/Linux to sort exactly the same as Windows?
Last edited by Nazgulled (2009-08-05 14:41:47)
Offline
ls -l | sort
or maybe
ls -fl --color=yes | sort
The second may be more minimal. Sort has some other options that you can try, too.
Last edited by Lexion (2009-08-05 14:53:32)
urxvtc / wmii / zsh / configs / onebluecat.net
Arch will not hold your hand
Offline
I guess the best would be
ls -l | sed '/^total/d' | sort -k 9
That gets rid of the total line, because otherwise it ends up squished somewhere in between. The above got me to
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:08 [Archives]
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:08 [Developers]
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:08 [X] 1) Cálculo II
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:09 [X] 2) Análise de Custos
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:09 [X] 2) Cálculo de Programas
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:09 [X] 2) Laboratórios de Informática III
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:07 2) Algoritmos e Complexidade
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:08 2) Arquitectura de Computadores
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:08 2) Comunicação de Dados
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:08 2) Engenharia Económica
-rw-r--r-- 1 majiq majiq 0 2009-08-05 11:08 2) Estatística Aplicada
Offline
I'm sorry, I should have specified... I just showed command line examples cause it would be easier to list, copy and paste into the forums...
I don't use the command lines that much, was really just to use as an example.
What I really care about is to sort all folders (not just this folder specifically) like Windows does it, in Nautilus, cause that's what I use on my Arch box.
Of course, I also like to see things sorted properly when I use bash, but I dislike your solutions because what I'm looking for is to change the default sort order used by the system and not require me to type a big command just to sort the way I want it (I know I could create an alias, but that's beside the point).
Is it possible then?
Offline
> the problem is that the sorting is different and it gets on my nerves
Yeah, I know what you mean.
The sorting order is called collation. You can try various locales here:
http://demo.icu-project.org/icu-bin/loc … col&_=root
I have no idea about Nautilus as I use the command line, but setting your locale may be the only thing you need to do. You can check your current settings just by typing "locale" at the prompt.
Offline
Nautilus should sort dirs, then files automatically. Just make sure you are sorting by name in the Nautilus prefs. As for sorting case-insensitive, as someone mentioned already it has do to with your LC_COLLATE environment variable. I think mine is set as LC_COLLATE=en_CA.utf8 (I'm at work so can't check).
Here's a related bug ticket which sheds some light on the subject:
http://bugs.archlinux.org/task/10435
Last edited by thayer (2009-08-05 21:09:04)
thayer williams ~ cinderwick.ca
Offline
@karol
I can't see how that site helps me, what do I have to do? Even if it's just a fix for the command line, how can I fix it?
My current locale settings are:
nazgulled ~ $ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=en_US.utf8
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
@thayer
I know there are some issues with sorting case-insensitive stuff but the problem here, as I can understand it, is the folders name with brackets, which in Windows are sorted first and the comes the numbers, while on Linux, numbers come first.
Also, as you can see, I've already changed the LC_COLLATE from 'C' to from 'en_US.utf8' in /etc/profile and the problem remains...
Offline
> Also, as you can see, I've already changed the LC_COLLATE from 'C' to from 'en_US.utf8' in /etc/profile
> and the problem remains...
Do you use that collation on Windows? CP1250 or sth similar seems more likely. I don't know whether it is possible to use the exact locales you have on Vista but first you should check what is what you want to copy to Arch.
http://www.collation-charts.org/vista/
Offline
Nazgulled, you can change the locale settings to portuguese by changing the /etc/locale.gen file
uncommenting the lines you want
and then run the command
locale-gen (as root)
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.
Offline
Nazgulled, you can change the locale settings to portuguese by changing the /etc/locale.gen file
uncommenting the lines you want
and then run the command
locale-gen (as root)
I know, I've done that in the past. But that doesn't solve the problem described in this topic.
And besides money currencies, time, dates, numbers decimal format and sorting order apparently, I like to keep everything (the OS and all applications) with English interface, that's why I have the locales set to en_US.
But like I said, changing it to Portuguese didn't help the sorting problem the last time I tried...
Offline
> But like I said, changing it to Portuguese didn't help the sorting problem the last time I tried...
http://www.collation-charts.org/vista/v … razil.html
and
http://www.collation-charts.org/fbsd54/ … 859-1.html
represent different sorting orders.
ISO and UTF8 probably won't work for you, CP1252 might do the trick.
Offline
Actually it's this one: http://www.collation-charts.org/vista/v … tugal.html
But there's a problem, there's no such collate option in /etc/locale.gen
How do I do it then?
Offline
> But there's a problem, there's no such collate option in /etc/locale.gen
As I've already written, I don't know whether it is possible to use on Arch the locales you have on Vista.
> I have one folder properly organized exactly as I want it and I like it how Windows sorts this.
Sorry, I don't know how to help you. I sympathise w/ you, because it seems it's so simple yet so hard to achieve.
As an aside, you've probably heard you shouldn't use spaces in file names (and folders names) but you do it anyway, so it's really up to you to figure it out.
Maybe you can change "[ ]" to "( )":
[Archives] -> (Archives)
[X] 1) Cálculo II -> (X) 1) Cálculo II
Offline
I don't know where that comes from, but I've always used spaces in file names and will always continue to do so, I'm not using MS-DOS anymore... And that has nothing to do with my sorting problems.
Nope, I don't like the ( ) instead of [ ], it looks ugly.
Thanks for trying to help
Last edited by Nazgulled (2009-08-06 12:43:06)
Offline
Personally, I don't like using spaces in file names because (1) they cause ambiguities when ls'ing directories, (2) it makes them ugly when putting things on the Web, and (3) I just like to keep my filenames short and let the directory structure describe their purpose (I don't understand how some people can seemingly keep all their documents on the desktop).
I'm really kind of confused by the brackets though. Just... why? Not to be critical.
Offline
Well, all that is irrelevant really and a matter of personal taste. I have no interest in discussing it, sorry.
Anyone else has any suggestions on how this might be "fixed"?
Offline
I don't understand how some people can seemingly keep all their documents on the desktop.
That's what the desktop metaphor leads to ;-)
It's easy to overlook all the under-the-hood machinery needed to perform even simple tasks. A lesson in humility maybe?
Anyone else has any suggestions on how this might be "fixed"?
You have to precede "[" w/ sth the sorting order will put before numbers:
([Abracadabra]
"[Abracadabra]
'[Abracadabra]
I think it still looks ugly.
Last edited by karol (2009-08-06 15:15:08)
Offline
Well, all that is irrelevant really and a matter of personal taste. I have no interest in discussing it, sorry.
Anyone else has any suggestions on how this might be "fixed"?
Didn't mean to cause offense; I was just curious.
Offline
@Trent
I wasn't offended, it's just something I don't care to discuss.
@Karol
Thanks but I don't want to precede or rename the folders at all, that's unacceptable for me. Surely there must be a way to have the same sorting collation in Linux like in Windows
Offline
I "fixed" a locale definition file for you - it works in command line "ls -l" but may not work in Nautilus - does it suit you?
Offline
What do you mean by that? I don't get what you are talking about...
Offline
Surely there must be a way to have the same sorting collation in Linux like in Windows
Ah, no. The way they are doing it is nonsensical and not good practice for a unix style system. Having said that, some solutions have already been offered in this thread.
While you are free to continue to ask others to help you achieve your aims, it may be more convenient for you to adapt to a structure that is displayed the same way under all systems (just to avoid frustration - not saying you _should_ do it ).
Just my 2 cents' worth
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
Nazgulled wrote:Surely there must be a way to have the same sorting collation in Linux like in Windows
Ah, no. The way they are doing it is nonsensical and not good practice for a unix style system. Having said that, some solutions have already been offered in this thread.
While you are free to continue to ask others to help you achieve your aims, it may be more convenient for you to adapt to a structure that is displayed the same way under all systems (just to avoid frustration - not saying you _should_ do it ).
I really don't care if it's nonsensical, I use Windows 95% of the time or more, it's my main OS, I'm used to it and I like it. Why should I care if it's not a good practice for a unix style system? I just want things to behave the way I like and for a free system like Linux where it doesn't even compare to Windows in terms of freedom in what I can do with it and configure the way I like, it sure is hard to change the way folders/files are sorted...
It sucks that there isn't a proper solution but I'm not going to adapt anything, that would be nonsensical... But if I have to, I can live with the fact that there isn't a good solution and leave it as it is
Thanks everyone for their input, "topic closed".
Offline
Why should I care if it's not a good practice for a unix style system?
Because you're trying to use a unix-style system, and it's not working how you're used to in a Windows-style system?
I think at the end of the day, this may just be one of those differences between Windows and *nix that is part of what makes them different.
Last edited by fukawi2 (2009-08-07 03:29:07)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Nazgulled wrote:Why should I care if it's not a good practice for a unix style system?
Because you're trying to use a unix-style system, and it's not working how you're used to in a Windows-style system?
Let me rephrase than... Why should I care if something it's not a good practice for a unix style system, something I barely use and use because and when I have to? I can answer that, I shouldn't... And I don't, my main system is Windows, I couldn't care less about good unix practices, I just want things to behave the way I like it. That simple
This may be a difference between them, but there's no reason not to be able to configure the system to our liking, to mine in this case. Well, I know there must be way, it's just probably too much work...
Offline