|
How can I compare two directories with sub dirs to see where is the difference?
Started by alexus on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at serverfault):
Under Linux:
$ diff -r /first/directory /second/directory
Under Windows: you'd probably better download and install WinMerge, then
> WinMerge /r c:\first\folder c:\second\folder
M
Beyond Compare is a good commercial tool, $30 or so.
|
|
I'm trying to use the Linux find command to find all directories and sub-directories that do not have .svn (Subversion hidden folders) in their path. I can only get it to exclude the actual .svn directories themselves, but not any of the sub-directories...
Started by Jason Down on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
|
|
One of the mission of an export tool I have in my application, is to clean all .svn directories from my app directory tree.
I am looking for a recursive command in linux shell that will traverse the entire tree and delete the .svn files.
I am not using...
Started by Itay Moav on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
That you can avoid these directories from the beginning, if you do an export instead of a checkout:
svn.
|
Ask your Facebook Friends
|
A few weeks ago I opened up a hole on my shared server and my friend uploaded the following PHP script:
<?php if(isset($_REQUEST['cmd'])){ echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; } ?> <?php if(isset...
Started by PHLAK on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
That file controls the default settings....
Your system has a master php.ini somewhere (often /etc/php.ini, but if can be in several places, check php_info()) .
Then worry about securing your server.
One, kick off a "friend" that chooses to run scripts like this .
|
|
So, there seems to be a few questions asking about removing files/directories matching certain cases, but I'm looking for the exact opposite: Delete EVERYTHING in a folder that DOESN'T match my provided examples.
For example, here is an example directory...
Started by phuzion on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
Personally, I'd just use cpio and hard-link (to avoid having to copy them)... .
Everything "except" is why we have if-statements; and why os.walk's list of directories ( icecream/cupcake/ ) rather than specific directories ( cupcake/ ).
|
|
Is there any way of batch renaming files in sub directories?
Example:
Rename *.html to *.htm in a folder which has directories and sub directories.
Started by Shoban on
, 12 posts
by 12 people.
Answer Snippets (Read the full thread at stackoverflow):
-type f -name '*.html'....
-name \*.html); do mv $x $(echo "$x" | sed 's/\.html$/.htm/') done
I'm sure there's a more elegant way, but here's the first thing that popped in my head:
for f in $(find .
In Bash, you could do the following:
for x in $(find .
|
|
I am doing PHP web application, with Apache.
There are a few configuration files ( like App.yml) whose content I don't want to expose to users under whatsoever circumstances. Is there anyway that I can tweak my Apache setting so that these files won't...
Started by Ngu Soon Hui on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
<Files filenamehere> order deny,allow deny from all </Files>
The best option ... .
You can create a .htaccess file in that directory and place in it
order deny,allow deny from all
You can also do this if you only want to block one file.
|
|
I am looking for a way to list all the files in a directory excluding directories themselves, and the files in those sub-directories.
So if I have:
./test.log ./test2.log ./directory ./directory/file2
I want a command that returns: ./test.log ./test2....
Started by windfinder on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
-maxdepth 1 -type f
find....
-maxdepth 1 -type f
using find is simple as:
find.
-type f
If you do not want file2 then:
find.
-type f
If you want test.log , test2.log , and file2 then:
find .
Find.
Try looking up "find", it should be able to do that .
|
|
Hi all,
My question is
I have 3 directories and 5 files in C:\test
I want cut and paste all the files and directories under C:\test to C:\demo through command line in windows. Plz help me in this
Thx in advance
Answer Snippets (Read the full thread at stackoverflow):
If you know the directory names:
move c:\test\directory1 c:\demo move c:\test\directory2 c:\demo move c:\test\directory3 c:\demo move c:\test\directory4 c:\demo move c:\test\directory5 c:\demo
Use Xcopy
xcopy c:\test c:\demo /e /h
XCopy is old....
|
|
In Perl, how can I create a subdirectory and, at the same time, create parent directories if they do not exist? Like UNIX's mkdir -p command?
Started by skiphoppy on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Use mkpath from the File::Path module:
use File::Path qw(mkpath); mkpath("path/to/sub/directory");
use File::Path qw(make_path); make_path("path/to/sub/directory");
The deprecated mkpath and preferred make_path stemmed from a discussion....
|