Codewizard@hear-me.social to No Stupid Questions@lemmy.world · 3 days agowhat happens when you give the command in the command line rm -rf ?message-squaremessage-square28linkfedilinkarrow-up19file-text
arrow-up19message-squarewhat happens when you give the command in the command line rm -rf ?Codewizard@hear-me.social to No Stupid Questions@lemmy.world · 3 days agomessage-square28linkfedilinkfile-text
minus-squareremon@ani.sociallinkfedilinkarrow-up2·edit-23 days agoBecause you’re using it on nothing. $ mkdir test $ cd test ~/test$ touch 1 2 3 4 5 ~/test$ cd .. $ rm -rf test $ ls No more test folder.
minus-squareSuccessful_Try543@feddit.orglinkfedilinkarrow-up7·edit-23 days agoExactly, but that wasn’t the question.
minus-squareremon@ani.sociallinkfedilinkarrow-up3·edit-23 days agoWhat are you talking about? The does exactly what I said it does. It only does nothing for you because you used it incorrectly (in the wrong folder without the required argument).
minus-squareSuccessful_Try543@feddit.orglinkfedilinkarrow-up5·3 days agoThe question is: what happens when you give the command in the command line rm -rf ? rm -rf * or here rm -rf test are different commands.
minus-squareremon@ani.sociallinkfedilinkarrow-up3·edit-23 days agorm is the command, -rf are the flags and “test” is an required argument. So no, they are not different commands.
minus-squareSuccessful_Try543@feddit.orglinkfedilinkarrow-up6·3 days agoNo, the argument is not required, the command is valid. It’s intentional and a neat feature that rm -rf alone without a specified file does nothing. See e.g.: https://unix.stackexchange.com/a/553741
minus-squareremon@ani.sociallinkfedilinkarrow-up3·edit-23 days agoIt does nothing because you used the wrong syntax but also set the flag that suppresses the output of syntax errors … Imagine someone would asked “What does a toaster do?” I say “It toasts bread”. You come in with a picture of bread in a toaster and say “It does nothing”. I tell you “You have to press the button”. "You say “oh well, that wasn’t the question, a toaster with the button pressed is basically a different device!” Insert <Futurama not sure if trolling …> meme.
minus-squareSuccessful_Try543@feddit.orglinkfedilinkarrow-up2·edit-23 days agoYou should obviously improve your reading skills. The File argument is optional. rm [OPTION]… [FILE]… https://www.man7.org/linux/man-pages/man1/rm.1.html
minus-squareremon@ani.sociallinkfedilinkarrow-up1·3 days agoSure. And you should start learning basic bash skills.
Because you’re using it on nothing.
$ mkdir test $ cd test ~/test$ touch 1 2 3 4 5 ~/test$ cd .. $ rm -rf test $ lsNo more test folder.
Exactly, but that wasn’t the question.
What are you talking about? The does exactly what I said it does.
It only does nothing for you because you used it incorrectly (in the wrong folder without the required argument).
The question is:
rm -rf *or hererm -rf testare different commands.rm is the command, -rf are the flags and “test” is an required argument. So no, they are not different commands.
No, the argument is not required, the command is valid. It’s intentional and a neat feature that
rm -rfalone without a specified file does nothing.See e.g.: https://unix.stackexchange.com/a/553741
It does nothing because you used the wrong syntax but also set the flag that suppresses the output of syntax errors …
Imagine someone would asked “What does a toaster do?”
I say “It toasts bread”.
You come in with a picture of bread in a toaster and say “It does nothing”.
I tell you “You have to press the button”.
"You say “oh well, that wasn’t the question, a toaster with the button pressed is basically a different device!”
Insert <Futurama not sure if trolling …> meme.
You should obviously improve your reading skills.
The File argument is optional.
https://www.man7.org/linux/man-pages/man1/rm.1.html
Sure. And you should start learning basic bash skills.