Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

ls suddenly changed behavior

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Agvaniot
Posts: 42
Joined: 2017-07-26 13:07

ls suddenly changed behavior

#1 Post by Agvaniot »

i liked the default sorting of ls but now when i use ls i get the content sorted as a list
( have no idea how this come to be everything looks good in .bashrc )
anyway is there any thoughts of getting it back to normal?

cronoik
Posts: 310
Joined: 2015-05-20 21:17

Re: ls suddenly changed behavior

#2 Post by cronoik »

It will help you a lot to get answers when you tell us how it was before and how it is now. Also if you have done any upgrade in the meantime.
Have a nice day!

Agvaniot
Posts: 42
Joined: 2017-07-26 13:07

Re: ls suddenly changed behavior

#3 Post by Agvaniot »

cronoik wrote:It will help you a lot to get answers when you tell us how it was before and how it now. Also if you have done any upgrade in the meantime.
for example the ls that was before :

Code: Select all

ls
[b]directory1  directory2  directory3  directory4
directory 5[/b]
the current ls (which i dont like)

Code: Select all

ls
directory1
directory2
directory3
...
yes i done apt-get update && apt-get upgrade
after weeks i didnt do

cronoik
Posts: 310
Joined: 2015-05-20 21:17

Re: ls suddenly changed behavior

#4 Post by cronoik »

Are you piping the output or are you using a terminal? Do you use stretch now?
Please run:

Code: Select all

type ls
Have a nice day!

Agvaniot
Posts: 42
Joined: 2017-07-26 13:07

Re: ls suddenly changed behavior

#5 Post by Agvaniot »

cronoik wrote:Are you piping the output or are you using a terminal? Do you use stretch now?
Please run:

Code: Select all

type ls
debian 9 stretch
ls is aliased to ls --auto color

cronoik
Posts: 310
Joined: 2015-05-20 21:17

Re: ls suddenly changed behavior

#6 Post by cronoik »

cronoik wrote:Are you piping the output or are you using a terminal?
? I'm asking this question because the beheaviour of ls differs depending on the output application. See the documentation of ls:
https://www.gnu.org/software/coreutils/manual/html_node/ls-invocation.html#FOOT4 wrote:...If standard output is a terminal, the output is in columns (sorted vertically) and control characters are output as question marks; otherwise, the output is listed one per line and control characters are output as-is....
How does the output of ls looks when you run it in xterm?
Have a nice day!

Agvaniot
Posts: 42
Joined: 2017-07-26 13:07

Re: ls suddenly changed behavior

#7 Post by Agvaniot »

cronoik wrote:
cronoik wrote:Are you piping the output or are you using a terminal?
? I'm asking this question because the beheaviour of ls differs depending on the output application. See the documentation of ls:
https://www.gnu.org/software/coreutils/manual/html_node/ls-invocation.html#FOOT4 wrote:...If standard output is a terminal, the output is in columns (sorted vertically) and control characters are output as question marks; otherwise, the output is listed one per line and control characters are output as-is....
How does the output of ls looks when you run it in xterm?
in Xterm the same problem..
im not piping the command to anything just launching "ls"

Agvaniot
Posts: 42
Joined: 2017-07-26 13:07

Re: ls suddenly changed behavior

#8 Post by Agvaniot »

anyone?

User avatar
RU55EL
Posts: 546
Joined: 2014-04-07 03:42
Location: /home/russel

Re: ls suddenly changed behavior

#9 Post by RU55EL »

You could alias ls to ls -C by adding:

Code: Select all

alias ls='ls -C --color=auto'
to ~/.bash_aliases.



Then

Code: Select all

source ~/.bash_aliases
to update your system to your new ~/.bash_aliases file without rebooting.

That should give you standard column listings from ls.



or, assuming it is aliased in your ~./bashrc file, you could add the -C to the alias entry there. Then run

Code: Select all

source ~/.bashrc

Post Reply