![]() So if you attempt to copy a directory like this: cp. How to copy directories with the cp commandīy default, the cp command works with files. DirectoryA_2Īs you can see, you will put all the source files first, and the last argument will be the destination. If you want to copy more than a file from DirectoryA_1 to DirectoryA_2, you will use the cp command like this: cp. DirectoryA_1/README.txt is the source file If you want to copy a file, say README.txt from DirectoryA_1 to DirectoryA_2, you will use the cp command like this: cp. I'll also assume you're currently in the DirectoryA location in the terminal, so if you aren't, make sure you are: cd DirectoryA These subdirectories have many files and sub directories in them. ![]() ![]() Let's say a directory called DirectoryA has two directories in it: DirectoryA_1 and DirectoryA_2. To understand the rest of this article, I will use this folder structure example. And the argument specifies the location you want to copy the file to. specifies the sources of the files or directories you want to copy. This command can also copy directories (folders). You use the cp command for copying files from one location to another. In this article, I'll explain what the cp command is and show you how to copy and paste files and directories in Linux using the terminal. In a Linux-based terminal, you do this using the cp command. You can copy files by right-clicking on the file and selecting "Copy", then going to a different directory and selecting "Paste".įor my terminal friends, you can also perform file copy-paste operations without leaving the terminal. If you spend more time in the user interface of your device, you'll probably use your mouse to do this. There are a couple different ways to copy and paste content when you're working on your computer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |