Sponsored Content
Top Forums Shell Programming and Scripting Total number of files in the folder should be listed Post 302850951 by Kalaihari on Friday 6th of September 2013 06:12:20 AM
Old 09-06-2013
Total number of files in the folder should be listed

Hi All,

When i give the ls -lrt to list out all files with total number of files , i get the output as
Code:
ls -lrt
total 72
-rw-r--r--    1 hari  staff           796 Jul 11 09:17 va.txt
-rw-r--r--    1 hari  staff           169 Jul 13 00:20 a.log
-rwxr-xr-x    1 hari  staff           659 Aug 10 04:45 final.sh
-rw-r--r--    1 hari  staff            98 Aug 10 04:48 noprob.txt
-rw-r--r--    1 hari  staff          3597 Aug 10 04:48 main.xls
-rw-r--r--    1 hari  staff           299 Aug 10 04:48 mailbody.txt
-rw-r--r--    1 hari  staff          4981 Aug 10 04:48 attachment.txt

Now our expectation is we should get the "total" number of files with only the filenameswhich was at the end like va.txt,a.log,final.sh etc.

I tried with ls -lrt|grep total to get the total line but am unable to get only the filenames by leaving the permission, user name, group, date and all.. Am requesting some help to complete this task as you were all in the part of my previous automations. Kindly do the needful friends.
 

10 More Discussions You Might Find Interesting

1. HP-UX

CVSWeb - Directories listed but files not listed

I am using CVSWeb on HPUnix. When i access it, all directories are listed but files are not listed. I am getting the error "NOTE: There are 51 files, but none matches the current tag. " in tomcat sevrer log i am getting the message "rlog warning: Missing revision or branch number after -r"... (0 Replies)
Discussion started by: ganesh
0 Replies

2. UNIX for Dummies Questions & Answers

total number of files which have "aaa" in files whose names are File*_bbb*

I am getting the list of all the files which have "aaa" from files whose name is File*_bbb*. grep -l "aaa" File*_bbb* But I want to count the number of files. That is I want the total number of files which have "aaa" in files File*_bbb* If I run the following for getting number of... (1 Reply)
Discussion started by: sudheshnaiyer
1 Replies

3. Shell Programming and Scripting

check how many files in folder or total files in folder

Hi all, I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder? please send me the query asap. (3 Replies)
Discussion started by: durgaprasad
3 Replies

4. Shell Programming and Scripting

perl script on how to count the total number of lines of all the files under a directory

how to count the total number of lines of all the files under a directory using perl script.. I mean if I have 10 files under a directory then I want to count the total number of lines of all the 10 files contain. Please help me in writing a perl script on this. (5 Replies)
Discussion started by: adityam
5 Replies

5. UNIX for Dummies Questions & Answers

Command for total number of files (and size) across subdirectories?

Hi all... I have a directory called dbrn. This directory contains an unknown number of subdirectories which in turn contain an unknown number of files. What I want to know is: How many files with extention .ABC can be found in /dbrn across all subdirecties, and what is the total size for... (9 Replies)
Discussion started by: Beun
9 Replies

6. UNIX for Dummies Questions & Answers

Write the total number of rows in multiple files into another file

Hello Friends, I know you all are busy and inteligent too... I am stuck with one small issue if you can help me then it will be really great. My problem is I am having some files i.e. Input.txt1 Input.txt2 Input.txt3 Now my task is I need to check the total number of rows in... (4 Replies)
Discussion started by: malaya kumar
4 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Touch 10% of the total files inside a folder

I'm trying to make this code below to work but I can't find the way to do the following: I want to make the script to touch only 10% of the total amount of files counted inside the given directory instead of all like it is now. I would greatly appreciate it if someone can give me a direction on... (9 Replies)
Discussion started by: regraphix
9 Replies

8. HP-UX

Total number of files in a FS

Hello people, On HP-UX B.11.11 U 9000/800 How can I have in aprox. the total number of files in a specific FS? Is the number of used inodes a rough estimation of my total number of files? Server1 /Data:df -i . /Data (/dev/vg_Data/lvol1 ) : 18292960 total i-nodes 15800945 free... (3 Replies)
Discussion started by: drbiloukos
3 Replies

9. Shell Programming and Scripting

Performance of calculating total number of matching records in multiple files

Hello Friends, I've been trying to calculate total number of a certain match in multiple data records files (DRs). Let say I have a daily created folders for each day since the beginning of july like the following drwxrwxrwx 2 mmsuper med 65536 Jul 1 23:59 20150701 drwxrwxrwx 2 mmsuper... (1 Reply)
Discussion started by: EAGL€
1 Replies

10. Shell Programming and Scripting

Counting total files with different file types in each folder

Trying to count total files with different file types with thousands of files in each folder. Since some files do not have extensions I have to use below criteria. Count Total Files starting with --> "^ERROR" Count Total Files starting with --> "^Runtime" Count Everything else or files... (3 Replies)
Discussion started by: kchinnam
3 Replies
PTS_MEMBERSHIP(1)					       AFS Command Reference						 PTS_MEMBERSHIP(1)

NAME
pts_membership - Displays the membership list for a user or group SYNOPSIS
pts membership -nameorid <user or group name or id>+ [-supergroups] [-expandgroups] [-cell <cell name>] [-localauth] [-noauth] [-force] [-help] pts m -na <user or group name or id>+ [-s] [-ex] [-c <cell name>] [-no] [-l] [-f] [-h] pts groups -na <user or group name or id>+ [-s] [-ex] [-c <cell name>] [-no] [-l] [-f] [-h] pts g -na <user or group name or id>+ [-s] [-ex] [-c <cell name>] [-no] [-l] [-f] [-h] DESCRIPTION
The pts membership command lists the groups to which each user or machine specified by the -nameorid argument belongs, or lists the users and machines that belong to each group specified by the -nameorid argument. It is not possible to list the members of the system:anyuser or system:authuser groups, and they do not appear in the list of groups to which a user belongs. To add users or machine to groups, use the pts adduser command; to remove them, use the pts removeuser command. OPTIONS
-nameorid <user or group name or id>+ Specifies the name or AFS UID of each user entry, the IP address (complete or wildcard-style) or AFS UID of each machine entry, or the name or AFS GID of each group, for which to list group membership. It is acceptable to mix users, machines, and groups on the same command line, as well as names and IDs. Precede the GID of each group with a hyphen to indicate that it is negative. -supergroups List the groups to which each group specified by the -nameorid argument belongs, in addition to user and machine members. Group membership may be nested when ptserver is compiled with the SUPERGROUPS option enabled. -expandgroups Instead of listing only the groups in which the user or machine is a direct member, list every group in which the user or machine belongs, including membership due to nested groups, for each user or machine specified by the -nameorid argument. Instead of listing groups which are members of a group, list every user and machine which is a member of a group, including the users and machines which are members due to nested groups, for each group specified by the -nameorid argument. Group membership may be nested when ptserver is compiled with the SUPERGROUPS option enabled. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). OUTPUT
For each user and machine, the output begins with the following header line, followed by a list of the groups to which the user or machine belongs: Groups <name> (id: <AFS UID>) is a member of: For each group, the output begins with the following header line, followed by a list of the users and machines who belong to the group: Members of <group_name> (id: <AFS GID>) are: EXAMPLES
The following example lists the groups to which the user "pat" belongs and the members of the group "smith:friends". Note that third privacy flag for the "pat" entry was changed from the default hyphen to enable a non-administrative user to obtain this listing. % pts membership pat smith:friends Groups pat (id: 1144) is a member of: smith:friends staff johnson:project-team Members of smith:friends (id: -562) are: pat terry jones richard thompson The following example shows how to list the groups to which nested groups belong. In this example the group "executives" is a member of the group "management" and the group "management" is a member of the group "staff". The group "management" is called a supergroup of the group "executives" and the group "staff" is called a supergroup of the group "management". % pts membership executives Members of executives (id: -208) are: jane % pts membership executives -supergroups Members of executives (id: -208) are: jane Groups executives (id: -208) is a member of: management % pts membership management -supergroups Members of management (id: -207) are: executives mary sarah carol Groups management (id: -207) is a member of: staff % pts membership staff -supergroups Members of staff (id: -206) are: sales marketing engineering management Groups staff (id: -206) is a member of: The following example shows how to find all the users which belong to a group, including users of nested groups. In this example, the user "jane" is listed as an expanded member of the group "management" instead of the group "executives". % pts membership management -expandgroups Expanded Members of management (id: -207) are: jane mary sarah carol The following example shows how to find all the groups a user is a member of, including membership due to nested groups. In this example the user "jane" is a direct member of the group "executives". The "-expandgroups" flag shows all the groups to which "jane" has membership status. % pts membership jane Groups jane (id: 7) is a member of: executives % pts membership jane -expandgroups Expanded Groups jane (id: 7) is a member of: staff management executives PRIVILEGE REQUIRED
Members of the system:ptsviewers and system:administrators groups can always use this command in any of its variations. Additionally, a user can always list the groups to which they belong, and the owner of a group can always list the members of the group. Additional privileges may be granted by the setting of the third privacy flag in the Protection Database entry of each user or group indicated by the -nameorid argument (use the pts examine command to display the flags): o If it is a hyphen, the default permissions described above apply. o If it is lowercase "m" and the -nameorid argument specifies a group, then members of that group can also list the other members. A privacy flag of "m" only changes the permissions when set for a group. Setting this flag for a user or a machine has no effect. o If it is uppercase "M", anyone who can access the cell's database server machines can list the membership of the group or the groups to which that user or machine belongs, depending on what type of entry the flag is set on. SEE ALSO
pts(1), pts_adduser(1), pts_examine(1), pts_removeuser(1), pts_setfields(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2014-04-08 PTS_MEMBERSHIP(1)
All times are GMT -4. The time now is 05:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy