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
Need to monitor Linux server performance? Try these built-in command and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a performance problem. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as: Finding out bottlenecks. Disk (storage) bottlenecks. CPU and memory bottlenecks. Network bottlenecks.
To perform a remote backup, you may perform following tar/ssh command to execute it. For our illustration, let's make a backup of users' home directories located in /home partition. % (cd /home
The wheel group is, perhaps, not widely used today, or is seen as “archaic” and irrelevant. Nothing could be further from the truth. The wheel group is a group which limits the number of people who are able to su to root. This usually consists of a group named “wheel” and a set of users that are permitted to use the utility ’su’ in order to change to root.
The computer world is notorious for its obsession with what is new - largely thanks to the relentless engine of Moore's Law that endlessly presents programmers with more powerful machines. Given such permanent change, anything that survives for more than one generation of processors deserves a nod. Think then what the Unix operating system deserves because in August 2009, it celebrates its 40th anniversary. And it has been in use every year of those four decades and today is getting more attention than ever before.
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.
Have you ever wondered why you get the errors Execute permission denied or The parameter list is too long? These are just a few of the common errors UNIX and Linux novices receive that they may not know how to avoid. This article explains such errors and provides workarounds and resolutions to these and other errors that may crop up.
Named Pipes... or how to get two separate applications to interact Recently, I've been working on an application (bash based) that could gather some information that I need from a host (network interfaces configuration, arp neighborgs, routing policy, pinging some other hosts, etc). Then I wondered that it would be good if I were able to connect to some hosts through SSH and run some commands on those hosts and save the output of those commands as part of the information of the first host. Like an information gatherer of sorts.
Create an iso image from the contents of a directory: mkisofs -hide-joliet-trans-tbl -l -J -f -T -r . > "../directory_dump_`basename $PWD`.iso" When run in a directory (say tmp) it will create a file called directory_dump_tmp.iso one directory higher, which will contain the contents of the tmp directory in it's root.
AquaMon is a network transparent system monitoring app. You can use it for at-a-glance viewing of system stats such as network read/writes, free disk space, and virtual memory/processor performance.
#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/
If you like to monitor your system using age-old command line tools like uptime and top, you want the free GeekTool on your Mac. Today we'll cover how to automatically embed command output, text files and even monitoring images - like web site traffic cha
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.