Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Why doesn't cp have a progress bar like wget?

Lately I have been dealing with rather large files in Linux. I often use commands like sed, cut, sort, uniq, awk, and perl to slice, dice, and view the contents of these large files. I am usually unsure whether an operation like this will complete in seconds, hours, days, or "never".

Other platforms like Windows, Mac OS X, and the Internet, are quick to show the user a progress bar indicator to show how fast the work or upload is progressing, and maybe even tell how much time is left.

With most of the above examples, it is possible guesstimate the current progress by actively thinking about how exactly the command is modifying the file, and then checking the current size of the output on disk. Or maybe by watching the rate of change of the file size on disk. But with some commands like sort -d -u big_file > output_file it seems that there is no possible way to know whether the operation will be completed in one minute or one year.

Is this missing feature intentional? Is there a linux-way to do this? Is this need usually just obviated by smaller sized files?

Would a real haxor just intuitively know the progress of these operations by merely scanning values directly out of the .pid file?

share|improve this question

marked as duplicate by jasonwryan, Renan, Michael Mrozek Oct 8 '12 at 22:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 2 down vote accepted

It's against the UNIX ethos, yes. As a rule, Unix commands return no output on success; they only give output on error. This is good for automation; a script can treat any output from a command as an error report and log it or mail it to the sysadmin. This is how the cron daemon works.

Please remember that Unix is designed to be automated, not to have the sysadmin hovering over the console, watching everything that happens.

That said, many utilities have an equivalent of the -verbose (or -v or --verbose) flag, to give more output. rsync has the --progress flag, for instance. Still other tools will detect whether they are being used in an interactive session or a script and tailor output accordingly. Wget provides one kind of progress indicator for interactive sessions, another for scripts but can be silenced entirely.

There are also several utilities (e.g. bar, dbar, pv) which are designed to be used as pipes within data transfers and indicate progress. Add them in at need.

share|improve this answer

pv is your friend. Insert it wherever you want to see the progress.


pv big_file | sort ...
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.