OS X - Operating System General OS operation information and support

ls command refuses to use multi-column


Post Reply New Thread Subscribe

 
Thread Tools
doug072

 
Member Since: Aug 06, 2011
Posts: 7
doug072 is on a distinguished road

doug072 is offline
Hey all,

New here. Was trying to add colors to my ls output, and went about doing the following:

cd ~/
vim .bash_profile (new file, didn't exist)
Code:
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx

alias ls='ls -F"
source ~/.bash_profile

Seemed to work well, except the output was a single entry per line - not what I was hoping for.

Ofcourse I then resulted in removing the alias line and re-running the source thing. This simply removed the cool extras that -F adds to the output of ls.

I then decided to create a new user on my mac, and then did the exact same as above except without the alias part - worked great, multi-column output with colors.

Now my main account seems stuffed, and I really don't want to resort to "migrating" or using iTerm2 as a "I failed" solution.

Any help would be truly appreciated. I'm sure its a profile setting I can override, or re-apply the original default.

BTW: ls -C does not work either on my main account.

Running MAC OS X Leopard 10.5.8

Many thanks
Doug
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,529
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
all -F does it show a / after a directory name. Column printing for ls is default, so ls and ls -C should be identical in a terminal window. What are you trying to accomplish, and what's going on now? Please post an example

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
doug072

 
Member Since: Aug 06, 2011
Posts: 7
doug072 is on a distinguished road

doug072 is offline
Seems this issue is only related to my home directory (~/) as other directories correctly display a multi-column output. Note pictures attached:

Picture1: My ~/.bash_profile

Picture2: executing ls in my home directory (~/)

Picture3: executing ls in another directory

As you can see in Picture2, the output is single line - not sure if this is a bug?

If there is no "fix" for this home directory issue, then not to bothered by it. When I posted the request, I hadn't tested ls in other directories.
Attached Images
File Type: png Picture 1.png (21.2 KB, 22 views)
File Type: png Picture 2.png (46.7 KB, 22 views)
File Type: png Picture 3.png (63.6 KB, 22 views)
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,529
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
Ok, I have a couple questions for you.

1) was the behavior as expected before modifying your bash_profile?
2) have you reloaded your profile since changing it?
3) was the test in another directory in another terminal session, perhaps started after the test in ~/ ?

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
doug072

 
Member Since: Aug 06, 2011
Posts: 7
doug072 is on a distinguished road

doug072 is offline
1) Yup, before I modified (created) bash_profile, my home directory (~/) would always output to multi-column when issuing ls command
2) I've rebooted my MAC, still the same.
3) nope, tests where done in the same terminal, same tab, same session. Additionally, if I issue an 'ls -C' or 'ls -x' even, the output is still single entry per line in my home directory
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,529
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
Very interesting. I've never seen that behavior. Let me to test on my wifes macbook, she's running Lion.. I'm not.

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
doug072

 
Member Since: Aug 06, 2011
Posts: 7
doug072 is on a distinguished road

doug072 is offline
I appreciate the assistance - I'm running Leopard tho, not Lion.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,529
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
Ok, it's almost like you have an alias somewhere to ls as ls -C1, which will give you the identical output you're experiencing. Why this would be ONLY in the home directory, I have no idea.

Maybe do grep 'ls -C1' .* in your home and see if that returns anything?

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
doug072

 
Member Since: Aug 06, 2011
Posts: 7
doug072 is on a distinguished road

doug072 is offline
only thing that seems to return is .viminfo, which has

Code:
.viminfo:	alias ls='ls'
And nothing in /etc

Tried doing a grep for "ls", "ls -", "ls -C1" as well as "ls -1"
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,529
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
and which ls returns with /bin/ls I'm assuming?

Odd, not something I've seen on my systems. I'll have to putz with it, unfortunately I've got a hard stop in a bit as we've got a family outing this evening

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
doug072

 
Member Since: Aug 06, 2011
Posts: 7
doug072 is on a distinguished road

doug072 is offline
when using /bin/ls in ~/, the same result, single entry per line, however, any other directory - no problem ;-)

Very strange issue indeed - have a feeling that
Code:
alias ls='ls -F'
is the culprit, but just no idea how to resolve.

No problem - its bed time for me anyway.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,529
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
Hash it out for now, then . ./.bash_profile

see if that does it

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
doug072

 
Member Since: Aug 06, 2011
Posts: 7
doug072 is on a distinguished road

doug072 is offline
Wish it were that easy. I have since deleted the alias line and then run . .bash_history, still the same result.
QUOTE Thanks
ChaseER

 
Member Since: Aug 20, 2011
Posts: 1
ChaseER is on a distinguished road

ChaseER is offline
I was having the same problem this morning, and did a search for an answer and ended up here... but while messing with it found out what was causing the problem... and from there you can decide how to fix it.

Pretty much this is what has caused this for me... in my home folder, there were a couple of saved URL's that had long TITLEs. The span on these, and other files, being very wide, made it so that when I did a multi column listing, it wasn't able to list more than one column because the long titles took up the span of available space. I figured this out by stretching the terminal window across the screen and doing the ls -aFG command. I noticed that there were some long items. I went into my home directory and took care of those long file names, and then going back to terminal, I was able to do the command, and then was able to achieve the desired results .

I think this is why it was working for you in other directories, because you're probably not saving long file named items there?

This is my first post to the forums, and I just signed up because I thought that this might be the answer to your problems

Either way... Hello forums!
QUOTE Thanks
highredshift

 
Member Since: Dec 06, 2012
Posts: 1
highredshift is on a distinguished road

highredshift is offline
That's exactly the problem.
QUOTE Thanks

Post Reply New Thread Subscribe


« Where did my mac mail go? | Disc won't eject »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
finder window Places column options jami1955 OS X - Operating System 0 04-26-2011 08:06 AM
10.6 Mail.app Column views kartikeyasri OS X - Apps and Games 4 04-19-2010 06:02 PM
Mail.app jumps to wrong column adare OS X - Apps and Games 0 06-24-2009 11:43 AM
Bookmarks column unpresi OS X - Apps and Games 0 07-20-2007 10:04 AM
Can't adjust column (view) width Morgan19 OS X - Operating System 1 02-02-2006 05:17 PM

All times are GMT -4. The time now is 02:56 PM.

Powered by vBulletin
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?