Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

MV --suffix Not Working

Avatar of Thomas Grassi
Thomas GrassiFlag for United States of America asked on
17 Comments1 Solution79 ViewsLast Modified:
Ubuntu 16.04.1

I run Nagios on this server.

I have a directory that contains .cfg files

I would like to move those .cfg files to and archive directory  

Tying to use the mv command and add a suffix to the end of the files.


today=$(date +%Y-%m-%d)

mv -v -b --suffix=.'today'-TG *.cfg archive

 root@tgcs017:/usr/local/nagios/etc/objects/desktops# ./update.sh
'TGKW001.cfg' -> 'archive/TGKW001.cfg'
'TGKW003.cfg' -> 'archive/TGKW003.cfg'
'TGKW004.cfg' -> 'archive/TGKW004.cfg'
'TGKW005.cfg' -> 'archive/TGKW005.cfg'
'TGKW006.cfg' -> 'archive/TGKW006.cfg'
'TGKW007-10.cfg' -> 'archive/TGKW007-10.cfg'
'TGKW008-10.cfg' -> 'archive/TGKW008-10.cfg'
'TGKW009.cfg' -> 'archive/TGKW009.cfg'
'TGKW012.cfg' -> 'archive/TGKW012.cfg'

the script is simple and it runs it moves the files but never adds the suffix.

Any ideas?

Thank you
Avatar of noci
nociSoftware Engineer
This problem has been solved!
Unlock 1 Answer and 17 Comments.
See Answers