Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* NEWBIE: Tally the files . . .
@ 2000-04-15  4:00 race9047
  2000-04-17  4:00 ` Chris H
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: race9047 @ 2000-04-15  4:00 UTC (permalink / raw)


I need help fine tuning the following command.

     find|sort|uniq| -c|awk '{print $1,$2}'

What I am suppose to do is "write a script that will count the number
of files in a directory.  Count only the files and not the
subdirectories".

I have gotten close using variations of this command, but what I have
most trouble doing is getting an actual count that will look something
like this

1 filnameA
2 filenameB
etc.

Thanks for your help,

Race


Sent via Deja.com http://www.deja.com/
Before you buy.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NEWBIE: Tally the files . . .
  2000-04-15  4:00 NEWBIE: Tally the files . . race9047
  2000-04-17  4:00 ` Chris H
@ 2000-04-17  4:00 ` Tim Mooney
  2000-05-09  4:00 ` Timothy Lehto
  2 siblings, 0 replies; 4+ messages in thread
From: Tim Mooney @ 2000-04-17  4:00 UTC (permalink / raw)


In article <8dacei$mdc$1@nnrp1.deja.com>,  <race9047@my-deja.com> wrote:
> I need help fine tuning the following command.
> 
>      find|sort|uniq| -c|awk '{print $1,$2}'
> 
> What I am suppose to do is "write a script that will count the number
> of files in a directory.  Count only the files and not the
> subdirectories".

I would imagine your instructor also expects you to do your own work.  :-)
Hopefully you've learned how to read man pages (or GNU info documentation,
if that's what you system has instead) by this point.  If you provide me
with your instructor's email address, so I can contact him or her and
verify that it's ok for you to have hints from the peanut gallery, I would
happily provide you with some hints on how I would do it.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J1, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NEWBIE: Tally the files . . .
  2000-04-15  4:00 NEWBIE: Tally the files . . race9047
@ 2000-04-17  4:00 ` Chris H
  2000-04-17  4:00 ` Tim Mooney
  2000-05-09  4:00 ` Timothy Lehto
  2 siblings, 0 replies; 4+ messages in thread
From: Chris H @ 2000-04-17  4:00 UTC (permalink / raw)


check the "find" man page..
there is an option that you can use to find "ordinary file" only
;-)

you are almost there...keep it up...

CH


<race9047@my-deja.com> wrote in message news:8dacei$mdc$1@nnrp1.deja.com...
> I need help fine tuning the following command.
> 
>      find|sort|uniq| -c|awk '{print $1,$2}'
> 
> What I am suppose to do is "write a script that will count the number
> of files in a directory.  Count only the files and not the
> subdirectories".
> 
> I have gotten close using variations of this command, but what I have
> most trouble doing is getting an actual count that will look something
> like this
> 
> 1 filnameA
> 2 filenameB
> etc.
> 
> Thanks for your help,
> 
> Race
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: NEWBIE: Tally the files . . .
  2000-04-15  4:00 NEWBIE: Tally the files . . race9047
  2000-04-17  4:00 ` Chris H
  2000-04-17  4:00 ` Tim Mooney
@ 2000-05-09  4:00 ` Timothy Lehto
  2 siblings, 0 replies; 4+ messages in thread
From: Timothy Lehto @ 2000-05-09  4:00 UTC (permalink / raw)


You want to do a ..

ls -F -1 | grep -v \/ | wc -l







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-05-09  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-15  4:00 NEWBIE: Tally the files . . race9047
2000-04-17  4:00 ` Chris H
2000-04-17  4:00 ` Tim Mooney
2000-05-09  4:00 ` Timothy Lehto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox