Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've this file I just downloaded with the name 최고다 이순신.E39.130720.HDTV.XViD-HANrel.avi, and I've the subtitle file You're.the.Best.Lee.Soon.Shin.E39.130720.HDTV.H264.720p-KOR.srt.

How can I rename the video file (in command line) with the same name as the subtitle file?

You're.the.Best.Lee.Soon.Shin.E39.130720.HDTV.H264.720p-KOR.avi

You're.the.Best.Lee.Soon.Shin.E39.130720.HDTV.H264.720p-KOR.srt

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I hope someone has a better solution, but here's what I would do:

  1. In the directory in which the file resides, do ls -li and get the inode number of the file -- it shall be listed in the first column of the output.
  2. In the same directory, execute: find . -maxdepth 1 -inum 1234567 -exec mv {} new-name-of-file.blah \; substituting the 1234567 for your file's inode number, and the new-name-of-file.blah with the new name that you want to give.

Note that the \; part of the find command is necessary to signify the end of the command.

share|improve this answer
    
Great answer. Easy to understand for me. Thanks –  Kiddo Aug 2 '13 at 7:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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