Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Can rm be used for directories as well? I know that the -r means recursively but in terms of functionality, how are the 2 commands different?
Without -r, rm only deletes the named files (and not directories). With -r, as you say, it's recursive and will delete both files and directories, both in and under the named directories.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed last year.
Improve this question
I have two similar directories with slightly different file contents. Is there a good way on Windows to compare the contents of two directories like the Linux diff command?
You can use BeyondCompare the diff tool to compare the contents of different directories, but you need to install it first.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I use wget -O to get the site text to a specific file.
It saves the file within ONE line. File has about 2 milion characters. After, I would like to remove any other characters different from "directory= ************" format (including quotation mark, **** stand for any text till second quotation mark).
Is there any smart way to acomplish that?
grep -o '"directory= [^"]*"' file
The smartest way would be to pipe it out to a smarter interpreter. Python for instance.
Python has a great regular expressions library at your disposal.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I need to find files with the same (duplicated) content inside them in a given directory. And I need to use shell code.
Try this: BASH
find -type f -exec md5sum '{}' ';' | sort | uniq --all-repeated=separate -w 33 | cut -c 35-
Explanation:
Find all files, calculate their MD5SUM, find duplicates by comparing the MD5SUM, print the names
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 10 years ago.
Improve this question
let's say I have 2 different scripts that do a mmv on files from the same directory but to different target directories.
They are run at the same time (cron).
What happens to the files that match mmv's pattern ? Are they scattered in both target directories ?
This is a timing question. Who moves them first is the winner.
It makes a difference here if you move them to a directory within the same file system where just the entries are moved or across file systems, where the file is copied and then removed.
Unpredictable result:
The first (there is always a first) would success,
The laters would fail -> generate some error report.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
What is happening behind the scenes when I delete several files on Windows?
Assuming that my code deletes several files in a loop, I guess there should be some kind of optimization to access the MFT. How exacly does this works?
What are the best practices for optimal file deletion?
Deleting massive numbers of files is an infrequent operation on Windows, so it appears there is no support for optimizing this use case. The best you can do is delete all the files individually.
If all the files are in a single directory, you may try Directory.Delete
Otherwise, you may also try IFileOperations.