This forum has been archived. All content is frozen. Please use KDE Discuss instead.

show folders first

Tags: None
(comma "," separated)
User avatar
lazylew
Registered Member
Posts
78
Karma
0
OS

show folders first

Fri Jul 12, 2013 2:48 pm
In Konsole I see folders and files alphabetically but I want the traditional view of folders first (above files).
I searched the web but this simple question remains unsolved.
User avatar
google01103
Manager
Posts
6668
Karma
25

Re: show folders first

Fri Jul 12, 2013 3:06 pm
this is not a KDE issue, it is a Linux one as you are using the Linux command ls

replace (alias) your ls command with
Code: Select all
ls --group-directories-first


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
lazylew
Registered Member
Posts
78
Karma
0
OS

Re: show folders first

Fri Jul 12, 2013 3:47 pm
google01103 wrote:this is not a KDE issue, it is a Linux one as you are using the Linux command ls

replace (alias) your ls command with
Code: Select all
ls --group-directories-first
I made a .bash_aliases file with
Code: Select all
alias ls=ls --group-directories-first
but it must be conflicting with this in .bashrc:
Code: Select all
export LS_OPTIONS='--color=auto'   
    alias ls='ls $LS_OPTIONS'
because the sorting is still alphabetic and the colors are gone now.
Thanks for pointing out that it's not a KDE-issue; I'll do some better homework on aliases first and see if I can get it sorted.

EDIT: even though it's not sortde out, I wanted to mark Solved since it's not a KDE-issue.
When I clicked the mark Solved best answer button though, I got a pop-up about some image-site - happened 3 times... will try again later to see if the pop-up is persistent
wolfi323
Registered Member
Posts
1129
Karma
11
OS

Re: show folders first  Topic is solved

Fri Jul 12, 2013 3:56 pm
lazylew wrote:I made a .bash_aliases file with
Code: Select all
alias ls=ls --group-directories-first

You have to use quotes around the command string because it contains a space.
Also, if you want to retain colourfull output you should add $LS_OPTIONS as well, just like .bashrc does:
Code: Select all
alias ls='ls --group-directories-first $LS_OPTIONS'


Or just add "--group-directories-first" to the $LS_OPTIONS variable in .bashrc:
Code: Select all
export LS_OPTIONS='--group-directories-first --color=auto'
User avatar
lazylew
Registered Member
Posts
78
Karma
0
OS

Re: show folders first

Fri Jul 12, 2013 5:03 pm
thank you both very much :)

(the solved marking worked this time too)


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]