I open a text file using vi editor in linux and want to insert date command output without exiting vi editor. What is the trick?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Is this what you mean?
or to add one week to the current date:
:r !date -d “today 1 week”
Also see this post: https://stackoverflow.com/questions/56052/best-way-to-insert-timestamp-in-vim