nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

UNIX Display or list number of files in a current directory

This is a discussion on UNIX Display or list number of files in a current directory within the Getting started tutorials forums, part of the Linux Getting Started category; Recently I found a command that displays the Number of files in a ls command listing: Code: ls -l | ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-31-2007, 10:37 AM
raj's Avatar
raj raj is offline
Senior Member
User
 
Join Date: Jun 2005
Location: Hyderabad
OS: Fedora, Debian Linux
Posts: 307
Thanks: 42
Thanked 8 Times in 8 Posts
Rep Power: 6
raj will become famous soon enough raj will become famous soon enough
Default UNIX Display or list number of files in a current directory

Recently I found a command that displays the Number of files in a ls command listing:
Code:
ls -l | wc -l
Above will find the number of files in a directory, and it will send o/p as pipe to the wc -l, which outputs the number of lines in its input.

To display all file including hidden and dot files, try
Code:
ls -lA | wc -l
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote
  #2 (permalink)  
Old 12-07-2007, 10:55 AM
Junior Member
User
 
Join Date: Dec 2007
OS: Debian
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
virendra is on a distinguished road
Default

the shortcut to ls command is

#ll
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Display number of processors on linux tom Getting started tutorials 9 12-22-2008 07:56 PM
Script to display number of lines and words from a file newbewie Shell scripting 2 12-07-2007 10:37 PM
Howto list or display databases on a PostgreSQL PgSQL server sweta Databases servers 1 03-06-2007 12:17 PM
UNIX ls only directories (display only dirs and no files) chiku Solaris/OpenSolaris 1 10-21-2006 12:27 AM
How to copy . files from current directory ricc Linux software 1 06-10-2006 09:23 PM


All times are GMT +5.5. The time now is 01:12 AM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38