News for hackers. Stuff that matters.
Re:Favorite Unix Commands by overgun77 on Monday January 07, 2013 @05:35PM (#5023684)
Not really a unix command, but a vi command that has been really useful, specially if you do lots of editing protected files and want to keep your custom vim configuration:

!sudo tee %

Re:Favorite Unix Commands by sousousou on Monday January 07, 2013 @10:25PM (#5024713)
Need to send the contents of the file to that command. Otherwise it effectively empties the file. (typo?)

:%!sudo tee %

Re:Favorite Unix Commands by ralph on Monday January 07, 2013 @05:40PM (#5023710)
What vi mode is that entered in?
Re:Favorite Unix Commands by emillon on Monday January 07, 2013 @05:44PM (#5023730)
Normal mode (:help :! for more information on this command).
Re:Favorite Unix Commands by ralph on Monday January 07, 2013 @05:49PM (#5023750)
What benefit does

    :!sudo tee %
have over doing it at the command line other than filling in the current filename for you? I suspect the original poster meant something like "gg!Gsudo tee %".
Re:Favorite Unix Commands by AjithAntony on Monday January 07, 2013 @08:54PM (#5024478)
:w !sudo tee %