rm * does not work

sudo rm -f’ does not remove directory content.

$ sudo rm -f /1/*
$ echo $?
0
$ sudo ls /1
1 2 3 4 5

How can this happen?
Check permissions:

$ ls -ld /1
d-wx--x--x 1 user user 10 Mar  1 16:24 /1

If user doesn’t have permission to list the directory, the wildcard matches to nothing in despite of sudo.

Note: in zsh an error message is displayed:

zsh: no matches found: /1/*

avatar

About tompos

Hungary, Budapest
This entry was posted in IT, Linux. Bookmark the permalink.

Leave a Reply