An error at the commandline with the Linux shell (e.g. Dash), most notably using:
- find
-
rm
\cp /path/to/files/* .
bash: //bin/cp: Argument list too long
\find /path/to/files/ -type f -name '*' -exec \cp -x {} . \;
bash: /usr/bin/find: Argument list too long
for i in `\ls /path/to/files/*`; do \cp "$i" . ; done
bash: //bin/ls: Argument list too long
cd /path/to/source/ for i in `\ls -c1`; do \cp "$1" /path/to/dest/ ; done
cp: cannot stat `': No such file or directory cp: cannot stat `': No such file or directory cp: cannot stat `': No such file or directory cp: cannot stat `': No such file or directory
# Deals with filenames that have spaces, etc. It uses NULL seperation rather than space seperation.
\find /path/to/files/* -print0 | \xargs -0 \cp {} /path/to/dest/ \;
bash: /usr/bin/find: Argument list too long
ARGH!
Just use Midnight Commander
Some other solutions nobody could guess at:
# To leave the contents of subdirectories alone: \find . -maxdepth 1 -print0 | \xargs -0 \rm -f
\xargs \rm < <(ls .)
# printf is a bash builtin \printf "%s\n" * | \xargs \rm
other notes ∞
Some people recommend using Ruby or Ruby's irb.
Last updated 2020-01-01 at 14:31:50

ported