The UNIX and Linux Forums
Forum Home
Linux and Unix Man Pages
Search Forums
Search Community Posts
Today's Posts
Quick Links
Man Pages
RedHat Commands
OpenSolaris Commands
Linux Commands
SunOS Commands
FreeBSD Commands
All UNIX Man Pages
All Linux Man Pages
Full Man Repository
Login or Register to Ask a Question and Join Our Community
Search Forums
Show Threads .
Show Posts
Tag Search
Advanced Search
Quick Links
Contact Us
Forum Rules
Today's Posts
FAQ
Pictures & Albums
All Albums
Miscellaneous
What is My IP
Whois
Mark Forums Read
UNIX and Linux Applications
Please Help Me...
Login to Discuss or Reply to this Discussion in Our Community
Page 2 of 2
<
1
2
Thread Tools
Search this Thread
Special Forums
UNIX and Linux Applications
Please Help Me...
#
8
04-21-2010
mastercar
Registered User
21,
1
Join Date: Apr 2010
Last Activity: 24 May 2010, 2:06 AM EDT
Posts: 21
Thanks Given: 0
Thanked 1 Time in 1 Post
Hi all,
I want to script count the total number of file in directory.Hope you can help...
mastercar
View Public Profile for mastercar
Find all posts by mastercar
#
9
04-21-2010
thillai_selvan
Registered User
190,
1
Join Date: Feb 2010
Last Activity: 17 November 2016, 4:50 AM EST
Location: Chennai
Posts: 190
Thanks Given: 0
Thanked 1 Time in 1 Post
Use the following command.
Code
:
ls -l | grep "^-" | wc -l
It will give the number of files in the current directory.
If you want to know the number of files in a specific directory , then you need to specify its name as
Code
:
ls -l <directory_path> | grep "^-" | wc -l
thillai_selvan
View Public Profile for thillai_selvan
Find all posts by thillai_selvan
#
10
04-21-2010
mastercar
Registered User
21,
1
Join Date: Apr 2010
Last Activity: 24 May 2010, 2:06 AM EDT
Posts: 21
Thanks Given: 0
Thanked 1 Time in 1 Post
can you write for me the script?
mastercar
View Public Profile for mastercar
Find all posts by mastercar
#
11
04-21-2010
DukeNuke2
Registered User
5,725,
311
Join Date: Jul 2006
Last Activity: 17 February 2019, 10:46 AM EST
Location: Berlin, Germany
Posts: 5,725
Thanks Given: 75
Thanked 311 Times in 297 Posts
Quote:
Originally Posted by
mastercar
can you write for me the script?
it's starting to look like homework. you have all answers you need. all you need to do now is to use them!
good luck
DukeNuke2
View Public Profile for DukeNuke2
Visit DukeNuke2's homepage!
Find all posts by DukeNuke2
Page 2 of 2
<
1
2
Login or Register to Ask a Question
Previous Thread
|
Next Thread
Login or Register to Ask a Question
Member Badges and Information Modal
×