find

Find files with size in Unix [closed]

我是研究僧i 提交于 2019-12-17 17:55:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I am looking for a Unix command to print the files with its size. I used this but it didn't work. find . -size +10000k -print. I want to print the size of the file along with the filename/directory. 回答1: find . -size +10000k -exec ls -sd {} + If your version of find won't accept the + notation (which acts rather

How to find elements with 'value=x'?

这一生的挚爱 提交于 2019-12-17 17:53:00
问题 I need to remove element that have value="123" . I know that all elements with different values are located into #attached_docs , but I don't know how to select element with value="123" . $('#attached_docs').find ... .remove(); Can you help me? 回答1: If the value is hardcoded in the source of the page using the value attribute then you can $('#attached_docs :input[value="123"]').remove(); If you want to target elements that have a value of 123 , which was set by the user or programmatically

How to delete many 0 byte files in linux?

天大地大妈咪最大 提交于 2019-12-17 17:26:06
问题 I've a directory with many number of 0 byte files in it. I can't even see the files when I use the ls command. I'm using a small script to delete these files but sometimes that does not even delete these files. Here is the script: i=100 while [ $i -le 999 ];do rm -f file${i}*; let i++; done Is there any other way to do this more quickly? 回答1: Use find combined with xargs . find . -name 'file*' -size 0 -print0 | xargs -0 rm You avoid to start rm for every file. 回答2: With GNU's find (see

MongoDB Show all contents from all collections

拈花ヽ惹草 提交于 2019-12-17 17:24:21
问题 Is it possible to show all collections and its contents in MongoDB? Is the only way to show one by one? 回答1: Once you are in terminal/command line, access the database/collection you want to use as follows: show dbs use <db name> show collections choose your collection and type the following to see all contents of that collection: db.collectionName.find() More info here on the MongoDB Quick Reference Guide. 回答2: Step 1: See all your databases: show dbs Step 2: Select the database use your

Command line: piping find results to rm

为君一笑 提交于 2019-12-17 17:20:30
问题 I'm trying to work out a command which deletes sql files older than 15 days. The find part is working but not the rm. rm -f | find -L /usr/www2/bar/htdocs/foo/rsync/httpdocs/db_backups -type f \( -name '*.sql' \) -mtime +15 It kicks out a list of exactly the files I want deleted but is not deleting them. The paths are correct. usage: rm [-f | -i] [-dIPRrvW] file ... unlink file /usr/www2/bar/htdocs/foo/rsync/httpdocs/db_backups/20120601.backup.sql ... /usr/www2/bar/htdocs/foo/rsync/httpdocs

Find index of all (non-unique) elements in a cell array as they appear in a second (sorted and unique) cell array

浪尽此生 提交于 2019-12-17 16:48:14
问题 A = {'A'; 'E'; 'A'; 'F'}; B = {'A';'B';'C';'D';'E'; 'F'}; I am trying to get for each string in cell array A , the index that matches that string in cell array B . A will have repeated values, B will not. find(ismember(B, A) == 1) outputs 1 5 6 but I want to get 1 5 1 6 preferably in a one liner. I can't use strcmp instead of ismember either as the vectors are different sizes. The vectors will actually contain date strings, and I need the index not a logical index matrix, I'm interested in

jQuery - Find and replace text, after body was loaded

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 15:43:02
问题 I received some amazing help from others, concerning finding and replacing text with jquery. The code below will find the word: "Subject:" and replace it with "Name:" $("*").each(function () { if ($(this).children().length == 0) { $(this).text($(this).text().replace('Subject:','Name:')); } }); And this works wonderfully. The only thing I'm running into issues with is replacing text that is loaded after the page loads. I do have some javascript functions that are displaying data from the

How to find recursively for a tag of XML using LXML?

会有一股神秘感。 提交于 2019-12-17 15:35:48
问题 <?xml version="1.0" ?> <data> <test > <f1 /> </test > <test2 > <test3> <f1 /> </test3> </test2> <f1 /> </data> Using lxml is it possible to find recursively for tag " f1 "? I tried findall method but it works only for immediate children. I think I should go for BeautifulSoup for this !!! 回答1: You can use XPath to search recursively: >>> from lxml import etree >>> q = etree.fromstring('<xml><hello>a</hello><x><hello>b</hello></x></xml>') >>> q.findall('hello') # Tag name, first level only. [

How do I use a pipe in the exec parameter for a find command?

坚强是说给别人听的谎言 提交于 2019-12-17 15:34:24
问题 I'm trying to construct a find command to process a bunch of files in a directory using two different executables. Unfortunately, -exec on find doesn't allow to use pipe or even \| because the shell interprets that character first. Here is specifically what I'm trying to do (which doesn't work because pipe ends the find command): find /path/to/jpgs -type f -exec jhead -v {} | grep 123 \; -print 回答1: Try this find /path/to/jpgs -type f -exec sh -c 'jhead -v {} | grep 123' \; -print

How do I create a keyValue pair (display field) by combining/having two fields in CakePHP 3?

一个人想着一个人 提交于 2019-12-17 10:59:38
问题 I need help getting two values (for human friendly dropdown) in a key-value pair using find or get or anything else. I need help with the simplest method of doing this in CakePHP. Here's my attempt: in my controller $users = $this->LocationsUser->Users->find('list', [ 'limit' => 1, 'keyField' => 'id', 'valueField' => ['first_name', 'last_name'] ])->where(['id' => $id]); In my view echo $this->Form->input('user_id', [ 'options' => $users, 'type' => 'select', 'multiple' => false, ]); The result