Unix Technical Forum

simple ls question

This is a discussion on simple ls question within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> On 2008-02-11, ray <rollingviolation@domain.invalid.com> wrote: > Hey, that works! > > the double // appears to be a "bug" ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-21-2008, 04:47 AM
Tom Newton
 
Posts: n/a
Default Re: simple ls question

On 2008-02-11, ray <rollingviolation@domain.invalid.com> wrote:
> Hey, that works!
>
> the double // appears to be a "bug" by using colors or long format
> because if I do /bin/ls -ld */ I don't get the double //.


You can also do just:

\ls -d */

Save a few keystrokes.

Thanks for the informative thread. I have tried several times to
get the "-d" option to work and failed.

Tom


--
calhobbit (at)
gmail [DOT] com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 02-21-2008, 04:47 AM
Dan C
 
Posts: n/a
Default Re: simple ls question

On Mon, 11 Feb 2008 20:05:29 -0800, Tom Newton wrote:

> I have tried several times to get the "-d" option to work and failed.


But you're used to failure, aren't you Alan (Connor)?

> Tom


Use your "real" name, Alan.


--
"Tom N" ("Tom Newton") - the latest nymshift of "Alan Connor".
Read more about the netkook Alan Connor here:
http://www.pearlgates.net/nanae/kooks/ac/fga.shtml
Email him: calhobbit@gmail.com or simpleman.s43@gmail.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 02-21-2008, 04:47 AM
Ray
 
Posts: n/a
Default Re: simple ls question

Tom Newton wrote:
> On 2008-02-11, ray <rollingviolation@domain.invalid.com> wrote:
>> Hey, that works!
>>
>> the double // appears to be a "bug" by using colors or long format
>> because if I do /bin/ls -ld */ I don't get the double //.

>
> You can also do just:
>
> \ls -d */
>
> Save a few keystrokes.
>
> Thanks for the informative thread. I have tried several times to
> get the "-d" option to work and failed.
>
> Tom
>
>


the \ means don't run the aliased command?
I really do have to sit down one day and read the entire bash manual
from beginning to end.

Ray
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 02-21-2008, 04:47 AM
Tom Newton
 
Posts: n/a
Default Re: simple ls question

On 2008-02-12, Ray <ray@!rollingviolation.example.com.invalid> wrote:
> Tom Newton wrote:
>> On 2008-02-11, ray <rollingviolation@domain.invalid.com> wrote:
>>> Hey, that works!
>>>
>>> the double // appears to be a "bug" by using colors or long format
>>> because if I do /bin/ls -ld */ I don't get the double //.

>>
>> You can also do just:
>>
>> \ls -d */
>>
>> Save a few keystrokes.
>>
>> Thanks for the informative thread. I have tried several times to
>> get the "-d" option to work and failed.
>>
>> Tom
>>
>>

>
> the \ means don't run the aliased command?


Apparently. I just saw it somewhere and started using it.
According to man bash it is the escape character and is a form of
quoting which preserves the literal value of the next character.

Maybe the literal value of a command, too? Which would be the
full path to the executable that would be found using $PATH?

I couldn't find any direct reference to the usage that concerns us.

> I really do have to sit down one day and read the entire bash manual
> from beginning to end.


3500 lines. I find playing with the examples in the advanced bash shellscripting
guide to be more productive, using man bash as a reference. Don't let "advanced"
scare you away. There is a lot of basiac stuff there.

http://www.tldp.org/LDP/abs/

Tom


--
calhobbit (at)
gmail [DOT] com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 02-21-2008, 04:47 AM
loki harfagr
 
Posts: n/a
Default Re: simple ls question

On Mon, 11 Feb 2008 22:03:52 +0000, ray wrote:

> loki harfagr wrote:
>> On Mon, 11 Feb 2008 16:29:51 +0000, ray wrote:
>>
>>> Loki Harfagr wrote:
>>>> Mon, 11 Feb 2008 15:06:04 +0000, ray did cat :
>>>>
>>>>> what's the easiest way to just list directories?
>>>>>
>>>>> the shortest way I can do is
>>>>> ls -p | grep /
>>>>>
>>>>> if I do
>>>>> ls -d
>>>>> all I get is
>>>> Using lsd you should have stars in your eyes ;-) So, what about:
>>>> $ ls -d *
>>> rjoyal@filebox:/tmp$ ls
>>> total 0
>>> drwxr-xr-x 2 rjoyal raynic 48 2008-01-23 23:23 vx/ drwxr-xr-x 2 rjoyal
>>> raynic 48 2008-01-23 23:23 x/ -rw-r--r-- 1 rjoyal raynic 0 2008-02-11
>>> 10:28 x.x
>>>
>>> rjoyal@filebox:/tmp$ ls -d
>>> drwxrwxrwt 6 root root 184 2008-02-11 10:28 ./
>>>
>>> rjoyal@filebox:/tmp$ ls -d *
>>> drwxr-xr-x 2 rjoyal raynic 48 2008-01-23 23:23 vx/ drwxr-xr-x 2 rjoyal
>>> raynic 48 2008-01-23 23:23 x/ -rw-r--r-- 1 rjoyal raynic 0 2008-02-11
>>> 10:28 x.x
>>>
>>> so, no, ls -d * doesn't work.
>>>
>>> I want this:
>>> drwxr-xr-x 2 rjoyal raynic 48 2008-01-23 23:23 vx/ drwxr-xr-x 2 rjoyal
>>> raynic 48 2008-01-23 23:23 x/ (the directories only.)
>>>
>>> Ray

>>
>> OK! I read and replied too fast :-)
>> Then, would that one be alright?:
>> $ ls -d */
>>
>> and the usual extensions will fit:
>> $ ls -ld */
>> $ ls -lad */
>>
>>

> Hey, that works!
>
> the double // appears to be a "bug" by using colors or long format
> because if I do /bin/ls -ld */ I don't get the double //.


right, that's a "feature" from a default LS_OPTIONS part:
----------
-F, --classify
append indicator (one of */=>@|) to entries
----------

I was a bit on a foot on that reply as I tested at home while
I mostly use 'ls' at work where I anyway have a '.rc' file for my logon
spread on every new machine that mostly sets a few personal habits
like aliasing 'vi' to 'vi -u NONE' and unaliasing most every 2 letters
command, this of course include 'rm' and 'ls' as I just can't bear the
Redmoodoomed fashion to ask you twice and in a scalloped lingo
if you're sure you want to do what you just confirmed previously
you wanted to assure you wanted to do what you just previously
typed, and worse again while you try and find out what files
survived your last desperate and wrong action-yes caused by the
semi-hemi-quavering on double-binded triple negated questions
the list now comes in 3270 colors, just getme that good old
BFG6000 jump to my hands!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com