On 13/10/26 at 20:06, nwe wrote:
On 10/13/26 12:54 PM, Franco Martelli wrote:

both commands do the same thing. Which ones is it better to propose to an end user? For others nice examples please see "man pv".

nwe@debian13:~$ man pv
No manual entry for pv
nwe@debian13:~$ sudo pv
sudo: pv: command not found

dd never did that to me...

Maybe just a matter of preference. I like to depend on utilities that are already installed.

OK those are your preferences, however don't blindly run a program with "sudo" to verify that exist, this is a bad habit, you can:

1. use "which" to see whether a command is in the $PATH (recommended)

~$ sudo which bogus
(no output)
~$ sudo which pv
/usr/bin/pv

2. check if the command is installed:

~$ dpkg --search *bogus
dpkg-query: no path found matching pattern *bogus
~$ dpkg --search *pv
pv: /usr/bin/pv
pv: /usr/share/doc/pv
bash-completion: /usr/share/bash-completion/completions/pv

3. if you really, really want to run the command, at least take the habit to run it with a switch such as "--help" or "--version". But this is deprecable however.

Kind regards,
--
Franco Martelli

Reply via email to