I’m working on a code I checked from remote repository, where some of it went into that repo having “root” as the file owner. Now I want to move the directory containing the repo to another place, but deleting old files fails under regular user. Also dired-do-chown fails because I need to be root to change the file owner.
Is there any way to call dired commands as root? (like tramp for finding files)
Yes, just type
/sudo:root@localhost/...whenC-x C-fasks you for file name. This will open a trampified dired wheredired-do-chownand other dired commands work just fine.(Note that you can press
TABafter/sudo:, and minibuffer completion will insert the@localhostboilerplate.)