我有大约 50 个非常大的 csv 文件,它们有数千行。
而且我只想为它们中的每一个保留前 200 行 - 如果生成的文件覆盖原始文件,我可以。
我应该使用什么命令来执行此操作?
我在 FileZilla 中错误地将一个文件夹拖放到另一个文件夹中。
~/big_folder
~/some_other_folder
被移动的文件夹是一个非常大的文件夹。它包括数十万个文件(node_modules、小图像文件、很多文件夹)
奇怪的是,当我松开鼠标后,移动就完成了。文件夹“big_folder”移动到“some_other_folder”。
~/some_other_folder/big_folder
(搬家后big_folder
没有)~/
然后我意识到错误并尝试向后移动,但它在 FileZilla 和终端上都失败了。
然后我必须cp -r
将文件复制回来,因为有服务器端代码访问这些文件~/big_folder
它需要永远等待......
我应该怎么办?
顺便说一句,这是 FileZilla 的输出(这是回退的失败):
Status: Renaming '/root/big_folder' to '/root/some_other_folder/big_folder'
Status: /root/big_folder -> /root/some_other_folder/big_folder
Status: Renaming '/root/some_other_folder/big_folder' to '/root/big_folder'
Command: mv "big_folder" "/root/big_folder"
Error: mv /root/some_other_folder/big_folder /root/big_folder: received failure with description 'Failure'