nixCraft Linux Forum

nixCraft

Linux 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 | ...


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

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-31-2007, 10:37 AM
raj raj is offline
Contributors
User
 
Join Date: Jun 2005
Location: Hyderabad
Posts: 146
Rep Power: 4
raj is on a distinguished road
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
Sponsored Links
  #2 (permalink)  
Old 12-07-2007, 10:55 AM
Junior Member
User
 
Join Date: Dec 2007
My distro: Debian
Posts: 12
Rep Power: 0
virendra is on a distinguished road
Default

the shortcut to ls command is

#ll
Reply With Quote
Reply

Bookmarks


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 On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Display number of processors on linux tom Getting started tutorials 7 08-12-2008 10:51 AM
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 02:08 AM.


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

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