Save a file you edited in vim without the needed permissionsI often forget to sudo before editing a file I don't have write permissions on. When you come to save that file and get the infamous "E212: Can't open file for writing", just issue that vim command in order to save the file without the need to save it to a temp file and then copy it back again. :w !sudo tee % Annotated link http://www.diigo.com/bookmark/http%3A%2F%2Fwww.commandlinefu.com%2Fcommands%2Fbrowse%2Fsort-by-votes
Working on a little script the other day I had the need to determine if the input to the script was coming from a pipe or from the terminal. Seems like a simple enough thing to determine but nothing jumped immediately to mind and a quick internet search didn't help much either. After a bit of pondering I came up with two solutions: the stat command and using information from the proc file system.
commandlinefu.com is the place to record those command-line gems that you return to again and again. Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
#2: Replacing same text in multiple files * Difficulty: Intermediate * Application: find/Perl If you have text you want to replace in multiple locations, there are several ways to do this. To replace the text Windows with Linux in all files in current directory called test[something] you can run this: perl -i -pe 's/Windows/Linux/
Hotwire is an object-oriented hypershell. It is a shell designed for systems programming (files, processes), and thus it is in the same conceptual category of software as the Unix shell+terminal and Windows PowerShell.
Cairo is a revolutionary desktop environment for Windows. Our goal is to develop a desktop experience that increases productivity and advances current technology standards. With a focus on stability, performance, and productivity, Cairo is sure to turn a
Lush is an object-oriented programming language designed for researchers, experimenters, and engineers interested in large-scale numerical and graphic applications. Lush is designed to be used in situations where one would want to combine the flexibility
Look at how to create scripts that are able to record their output, trap and identify errors, and recover from errors and problems so that they either run correctly or fail with a suitable error message and report. Building scripts and running them au