Gentoo Archives: gentoo-user

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: How to stop ls from quoting output
Date: Wed, 04 May 2016 14:39:43
Message-Id: ngd1in$lio$1@ger.gmane.org
In Reply to: [gentoo-user] How to stop ls from quoting output by Daniel Quinn
1 On 03/05/16 20:07, Daniel Quinn wrote:
2 > Some time ago after an update |ls| started returning output that looked
3 > like this:
4 >
5 > |8hOk25T.jpg 'Janeway Wallpaper-iPhone.png' 'Screenshot from 2016-04-06
6 > 16-15-15.png' microsoft.png 'Away mission Wallpaper-iPhone.png'
7 > 'Screenshot from 2016-03-18 14-29-06.png' 'Screenshot from 2016-04-07
8 > 11-29-02.png' gcal.png |
9 >
10 > Note that some of the files have a single quote (‘) surrounding them,
11 > and others don’t. [...]
12 >
13 > I see that I can just write an alias:
14 >
15 > |alias ls="ls --quoting-style=literal" |
16 >
17 > But I’d hate to do that if the default is “literal” and there’s some
18 > config installed somewhere that’s changing this. [...]
19
20 As mentioned already, it's an upstream default. However, on Gentoo, "ls"
21 is already an alias for "ls --color=auto", because the upstream default
22 is to now use colors. At least for bash anyway (the alias is set in
23 /etc/bash/bashrc).
24
25 So I'd say just do:
26
27 alias ls="ls --quoting-style=literal --color=auto"
28
29 in your ~/.bashrc and forget about it :-) Or, if you want it
30 system-wide, just write that alias in a new file:
31
32 /etc/bash/bashrc.d/aliases