Tag Archives: unix

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.

Solaris GNU Utilities

unix linux

Most of the Solaris utilities (eg. find, grep, awk, sed) are sort of crippled when compared to their GNU counterparts. The GNU versions of the utilities are relatively flexible, in the sense that they most often support additional useful features.

Unix / Linux: Print IO Statistics of Running dd Process

unix linux

Let’s say you have a dd process that is running. By default, dd will only print IO statistics once the job has been completed or if it is interrupted by a Ctrl-C (SIGINT) command. While the job is running, you will probably have no idea how much data has been copied, the current progress or the copying speed. But fret not, there is actually a way to get the IO statistics of a running dd process.