LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Too many arguments error (https://www.linuxquestions.org/questions/linux-newbie-8/too-many-arguments-error-4175561759/)

yendhe 12-18-2015 06:32 AM

Too many arguments error
 
Hi,
what happens when this error comes i.e too many arguments.I have a doubt that after running rm * its give me error,so is files deleted or not from my directory.

aizkorri 12-18-2015 06:53 AM

Are you sure that the message is "too many arguments",
what you do is rm *? Be careful with this command or you might end up deleting something you don't want to.


May it be this? /bin/rm: cannot execute [Argument list too long]

This happens because it expands the asterisk, then you get a very long command line.
It won't delete anything if it's giving that error.

yendhe 12-18-2015 07:02 AM

Thank you

jpollard 12-18-2015 09:58 PM

The reason it doesn't work is because the shell creates the parameter list while parsing the command line. This usually doesn't fail - but when the exec system call is used to invoke the /usr/bin/rm utility, the exec files with this error.


All times are GMT -5. The time now is 03:55 AM.