Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > bash and the ls command

bash and the ls command
Thread Tools
becca
Junior Member
Join Date: Jul 2001
Location: Nashville Tn.
Status: Offline
Reply With Quote
Jun 1, 2002, 03:22 PM
 
can someone please explain this to me

bash2.04 mick@iMacOSX ~/bin % ls
/bin/ls: -a: No such file or directory

I'm just trying to list files like I've done in
tcsh.

Thanks
Mick
Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety.
Benjamin Franklin, Historical Review of Pennsylvania, 1759
     
Mactoid
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status: Offline
Reply With Quote
Jun 1, 2002, 04:18 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by becca:
<strong>can someone please explain this to me

bash2.04 mick@iMacOSX ~/bin % ls
/bin/ls: -a: No such file or directory</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Maybe you have a weird alias or something. What does the command "which ls" return?

My only idea is that if you have ls aliased to "ls --" for some reason, as the command "ls -- -a" give the error you are reporting.
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
     
becca  (op)
Junior Member
Join Date: Jul 2001
Location: Nashville Tn.
Status: Offline
Reply With Quote
Jun 2, 2002, 11:01 PM
 
I do. I found an alias that came when I did the install.
something for if you have installed to run color type I think.
Thanks
Mick
Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety.
Benjamin Franklin, Historical Review of Pennsylvania, 1759
     
becca  (op)
Junior Member
Join Date: Jul 2001
Location: Nashville Tn.
Status: Offline
Reply With Quote
Jun 2, 2002, 11:17 PM
 
I do. I found an alias that came when I did the install.
something for if you have installed to run color type I think.
Thanks
Mick
Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety.
Benjamin Franklin, Historical Review of Pennsylvania, 1759
     
becca  (op)
Junior Member
Join Date: Jul 2001
Location: Nashville Tn.
Status: Offline
Reply With Quote
Jun 2, 2002, 11:29 PM
 
I do. I found an alias that came when I did the install.
something for if you have installed to run color type I think.
Thanks
Mick
Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety.
Benjamin Franklin, Historical Review of Pennsylvania, 1759
     
forty two
Fresh-Faced Recruit
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jun 3, 2002, 12:26 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by becca:
<strong>I do. I found an alias that came when I did the install.
something for if you have installed to run color type I think.
</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">The "-a" flag is not for color. It shows all files in the directory, including those beginning with a dot ('.').

Some people alias "ls" to "ls -a" so that all files are always shown. It is a better idea, however, to define a new command such as "la" to alias to "ls -a" to avoid confusion. This is common practice, and many people use "la" to list all, "lc" to list with color, "l" to list in list format... whatever floats your boat. If you use ls a lot and find yourself using the different flags in different situations, it's worth the couple seconds to edit your $SHELLrc and throw these aliases in.
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 09:07 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,