While editing I saved a file as file.p;l instead of file.pl. Now when I try to rename it this happens:

$ mv file.p;l /home/mc/file.pl
mv: missing destination file operand after 'file.p'
Try 'mv --help' for more information.

How can I rename filename in CLI?

  • Just use quotes: mv 'file.p;l' /home/mc/file.pl. – G-Man Says 'Reinstate Monica' Apr 17 '19 at 6:23
  • @G-man Gracias. That worked. – Guest Apr 17 '19 at 6:27
  • I agree my question is a duplicate. So this should be deleted. Answer clearly states "\'&|;()^`<>$, space, newline and tab are special in simple command lines when not quoted. – Guest Apr 17 '19 at 6:53

Just use quotes: mv "file.p;l" /home/mc/file.pl

  • Using a comment from someone else, copy-paste it to an own answer without attribution (and even without some formatting) on a question that is currently close-voted as duplicate is not very nice. – pLumo Apr 17 '19 at 7:32
  • 1
    @RoVo Using someone's comment in an answer is fair play. G-Man did not make a real answer out of it. This answer, however, lacks proper formatting and the explanation as to why it works. The explanation is in the answers to the dupe question, which makes this answer superfluous, unless it adds something novel. – Kusalananda Apr 17 '19 at 8:09
  • Fair enough, no explanation in my answer. The formatting of my answer is up to me - not you. If it was a more involved answer I would have formatted it. I actually just copied the OPs question and added dbl quotes. Pretty self explanatory. – Terry Wendt Apr 17 '19 at 8:17
  • @TerryWendt Sorry, but the formatting of questions and answers is up to whoever feels they can improve on them. See unix.stackexchange.com/help/editing – Kusalananda Apr 17 '19 at 8:21
  • Sorry, I just don't appreciate people that troll through posts harassing other people. And I don't like being called a thief. And I had no reason to attribute anything to anyone. – Terry Wendt Apr 17 '19 at 8:26

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