Sponsored Content
Top Forums Shell Programming and Scripting [FUN] Get some stats of your project/s Post 302943296 by MadeInGermany on Thursday 7th of May 2015 05:35:44 AM
Old 05-07-2015
I wonder if you want to skip .git directories.
Then a -prune in find is more efficient.
Also it is more efficient to run the find once, and count the FILES in the loop.
Code:
FILES=0
for F in $(find . -type d -name ".git" -prune -o -type f \! -name ".jpg" -print)
do
    ((FILES+=1))
    ... # only files, dont need to test again
done

NB the -print is needed: by explicitly printing the files it will not print the pruned directories.
This User Gave Thanks to MadeInGermany For This Post:
 

6 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Fun with FreeBSD

Fun With Automounting on FreeBSD Link: Nice tips for FreeBSD Unix. http://ezine.daemonnews.org/200202/automounting.html (2 Replies)
Discussion started by: killerserv
2 Replies

2. Solaris

SSH doesn't pick up user's project from /etc/project

We have a system running ssh. When a user logs in, they do not get the project they are assigned to (they run under "system"). I verify the project using the command "ps -e -o user,pid,ppid,args,project". If you do a "su - username", the user does get the project they are assigned to (and all... (2 Replies)
Discussion started by: kurgan
2 Replies

3. What is on Your Mind?

fun scripts

Lets get a list of everyones funny scripts (8 Replies)
Discussion started by: JamieMurry
8 Replies

4. Solaris

what is the use of /etc/project file and project administration commands?

i have two doubts.. 1. what is the use /etc/project file. i renamed this file and when i tried to switch user or login with some user account the login was happening slowly. but when i renamed it to original name it was working fine... why so? 2. unix already has useradd and grouadd for... (4 Replies)
Discussion started by: chidori
4 Replies

5. News, Links, Events and Announcements

A new project was posted on The UNIX and Linux Forums project board.

A new project was posted on your project board. Project title: Bash Shell Tutoring Estimated Budget: $50/hr Start date: Immediately Required skills: Linux, Bash, Shell, UNIX I work as a datawarehouse designer and developer. Although I usually stick to the role of an analyst,... (0 Replies)
Discussion started by: Neo
0 Replies

6. Shell Programming and Scripting

FINDING DUPLICATE PROJECT ( directory project )

I have a project tree like that. after running find command with the -no -empty option, i am able to have a list of non empty directory DO_MY_SEARCH="find . -type d -not -empty -print0" MY_EXCLUDE_DIR1=" -e NOT_IN_USE -e RTMAP -e NOT_USEFULL " echo " " > $MY_TEMP_RESULT_1 while... (2 Replies)
Discussion started by: jcdole
2 Replies
GIT-COUNT-OBJECTS(1)                                                Git Manual                                                GIT-COUNT-OBJECTS(1)

NAME
git-count-objects - Count unpacked number of objects and their disk consumption SYNOPSIS
git count-objects [-v] [-H | --human-readable] DESCRIPTION
This counts the number of unpacked object files and disk space consumed by them, to help you decide when it is a good time to repack. OPTIONS
-v, --verbose Report in more detail: count: the number of loose objects size: disk space consumed by loose objects, in KiB (unless -H is specified) in-pack: the number of in-pack objects size-pack: disk space consumed by the packs, in KiB (unless -H is specified) prune-packable: the number of loose objects that are also present in the packs. These objects could be pruned using git prune-packed. garbage: the number of files in object database that are neither valid loose objects nor valid packs size-garbage: disk space consumed by garbage files, in KiB (unless -H is specified) alternate: absolute path of alternate object databases; may appear multiple times, one line per path. Note that if the path contains non-printable characters, it may be surrounded by double-quotes and contain C-style backslashed escape sequences. -H, --human-readable Print sizes in human readable format GIT
Part of the git(1) suite Git 2.17.1 10/05/2018 GIT-COUNT-OBJECTS(1)
All times are GMT -4. The time now is 04:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy