WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: sudo chown not working on a specific link  (Read 64 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1912
sudo chown not working on a specific link
« on: September 16, 2026, 12:19:02 PM »
Hello, Rich, Paul_123, Juanito. After my recent incident involving  filetool.sh -r  leaving behind some root-owned parent directories in my home folder (see https://forum.tinycorelinux.net/index.php?topic=28276.msg183832#msg183832), I decided to check all my systems for root-owned items in /home/bruno.

I found a root-owned symlink in one of my machines. I know this is cosmetic because for symlinks what really matters is ownership/permissions of what the link points to. Nevertheless, I'd like to clean it up but am surprised that  sudo chown  is not having the desired effect:

Code: [Select]
~$ find . -user root
./.ash_history

~$ ls -l .ash_history
lrwxrwxrwx    1 root     staff           20 Sep 15 22:23 .ash_history -> /opt/log/ash_history

~$ sudo chown bruno .ash_history

~$ ls -l .ash_history
lrwxrwxrwx    1 root     staff           20 Sep 15 22:23 .ash_history -> /opt/log/ash_history
As you can see above, the chown command seems to have no effect. I already checked, and what the link points to is owned by regular user (not root):

Code: [Select]
~$ ls -l /opt/log/ash_history
-rw-r--r--    1 bruno    staff         1554 Sep 16 12:10 /opt/log/ash_history

I'm puzzled why  sudo chown  does not seem to be working here. What's going on?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1912
Re: sudo chown not working on a specific link
« Reply #1 on: September 16, 2026, 12:21:55 PM »
Oops. I need the  -h  flag. This works:
Code: [Select]
~$ sudo chown -h bruno .ash_historySorry for the noise.