Tag Archives: linux

Vim / Vi: Save File Without Root Permissions

unix linux

Objective: You open a file for editing on vi but you do not have write permissions for that file. You make changes and when you try to save changes, you get the infamous error “E212: Can’t open file for writing” from vim / vi editor. You realise that you forgot to execute vi with sudo. How do you save the file without creating a temporary file?

Bash: Escape String Variable

unix linux

Objective: Escape or append a ‘\’ to reserved characters (e.g &, \, |, ?, *, etc) found on a string variable in bash.

Linux: Get UUID from Disk

unix linux

Objective: Map a UUID (universally unique identifier ) to a device and vice versa on Linux.