命令为:
mv $(ls /mnt/sda1/t1/*.mp4 | head -n -100) /mnt/sda1/t2
其中 /mnt/sda1/t1/*.mp4 的文件中包含空格:
/mnt/sda1/t1/2014-10-17 05.28.20.000.mp4
/mnt/sda1/t1/2014-10-17 05.38.37.120.mp4
/mnt/sda1/t1/2014-10-17 05.41.07.774.mp4
执行后出现错误:
mv: can't rename '/mnt/sda1/t1/2014-10-17': No such file or directory
mv: can't rename '06.21.58.497.mp4': No such file or directory
将命令改为:
mv "$(ls /mnt/sda1/t1/*.mp4 | head -n -100)" /mnt/sda1/t2
将移动目标用""括起来,结果出现错误:
...
/mnt/sda1/t1/2014-10-17 21.27.43.700.mp4': File name too long
如何解决这个问题?谢谢!
mv $(ls /mnt/sda1/t1/*.mp4 | head -n -100) /mnt/sda1/t2
其中 /mnt/sda1/t1/*.mp4 的文件中包含空格:
/mnt/sda1/t1/2014-10-17 05.28.20.000.mp4
/mnt/sda1/t1/2014-10-17 05.38.37.120.mp4
/mnt/sda1/t1/2014-10-17 05.41.07.774.mp4
执行后出现错误:
mv: can't rename '/mnt/sda1/t1/2014-10-17': No such file or directory
mv: can't rename '06.21.58.497.mp4': No such file or directory
将命令改为:
mv "$(ls /mnt/sda1/t1/*.mp4 | head -n -100)" /mnt/sda1/t2
将移动目标用""括起来,结果出现错误:
...
/mnt/sda1/t1/2014-10-17 21.27.43.700.mp4': File name too long
如何解决这个问题?谢谢!