find

Number of files in a directory

微笑、不失礼 提交于 2019-12-25 04:43:24
问题 I'm try to find, in only one row, the number of files (*.rar) in a directory. For doing this I'm using the commands: for /f "delims=" %i in ('find /c ".rar" "D:\backup e ckpdb ept-icd\test\unload\lista_files_rar.txt"') do echo %i but the value of %i I have at the end is : D:\BACKUP E CKPDB EPT-ICD\TEST\UNLOAD\LISTA_FILES_RAR.TXT: 8 I would like to obtain only the number 8 so instead to echo the value I would assign the value to a variable. I use the command line : dir /b *.rar | find /c ".rar

Number of files in a directory

蹲街弑〆低调 提交于 2019-12-25 04:43:03
问题 I'm try to find, in only one row, the number of files (*.rar) in a directory. For doing this I'm using the commands: for /f "delims=" %i in ('find /c ".rar" "D:\backup e ckpdb ept-icd\test\unload\lista_files_rar.txt"') do echo %i but the value of %i I have at the end is : D:\BACKUP E CKPDB EPT-ICD\TEST\UNLOAD\LISTA_FILES_RAR.TXT: 8 I would like to obtain only the number 8 so instead to echo the value I would assign the value to a variable. I use the command line : dir /b *.rar | find /c ".rar

CakePHP Call to undefined method find()

亡梦爱人 提交于 2019-12-25 04:26:35
问题 So I am new to CakePHP and tried to set up a little project analogous to the CakePHP blog tutorial. What I did: Created a database table "sessions" Created a SessionsController.php in the Controller folder Created a Session.php in the Model folder Created a Sessions folder in View Created a index.ctp in the Sessions folder What my problem is: When trying to access Sessions, I will get this error: "Error: Call to undefined method SessionComponent::find() File: C:\xampp\htdocs\JFKTransparency

How do I locate and perform a command on all executable files matching a given pattern?

筅森魡賤 提交于 2019-12-25 04:17:41
问题 How I identify all files on my Unix (OS X) system matching a particular pattern that have their executable bit set, so that I can perform a command on them? For example, I'd like to locate all .doc files created before a given date that have any executable bit set, and chmod a-x them. 回答1: Something like find . -name '*.doc' -perm +0111 -exec chmod a-x ''{}'' ";" It will depend on exactly what you mean by "executable". 来源: https://stackoverflow.com/questions/29922883/how-do-i-locate-and

FINDSTR in Command Prompt

十年热恋 提交于 2019-12-25 03:41:06
问题 I am trying to generate a file with all of the rows from an input file containing a certain string using the FINDSTR commanand in cmd.exe . My command below does not produce any results, whereas the FIND command (also below) shows that there are 182,688 rows containing the string I'm looking for... FIND command: FIND /c "searchstring" c:\Users\karl\Desktop\Report.csv gives the following: ---------- C:\USERS\KARL\DESKTOP\REPORT.CSV: 182688 FINDSTR command: findstr /i /c:"searchstring" c:\Users

remove blank first line script

*爱你&永不变心* 提交于 2019-12-25 03:39:18
问题 I have this script which is printing out the files that have the first line blank: for f in `find . -regex ".*\.php"`; do for t in head; do $t -1 $f |egrep '^[ ]*$' >/dev/null && echo "blank line at the $t of $f"; done; done How can I improve this to actually remove the blank line too, or at least copy all the files with the blank first line somewhere else. I tried copying using this, which is good, because it copies preserving the directory structure, but it was copying every php file, and I

How to get “! -path” argument from file for find command

我的梦境 提交于 2019-12-25 03:38:06
问题 I would need a script that can find files with the given extension on the given path, but excluding directories, their name taken from a file. We have a script.sh and a white.list file. white.list contains: /path/something /path/someotherthing Script has: whitelistfile=/scriptdir/white.list whitelist=`cat $whitelistfile` if test -n "$whitelist" then # collect whitelist paths for listitem in $whitelist; do excludepath+="! -path \"${listitem}*\" " done files=`find "$path" $excludepath -name *."

Finding Documents Array CouchDB

我怕爱的太早我们不能终老 提交于 2019-12-25 03:34:45
问题 I have Documents they have this structure: {id: ####, rev: ####, "Cam_name": "Camera SX", "colour": "white", "manufacturer": "Sony", "rec_limit": 180, "Customer": ["Mike","Ann","James"] } {id: ####, rev: ####, "Cam_name": "PXSV CAM", "colour": "white", "manufacturer": "LG", "rec_limit": 144, "Customer": ["Mike","Oliver","Mr. Rain"] } {id: ####, rev: ####, "Cam_name": "LxSV Double", "colour": "white", "manufacturer": "Phillips", "rec_limit": 160, "Customer": ["Mike"] } And i want to make an

Find php files with strings that have more than 50 characters

久未见 提交于 2019-12-25 02:44:56
问题 I am trying to run a command (find) for example that would allow me to find all the php files in which content there are strings with more than 50 characters. I have a base that looks like this, but I fail what to write in the grep: sudo find . -name '.*php' -exec fgrep -q '..' {} \; -print I assume that a thing that is not a character is a whitespace. Basically I am trying to find PHP files that might have been compromisde with huge chunks of encoded64 strings. 回答1: Matches lines with 50 or

Cannot find symbol compiler error

邮差的信 提交于 2019-12-25 02:33:02
问题 I'm having problems with this assignment I have to do for my java programming class. What I have to do is perform a chroma key technique on an image with a solid background. More info can be found here. The method I created works when I put the two object parameters for the method. But, when I put the parameters in the constructor and then try to use the method, I get a compiler error. I have my class down below (I have to use two different classes, one for methods, one for testing). Any help