I want to find a file with a certain name, but search in direcotories above the current one, instead of below.
I'd like something similar to: (except functional)
$ cd /some/long/path/to/my/dir/
$ find -maxdepth -1 -name 'foo'
/some/long/path/to/foo
/some/foo
Shell scripts or one-liners preferred.
In response to the several questi...
Hi,
I am trying to do a find with conditions in two models. Is this possible ?
$offices = $this->User->Org->find('first', array(
'conditions' => array(
"or" => array(
'Org.website LIKE' => $match,
'Domain.domain' => $match
)
)
));
...
Hi!
I need Git command to get/find last tag starting with 'v' to get last versioning commit (I am using tags with v letter at the beginning to tag next application version (example: v0.9.1beta).
Is there any way to do it?
...
I'm trying to find some compressed log files, and do some operations on them. I can't use ls because they are thousands of files in the directory and BASH throws a 'argument list too long' error.
This has brought me to find, but I'm having trouble with my regex.
Here is the whole find command
find $i -regex '.*logfile_MP[0-9]-GW0[0-9]...
Trying to find the attribute value from a url hash.
// URL
http://url.com/index.html#link
// HTML
<a href="#link" rel="3">Some link</a>
// JS
var anchor = window.location.hash.substring(1);
// Need help finding attribute value from finding the anchor
var attribute = .find('#+anchor').attr('rel'); //this needs to have a value of 3
Al...
Hi
New to bash scripting, I'm writing a script to copy my TV shows accross from a download folder to an archive folder.
So far I have this:
find `*`show1`*`.avi | cp \"" $0 "\" "/mnt/main/data/tv/Show1"
find `*`show2`*`.avi | cp \"" $0 "\" "/mnt/main/data/tv/Show2"
I understand this is not the best method, but my skills of bash ...
In Cakephp is there a better way to write this:
$unread_orders = $this->Order->find('all', array('conditions' => array('Order.status' => 'unread') ));
$read_orders = $this->Order->find('all', array('conditions' => array('Order.status' => 'read') ));
$dispatched = $this->Order->find('all', array('conditions' => array('Order.status' => 'd...
I have some code that is dependent on the fact that (until now) I've been getting the results by find in cygwin in ascending order.
Is this always the case or have I to be careful about any other "variables", to make sure I will get this result in both Windows / Linux, whatever?
Thanks
...
Is there any way to change the following string so I don't get any problems when there are files/folders with spaces in them?
files=`find ~/$folder -name "*@*" -type f`
I'd prefer if there was a solution that wouldn't have to involve having to change other parts of my code but this line of code, as everything seems to be working corre...
I have this rails find that i need to get the id as well but if i put the id in the :select wont it effect the query and is there another way to get the id
@past_requests = Request.find_all_by_artist(name, :conditions => ["showdate < ?", Time.now], :select => "distinct venue, showdate")
...
I've been trying a few different ways to filter finding of specific nodes within my html.
Here is some example html:
<body>
<div ui:component="component1"></div>
<ul ui:component="component2"></ul>
<article ui:component="component3"></article>
</body>
I've successfully been able to match items by doing a simple filter:
/...
I use vectors a lot in my programming, and generally to traverse a vector for an existing value I use std::find as in:
std::vector<int> foo;
std::vector<int>::iterator pos( std::find( foo.begin(), foo.end(), bar );
This is a real bore. So I went to deriving a template from std::vector to provide a find method:
template<class T>
class...
I keep hearing this is a path issue with cygwin. It is prevent emacs from working within my cygwin. When I execute find on the cli (not bash/cygwin) I get the same error not matter what I type. I've read this is a problem with path creation within cygwin and that it should be prepending itself to the path. As you can see it is doing ...
Hi there,
is it possible to use a the find command in some way that it will not recourse into the sub directories?
e.g.
DirsRoot
|-->SubDir1
| |-OtherFile1
|-->SubDir2
| |-OtherFile2
|-File1
|-File2
And the result of something like find DirsRoot --donotrecuourse -type f will be only File1, File2 ? Anyone knows a way...
Hello, I have a little Vim script which does a multi-line search and replace:
vim -c 's/^ *<hi a=\"26\">\nHello/<td height=\"26\">\r<\/table>\r<bla \/>' \
-c 'w!' -c 'q' test.html
That works. However, when I put that in a find -exec to do this recursively in the directory:
find . -iname 'test.html' -exec \
vim -c 's/^ *<hi a=...
I have a file (more specifically, a log4j configuration file) and I want to be able to read in the file and pick out certain lines in the code and replace them. For example, within the file there is a string of text that indicates the directory it is stored in, or the level of the logger. I want to be able to replace those string of text...
I need to find a way to the get the class from a li and then add that class to a div that wraps all my main content. so...
<div class="structBody">
<ul id="ContentBreadCrumbsColor">
<li class="teal"></li>
</ul>
<div class="cntrWrap LI_CLASS_GOES_HERE">
HTML TEXT GOES HERE
</div>
</div>
Can anyone help? I have t...
I need to find the most optimal solution using Regex to find URL's inside a block of HTML and add a new attribute Name="true" inside the tag.
Below is an example of HTML (which can contain embedded JS), I just need to add the new attribute Name="true" to any URL and NOT effect any embedded JS file.
Example HTML :
<HTML>
<a href...
i have a tweet table that stores tweets and its replies like this
tweet(id, parent_id, tweet_message, time)
where parent_id is a self id if its a tweet and is of parent id if its a reply. how to do a find to pull out tweets where id = parent_id
example:
tweet(1, 1, 'My name is Harsha', 'time') parent_id = id since its a tweet and...
I found an interesting thing:
In word 2010, select some text, and run the following VBA code:
public Sub Test()
With Selection.Range.Find
MsgBox .Execute(Selection.Range.text)
MsgBox .Found
End With
End Sub
Both the two message box say "False", but both should be "True". Why?
Thanks a lot for your suggestion...