Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, February 3, 2009

pv (Pipe Viewer) - a unix utility for monitoring the progress of data through a pipe

Just learned about Pipe Viewer from this blog post:
Pipe viewer is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.

Here is the example that Peteris provides. For long-running commands, it gives you a progress indicator so you won't be left wondering, "Should I go get lunch, or wait for the gzip to be finished?"

$ pv access.log | gzip > access.log.gz
611MB 0:00:11 [58.3MB/s] [=> ] 15% ETA 0:00:59

Sunday, February 1, 2009

If you installed any of the Ubuntu flavors (Ubuntu - default with the Gnome environment, Xubuntu - a flavor that uses the Xfce desktop environment, or Kubuntu - a flavor that uses the KDE desktop environment), you can switch between them without their respective install CD's by installing the right set of packages.

I recently ran into this because I used wubi to install Kubuntu, but found that KDE was a bit "busy" for my liking. (I have a short attention span, having more things on the desktop ended up being distracting for me.)

To install Ubuntu desktop:
sudo apt-get install ubuntu-desktop

To install Xubuntu desktop:

sudo apt-get install xubuntu-desktop

To install Kubuntu desktop:

sudo apt-get install kubuntu-desktop

If you're settled with switching from one environment to the other and would like to remove all the packages from the one that you no longer use (for example, xubuntu-desktop), do the following:

sudo apt-get remove xubuntu-desktop
sudo apt-get autoremove

Tuesday, October 21, 2008

rsync: Be mindful of the trailing slash!

Pop Quiz: What's the difference between these two commands?

#1: rsync -a --delete /some/path/a/ /some/otherpath/
#2: rsync -a --delete /some/path/a /some/otherpath/


Answer: the first will make /some/otherpath mirror the contents of /some/path/a, while the latter will create a directory in /some/otherpath/a whose contents will mirror /some/path/a.

Be warned! If you're not careful and you use #1 when you intend to use #2, you can lose files in /some/otherpath.

Edit: Found this resource online: Rsync explanations and recommendations