what does rm ** do in linux. started learning linux and stuck here. I tried reading but couldnt understand or didn get the answer
Advertisement
Answer
*
is a wildcard. Wildcard characters are used to define the pattern for searching or matching text on string data in the bash shell.
The shell interprets certain characters in filenames and for other purposes as well. It passes the interpreted version to commands
. For example, the most commonly used special character is asterisk, *
, meaning “zero or more characters”. When you type a command like ls a*
, the shell finds all filenames in the current directory starting with a
and passes them to the ls
command.
Since rm
is to remove, rm **
will delete all the files from where you run the command.