LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 07-05-2003, 05:33 PM   #1
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Rep: Reputation: 30
Getting rid of "\" before spaces in filenames when using the ls command


This is a minor annoyance of mine, whenever I do an ls and there are filenames with spaces in them, a "\" precedes the space. I looked through the manpage for ls, and couldn't find anything on this. Anyone know how get rid of this?

Last edited by Locura; 07-05-2003 at 05:34 PM.
 
Old 07-05-2003, 06:13 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
AFAIK you can't do it with the ls command as this is how it reads/determines that there is a space in the file name.
 
Old 07-05-2003, 06:20 PM   #3
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Original Poster
Rep: Reputation: 30
Well, it also does this with international characters, for instance accented vowels ( etc.). They show up as a backslash followed by a few numbers. Is this a bash thing? I checked the massive bash man page and could find nothing there either. Or could it Slackware-specific? There has to be a way to make it display correctly.
 
Old 07-05-2003, 06:23 PM   #4
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
what terminal do you guys use...i know i use gnome-terminal and i dont' see the "\" in files/folders that have a space when i issue ls ... i only see it when i am cd'ing into a folder or trying to run a file with spaces and i type the partial command and press <tab> and its written on the command line with the "\"...otherwise if i for some reason type a full command without using <tab> i just put the name with spaces in quotes...
 
Old 07-05-2003, 06:25 PM   #5
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Original Poster
Rep: Reputation: 30
This is in aterm, however I just opened gnome-terminal to see if the same thing happened, and it did. So the problem doesn't seem to be confined to a specific terminal.
 
Old 07-05-2003, 06:26 PM   #6
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
maybe it is the distro...all of you are using slack
 
Old 07-05-2003, 06:35 PM   #7
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Original Poster
Rep: Reputation: 30
True. Maybe this should be moved to the Slack forum then. If it IS the distro though, with Slack's endless configurability you would think there would be a way to fix this problem.
 
Old 07-05-2003, 07:23 PM   #8
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 49
It is distro specific. The Slack 9.0 default LS_OPTIONS includes the -b option. This changes the behavior to show the escapes. Remove the -b option to the default LS_OPTIONS in /etc/profile (it will show up under the "eval `dircolors -b`" statement in the file. Change that, and it should fix the problem.
 
Old 07-05-2003, 10:19 PM   #9
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Original Poster
Rep: Reputation: 30
OK, I got it. I didn't see the thing about LS_OPTIONS in the /etc/profile, but when it calls dircolors, it calls it with the input file /etc/DIR_COLORS. I looked in that file and found the default settings for LS_OPTIONS, and took out the -b, and all is good. Thanks a lot for the info.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
When "function pointer" meets "template"... I can't get rid of this compiling er cyu021 Linux - Software 3 12-17-2004 07:52 PM
Grip, if "Allow high bits in filenames" on then there is a problem with encoding. brynjarh Linux - Software 0 10-24-2004 11:44 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-21-2003 11:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration