Unix Technical Forum

making the ls command my bitch

This is a discussion on making the ls command my bitch within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I have 3 questions and hopefully at least 1 of them can be answered. 1.) Does the ls command ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 10:37 AM
Scott Eberl
 
Posts: n/a
Default making the ls command my bitch

I have 3 questions and hopefully at least 1 of them can be answered.

1.) Does the ls command have a switch to only list hidden files?

2.) Is it possible to only list directories?

3.) How do I put vim into insert mode automagicly when it's opened by
slrn to post?

I know question number 3 is way out there but I figure enough of us in
here use slrn and surely somebody else was annoyed by this who is
smarter then me and figured out how to do it.

--
If a man talks in the woods and there is
no woman to hear him is he still wrong?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 10:37 AM
Kenneth
 
Posts: n/a
Default Re: making the ls command my bitch

On 2004-04-15, Scott Eberl <scott@airea420.com> wrote:
> I have 3 questions and hopefully at least 1 of them can be answered.
>
> 1.) Does the ls command have a switch to only list hidden files?


what hidden files??

ken
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 10:37 AM
Scott Eberl
 
Posts: n/a
Default Re: making the ls command my bitch

On 2004-04-15, Kenneth <Kenneth@pickone.anyone> wrote:
> On 2004-04-15, Scott Eberl <scott@airea420.com> wrote:
>> I have 3 questions and hopefully at least 1 of them can be answered.
>>
>> 1.) Does the ls command have a switch to only list hidden files?

>
> what hidden files??
>
> ken


Any files starting with a "." such as .bashrc

--
Scott Eberl
Telephony Applications Coordinator
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 10:37 AM
Kenneth
 
Posts: n/a
Default Re: making the ls command my bitch

On 2004-04-15, Scott Eberl <scott@airea420.com> wrote:
> On 2004-04-15, Kenneth <Kenneth@pickone.anyone> wrote:
>> On 2004-04-15, Scott Eberl <scott@airea420.com> wrote:
>>> I have 3 questions and hopefully at least 1 of them can be answered.
>>>
>>> 1.) Does the ls command have a switch to only list hidden files?

>>
>> what hidden files??
>>
>> ken

>
> Any files starting with a "." such as .bashrc
>


ls -a, can be found in man ls.

That's not a hidden file, it's just a file that begins with a "."

I've never heard of hidden Linux files.



ken
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 10:37 AM
Sebastian Stein
 
Posts: n/a
Default Re: making the ls command my bitch

On Thu, 15 Apr 2004 07:51:38 -0000, Scott Eberl <scott@airea420.com> wrote:
> I have 3 questions and hopefully at least 1 of them can be answered.
>
> 1.) Does the ls command have a switch to only list hidden files?
>
> 2.) Is it possible to only list directories?


I think you should use find instead of ls. It gives you more options.

> 3.) How do I put vim into insert mode automagicly when it's opened by
> slrn to post?


Take a look at vim's manpage. I think you can do it with the -c command line
argument.

Sebastian
--
ONE FAMILY! Leipzig 2012 - Olympic Summer Games
http://www.leipzig2012.com/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 10:37 AM
Ivan
 
Posts: n/a
Default Re: making the ls command my bitch

On Thu, 15 Apr 2004 08:46:39 +0000, Kenneth wrote:

> On 2004-04-15, Scott Eberl <scott@airea420.com> wrote:
>> On 2004-04-15, Kenneth <Kenneth@pickone.anyone> wrote:
>>> On 2004-04-15, Scott Eberl <scott@airea420.com> wrote:
>>>> I have 3 questions and hopefully at least 1 of them can be answered.
>>>>
>>>> 1.) Does the ls command have a switch to only list hidden files?
>>>
>>> what hidden files??
>>>
>>> ken

>>
>> Any files starting with a "." such as .bashrc
>>

>
> ls -a, can be found in man ls.
>
> That's not a hidden file, it's just a file that begins with a "."
>
> I've never heard of hidden Linux files.
>
>
>
> ken

i think that he wanted ONLY files that begin with '.', and 'ls -a' will
list all files
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-19-2008, 10:37 AM
Ivan
 
Posts: n/a
Default Re: making the ls command my bitch

On Thu, 15 Apr 2004 07:51:38 +0000, Scott Eberl wrote:

> I have 3 questions and hopefully at least 1 of them can be answered.
>
> 1.) Does the ls command have a switch to only list hidden files?
>


ls -a | grep '^\.'


> 2.) Is it possible to only list directories?


find . -maxdepth 1 -type d




regards,
i.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-19-2008, 10:37 AM
MikeyD
 
Posts: n/a
Default Re: making the ls command my bitch

> 1.) Does the ls command have a switch to only list hidden files?

Try ls -d .*
>
> 2.) Is it possible to only list directories?
>

Not that I know of.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-19-2008, 10:37 AM
Thomas Ronayne
 
Posts: n/a
Default Re: making the ls command my bitch

Scott Eberl wrote:

>I have 3 questions and hopefully at least 1 of them can be answered.
>
>1.) Does the ls command have a switch to only list hidden files?
>
>

No (there aren't any such things in Linux); however, the -a option will
list the files with a leading dot.

>2.) Is it possible to only list directories?
>
>

No, not without piping the output of ls through sed or grep or something.

Try this:

ls -aCF

this will list the "dot" files, directories with a slash, executables
with an asterisk -- if you like this display, make an alias, say "lc".
Might be a step in the right direction.

Also, try

ls -1

to list files in one column (you can add -aCF to that).

>3.) How do I put vim into insert mode automagicly when it's opened by
> slrn to post?
>
>

Well, pretty much can't. You can send it to a specifc pattern with

vi +/pattern file

then type "i" when it opens...

>I know question number 3 is way out there but I figure enough of us in
>here use slrn and surely somebody else was annoyed by this who is
>smarter then me and figured out how to do it.
>
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-19-2008, 10:37 AM
Alan Hicks
 
Posts: n/a
Default Re: making the ls command my bitch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In alt.os.linux.slackware, Ivan dared to utter,
> ls -a | grep '^\.'


UUOG (Useless Use Of Grep).

ls -ad .*

- --
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAfobwL3KiNGOqr6ERAlrVAKCuvrRX6CQ2kwi6A02lIi TFMNguswCgy2pr
6VCHJQGsxgvDV0EBa56G/KU=
=SPw4
-----END PGP SIGNATURE-----
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 07:42 AM.


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