- Most of time I’ll open system files with vim and after edit the system file vim says It’s readonly file.
Method 1
:w !sudo tee %
- This will ask to provide sudo password and save the file.
Method 2
- Save readonly file with
:w!!
- This will shortcut of Method 1.
Method 3
Create Alias
Shell Script
- Save the below shell script as
~/bin/autosudo.sh
Make Shell Script Executable
Post Navigation
Download Youtube Videos Generate Random Password