Yes, you can rename files in different directories using the mv command by specifying the full path of the source file and the desired new path for the renamed file.
Here’s the syntax:
mv /path/to/old_directory/old_filename /path/to/new_directory/new_filename
For example, if you want to rename file1.txt located in /home/user/documents to file2.txt in /home/user/desktop, you would use:
mv /home/user/documents/file1.txt /home/user/desktop/file2.txt
This command moves (renames) file1.txt to file2.txt in the specified new directory.
Make sure you have the necessary permissions to access both directories. If you have any more questions, feel free to ask!
