Skip to main content
added 343 characters in body
Source Link
user313992
user313992

Because the standard requires it:

3. If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.

So a) this is a matter specific to the rm utility (it doesn't say anything about how permissions work in general) and b) you can override it with either rm -f file or true | rm file

Also, this was rm's behaviour since quite a long time -- 46 years, or maybe even longer.

Because the standard requires it:

3. If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.

So a) this is a matter specific to the rm utility (it doesn't say anything about how permissions work in general) and b) you can override it with either rm -f file or true | rm file

Because the standard requires it:

3. If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.

So a) this is a matter specific to the rm utility (it doesn't say anything about how permissions work in general) and b) you can override it with either rm -f file or true | rm file

Also, this was rm's behaviour since quite a long time -- 46 years, or maybe even longer.

added 181 characters in body
Source Link
user313992
user313992

Because the standard requires it:

3. If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.

So a) this is a matter specific to the rm utility (it doesn't say anything about how permissions work in general) and b) you can override it with either rm -f file or true | rm file

Because the standard requires it:

3. If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.

Because the standard requires it:

3. If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.

So a) this is a matter specific to the rm utility (it doesn't say anything about how permissions work in general) and b) you can override it with either rm -f file or true | rm file

Source Link
user313992
user313992

Because the standard requires it:

3. If file is not of type directory, the -f option is not specified, and either the permissions of file do not permit writing and the standard input is a terminal or the -i option is specified, rm shall write a prompt to the standard error and read a line from the standard input. If the response is not affirmative, rm shall do nothing more with the current file and go on to any remaining files.