Does using -v (verbose) slow commands down?
Yes, the -v flag slows down the command.
Most, if not all softwares(or commands) would check if a flag is provided, and then execute a bunch of code related to the flag. In case of the -v flag, they would likely execute a bunch of output commands(like echo
or printf
), which they rather would have skipped without the flag.
This means more instruction cycles for the processor and thus more execution time.
It is better if you don't use -v flag if you are not going to read/need the messages.
On the other hand, the CLI would/should be faster than GUI, assuming that you don't include time required to type the commands and pressing the Enter key.
From this blog of superuser this image explains the slowness very well
For the specific command in question, the results of the time command are
//with -v
real 0m8.753s
user 0m0.816s
sys 0m2.036s
//without -v
real 0m1.282s
user 0m0.124s
sys 0m1.092s
this was done with the directory containing 100000 empty files
Why not find out yourself: use time.
$ time rm -rfv dontDeleteMe && mkdir dontDeleteMe
real 0m0.003s
user 0m0.001s
sys 0m0.002s
$ time rm -rf dontDeleteMe && mkdir dontDeleteMe
real 0m0.002s
user 0m0.001s
sys 0m0.001s