In 2023, you'll likely encounter Linux when applying for a job in the IT sector. This operating system has certainly become more beginner-friendly. However, you'll still need certain knowledge to solve common problems. Today, we'll cover how to copy and move files in Linux. This is essential knowledge for anyone looking to start DevOps courses / DevNet reviews in Baku . This is essential knowledge for finding employment in the field of programmable networks and systems in Azerbaijan.
How to copy files, DevOps courses / DevNet reviews Baku
First of all, let's understand how to copy files in Linux. The skills you learned working with the Microsoft Windows graphical interface won't help you here. This is because you'll be using the CLI ( Command Line Interface).
Therefore, to copy files through the terminal, you need to know the appropriate command and be able to use it—enter the correct options and arguments. All this is important to know before starting the best DevOps / DevNet courses in Baku.
To copy files in UNIX-like operating systems, including GNU/Linux operating systems , use the cp command (from " copy "). Let's say there's a source file named file1 in a directory that you want to make a copy of. You'll also want to keep it in the same folder in case the source file is deleted or overwritten. In this case, you'd enter the following at the command line:
- cp command and put a space;
- the name of the source file and put a space;
- name of the target file and press the key Enter.
If, instead of copying the source file with a new name to the same directory, you want to make a copy with the same name in a different folder, you need to specify the path to the destination directory instead of the target file name. It's worth noting that to copy directories with their contents, you should use the -r option (recursive copy).
The -i option allows you to copy all objects interactively (prompting for confirmation). The -f option, however , allows deletion of the target file. If it already exists, it cannot be overwritten directly. We recommend learning more about the options that will help you work with the cp command . To avoid difficulties while taking DevOps/DevNet courses (reviews in Baku ).
How to Move (Cut) Files in Linux
Another file operation similar to copying is moving. It differs from copying in that the source file disappears from its original folder and appears in the directory the user specified as the target. For this purpose, Linux and other UNIX-like operating systems use the mv command (from " move "). Mastering this command is essential for completing the DevOps / DevNet Engineer Baku courses.
It's worth noting that the mv command is very similar in syntax to the cp command . That is, you specify the source file as the first argument, and the target folder as the second argument. However, if you specify a different filename than the source folder instead of the target folder, the file will be renamed. However, it will remain in the original directory. This technique is the easiest way to rename files in Linux.
Of course, in the future, you'll need to learn how to copy files via SSH using the scp command . However, we'll cover that in a future article. In the meantime, let me know in the comments what difficulties you encountered when copying and moving files in Linux.
SEDICOMM University Team : Cisco Academy , Linux Professional Institute , Python Institute.

