Spiga

How To Resolve Argument Too Long Error In Unix

How To Resolve Argument Too Long Error In Unix

Sometime, when we fire some commands in the unix, then it gives the 'Argument Too Long Error' on the console. We get this error when there is lots of file, suppose there are 15k files and we want to move those file or delete those files, then it gives the same error.

How To Resolve:

To resolve these error, we will use the find commands and will pass the remove command as a argument to the find command.

find . -name '*.*' xargs rm

.           : is directory name
-name  : is type of file that we want to delete.
xargs    : is Linux command that makes passing a number of arguments to a command easier.

Hope, this will solve your problem.

0 comments: