![]() ![]() In this article, we have seen how to move a large number of files from one directory to another, and successfully bypass the ‘ Argument list too long’ error in Linux. Related Read: How to Copy Large Number of Files in Linux Conclusion You can confirm by running the following and verify that the files have been moved successfully to ‘/tmp’. name "file_*" -exec mv ' are a placeholder for the argument which is to be used from the output of find. If you have not installed grub on partition 2 then install grub on partition 2 and make partition 2 the grub default. Then we make use of the '-exec' parameter of ‘ find‘ which will allow you to run any command over the output of find. Yes, you can move the contents of partition 2 to partition 1. We run ‘ find‘ in the same directory as the files we want to move. ![]() The command to create a new directory is mkdir: mkdir mydir cd mydir/ Move files and directories The mv command moves both directories and files. Change to your home directory and create a new directory named mydir for the exercises. The ‘ find‘ command basically searches for files in directories based on different parameters. Connect to your Linux terminal with your regular user account, and get ready to reorganize. You can use this as a 'push' or a 'pull' command, but lets start with pushing the file to the other server. ![]() To solve this problem, we make use of the ‘ find‘ command. 1 For a single file, try the 'scp' command. $ ls -l | wc -lĪrgument list too long Error Solution: Use ‘Find’ Command Thus, it gives the aforementioned error when we try to move them. over a hundred thousand files, it throws an error: “ Argument list too long”.įor example, in the image below, the folder contains 253420 files. Thus, if a very high number of files are being specified with the wildcard with ‘ mv‘, Eg. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |