Jump to content

How to get count of number of checked out files in all subfolders

statistics subfolders count

  • Please log in to reply
1 reply to this topic

#1 prourke



  • Members
  • Pip
  • 1 posts

Posted 30 December 2017 - 07:13 PM

An important metric for us is the total number of files currently checked out.  I have been unable to determine a way to get this count.  We use a folder structure that is several layers deep and need to get a count of all checked out files from the root folder and all the descendent folders.

#2 P4Reg


    Advanced Member

  • Staff Moderators
  • 105 posts

Posted 08 January 2018 - 04:15 PM

You could use the "p4 opened" command to get a list of opened (checkedout) files which you could pipe into a line count utility

# All opened files

p4 opened -a | Measure-Object -line

Windows CMD shell

p4 opened -a //...  | find /c /v ""


p4 opened -a | wc -l

There are a several options available to filter the output from opened, see "p4 help opened".

For example:

#All opened files under //depot/...
p4 opened -a //depot/...

# All files opened by client clientA under //depot/...
p4 opened -C clientA //depot/...

You could set this up as a custom tool in P4V, see https://www.perforce...ng_custom_tools


p4 files -a //... | wc -l

Also tagged with one or more of these keywords: statistics, subfolders, count

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users