How to rename a file in Terminal? [duplicate]
I have:
/home/user/my_static/home/user/static/
How do I rename my_static to static and remove static(2)?
2 Answers
Use:
mv "old location" "new location"
mv /home/user/my_static /home/user/staticThat command is used for moving and renaming files and directories.
2A simple way to rename files and folders is with the mv command (shortened from “move”). Its primary purpose is moving files and folders, but it can also rename them since the act of renaming a file is interpreted by the filesystem as moving it from one name to another.
The syntax is:
mv (option) file1.ext file2.extwhere “file1.ext” is the “old” name of the file, and “file2.ext” the new name.
And to remove, you can use the command:
rm -f filenameHope that helped.
0