Hot answers tagged

2

find /path -type f -print0 | xargs -0 dos2unix --


1

You can use find to find all of the files in a directory structure that you want to run through your dos2unix command find /path/to/the/files -type f -exec dos2unix {} \; Take a look at the man pages for find, there are a lot of options that you can use to specify what gets evaluated


1

If your command would work if the commandline would not become too long then you can use (the tricky) xargs this way: ls /home/jeremy/source | tail -1000 | xargs mv -t /home/jeremy/dest This assumes there are no newlines and other special characters in the filenames (or the path) otherwise tail will not work properly and xargs will get split filenames ...


1

With recent[1] versions of GNU findutils and coreutils: find /home/jeremy/source -print0 | tail -z -n 1000 | xargs -0 -r mv -t /home/jeremy/dest/ The -print0, -z, and -0 options tell all three tools to use a NUL character as the filename/record separator. This makes it safe to use this pipeline with filenames containing ANY character. If your ...


1

It's what it says on the tin: “Maximum length of command we could actually use” is the maximum possible command line length, given the limit on the platform where xargs is running and the space taken up by the environment. This value only depends on the platform configuration and the environment. “Size of command buffer we are actually using” is the size ...



Only top voted, non community-wiki answers of a minimum length are eligible