Skip to main content

Fun tricks with VI

  • June 16, 2026
  • 5 comments
  • 51 views

Geoff Burke
Forum|alt.badge.img+22

Now that Veeam is solidly settled in Linux Land I thought it would be fun to occasionally post some useful tricks.

When it comes to command line editors, some folks like nano, some vi. 

I got used to vi.

If you want to run a command in vi and save the output in the file you can do it by typying bang bang while in command mode followed by your command. The output will be pasted into your file. 

!!cat/etc/os-release
Create my file
Lets grab the info and put in our file

BOOM!

I can save that file and keep it

 

I don’t know how often you will need to use it, but it beats copying and pasting back and forth.

On the cli itself !! runs the last command that you did.

 

 

 

5 comments

Chris.Childerhose
Forum|alt.badge.img+22

That is a fun trick as it is always useful to learn little things with Linux.


Very nice !! thanks . 
I discovered the « bang bang » !! command with your article. 
and then this web site (in French) very interesting with many  tips . https://www.n0tes.fr/2022/12/29/Bang-bang/
 


coolsport00
Forum|alt.badge.img+23
  • Veeam Legend
  • June 16, 2026

Nice CLI trick. Thanks for the tip Geoff!


kciolek
Forum|alt.badge.img+5
  • Influencer
  • June 16, 2026

thanks for the tip Geoff!


AndrePulia
Forum|alt.badge.img+9
  • Veeam Vanguard
  • June 16, 2026

I like using vi editor, but I didn’t know about !! command :-) thx Geoff.