In your quest to migrate to the Linux running technique, you’ve got discovered the command line interface a will have to-know skill. Fortunately, Jack Wallen is in this article to aid you with the fundamentals.
I’m heading to support you study a little bit much more about Linux. If you’re new to the operating technique, there are pretty a several fundamental tasks you might be going to require to know how to do. One these types of undertaking is renaming information and folders.
You might consider there’s a helpful rename command developed into the process. There is, but it can be not what you think. As an alternative of renaming a file or folder, you move it from one particular name to another, with the mv command. This undertaking couldn’t be any less complicated.
SEE: Linux: The 7 finest distributions for new end users (no cost PDF) (TechRepublic)
For occasion, if you have a file named script.sh and you want to rename it backup.sh. For that you would difficulty the command:
mv script.sh backup.sh
The initial file title is the original and the next is the new title–uncomplicated. For folders, it really is the similar factor. If you have a folder named “task” and you want to rename it “python_tasks.” For that, you would concern the command:
mv assignments python_assignments
One pleasant matter about the mv command (apart from its simplicity) is that it does keep the authentic directory characteristics, so you do not have to worry about reassigning things like permissions and ownership. Even if you situation the command with sudo privileges, it will never change the directory ownership to root.
Another handy aspect is that you will not have to leave the file in the very same directory. If you have script.sh in your dwelling listing and you want to rename it to “backup.sh” and shift it to /usr/nearby/bin/ at the exact time. The moment all over again, that is as straightforward as:
sudo mv script.sh /usr/neighborhood/bin/backup.sh
The rationale why you have to use sudo is mainly because the /usr/neighborhood/bin listing is owned by root, so your regular user would not have authorization to transfer the file into the directory.
And which is all there is to renaming documents and folders from the Linux command line. Delight in that new ability.
Subscribe to TechRepublic’s How To Make Tech Do the job on YouTube for all the most current tech tips for company pros from Jack Wallen.