0

I was trying to change the name of my portable HDD from terminal. usually the rename command is used or sometimes mv.

I am getting this error.

/media/dishank$ rename virus\ BOX/ virus_box virus\ BOX/
Search pattern not terminated at (eval 1) line 1.
2
  • What is the name of your device here virus\ BOX/ virus_box virus\ BOX/ and what is the new name there? Dec 26 '14 at 17:45
  • Name of my media device is virus BOX/. And i want to change it to virus_box/. Dec 26 '14 at 17:47
2

I followed following steps:

  1. Need to find the path of media device. mine was /dev/sdc1 (use Gparted to find)
  2. unmount the partition (do not disconnect it physically). ex: sudo umount /dev/sdc1
  3. mine is ntfs so. sudo ntfslabel /dev/sdc1 virus_box and mount back your device.
  4. verify changes through sudo blkid

All is done.

For more info link

2

man -k label | grep -E 'file|volume'

should print the names of a few relevant shell commands.
Check out the man pages.
You will probably need to prepended with sudo as you attempt to run any of them.

NOTE:
rename - renames multiple files
rm - remove files or directories
mv - move files

4
  • I did used sudo too. It not worked. Dec 26 '14 at 17:21
  • What should i fill in device section.?? >Hannu Dec 26 '14 at 17:44
  • I see that you found out. As you did not have file system type nor other info in your initial question, I could not help you there.
    – Hannu
    Dec 26 '14 at 21:28
  • Next time i will keep that in my mind while asking question. But, thanks for helping. Peace. Jan 11 '15 at 13:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.