Open file via SSH and Sudo with Emacs

As of Emacs 24.3, an analog of the old multi: syntax has been layered on top of the modern tramp-default-proxies-alist approach, meaning that you can once again perform multi-hops without any prior configuration. For details, see: C-hig (tramp)Ad-hoc multi-hops RET With the new syntax, each ‘hop’ is separated by |. The example in the manual … Read more

Command not found when using sudo

Permission denied In order to run a script the file must have an executable permission bit set. In order to fully understand Linux file permissions you can study the documentation for the chmod command. chmod, an abbreviation of change mode, is the command that is used to change the permission settings of a file. To … Read more

How does the vim “write with sudo” trick work?

In :w !sudo tee %… % means “the current file” As eugene y pointed out, % does indeed mean “the current file name”, which is passed to tee so that it knows which file to overwrite. (In substitution commands, it’s slightly different; as :help :% shows, it’s equal to 1,$ (the entire file) (thanks to … Read more