9

I'm going through a video to learn about commands, and I noticed that when the guy inputs a command, most of them have the -v option by default, without him actually inputting -v in the command options.

He mentioned that he enabled "verbose", but I can't seem to find anything online that mentions what I'm looking for. I'm not sure if it is relevant, but I'm on a VM.

Video: https://www.youtube.com/watch?v=ZtqBQ68cfJc&t=5377s

How can I enable this verbose mode?

terdon
  • 100,812
LBB188
  • 93
  • 5

1 Answers1

27

You don't. While many commands do use -v for verbose, and this is a common idiom, it isn't a standard and many commands use it for something completely different. For example, the text search command grep uses -v for "negate the match". So while grep foo means "find lines matching foo, the command grep -v foo means "find lines that do not match foo".

So you really don't want to blindly add an option to a command unless you know that command uses the option to do what you think it does. Instead, what you can do is add aliases for the commands you actually want to use. To do that, for example for the command gzip which was mentioned in your video, you edit the file $HOME/.bashrc and add this line:

alias gzip='gzip -v'

Save the file, open a new terminal, and now all your gzip commands become gzip -v.

And, to find out what options a command has and what they do, you run man command. So, for grep, that would be man grep.

terdon
  • 100,812