T
T
tfc2020-06-15 11:44:50
linux
tfc, 2020-06-15 11:44:50

What's the point of file permissions if cp -f overwrites the file anyway?

What's the point of having permissions if without sudo basically anyone can overwrite a file?
5ee734fb2d367257808179.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2020-06-15
@tfc

Because this is the same user's file, with cp -f it first deletes and then copies.

O
Official account of the Timeweb team, 2020-06-15
@timeweb_team

Answer from Timeweb support.
The -f switch deletes the file and recreates it if the destination file exists and cannot be opened. More details in man: https://pingvinus.ru/note/cmd-cp

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question