{"id":29433,"date":"2023-11-23T11:39:00","date_gmt":"2023-11-23T10:39:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=29433"},"modified":"2023-11-23T18:45:43","modified_gmt":"2023-11-23T17:45:43","slug":"how-to-copy-files-and-folders-in-linux","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/","title":{"rendered":"How to copy files and folders in Linux ?"},"content":{"rendered":"\n<p>Copying files and folders in linux bash scripts is a fundamental task in any operating system. In Linux, this can be efficiently done using the Bash shell and the cp command. This tutorial provides a n overview with examples on how to use the cp command in various scenarios, ensuring a clear and concise understanding for users of all levels.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#understanding-the-linux-cp-command\" >Understanding the linux cp Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#basic-file-copy-with-linux\" >Basic file copy with Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#copying-a-single-file-with-on-linux\" >Copying a Single File with on linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#rename-linux-files-during-the-copy\" >Rename linux files during the copy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#copy-multiple-linux-files\" >Copy multiple linux files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#recursive-copy-of-files-and-directories-in-linux\" >Recursive copy of files and directories in linux<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#advanced-copy-options\" >Advanced copy options<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#verify-copy-integrity\" >Verify copy integrity<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#prompt-overwrite-during-files-copy\" >Prompt overwrite during files copy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#copy-and-prevent-overwriting\" >Copy and prevent overwriting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#preserving-linux-file-attributes\" >Preserving linux file attributes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#using-wildcards-for-pattern-matching\" >Using Wildcards for Pattern Matching<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#use-advanced-linux-options-for-effective-copy\" >Use advanced linux options for effective copy<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-understanding-the-linux-cp-command\"><span class=\"ez-toc-section\" id=\"understanding-the-linux-cp-command\"><\/span>Understanding the linux cp Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The cp command is the primary method for copying files and directories in Linux. It&#8217;s included in the <a href=\"https:\/\/www.gnu.org\/distros\/distros.html\" target=\"_blank\" rel=\"noreferrer noopener\">GNU<\/a> core utilities package, making it available in virtually all Linux distributions. This is a sample generic command to understand how the copy command works.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp [option] [source] [destination]<\/pre>\n\n\n\n<p>This command copies files or directories from the source to the destination. The <em>[option] <\/em>parameter is optional and allows for additional functionality, which will be discussed in the following sections.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-basic-file-copy-with-linux\"><span class=\"ez-toc-section\" id=\"basic-file-copy-with-linux\"><\/span>Basic file copy with Linux <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-copying-a-single-file-with-on-linux\"><span class=\"ez-toc-section\" id=\"copying-a-single-file-with-on-linux\"><\/span>Copying a Single File with on linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To copy a single file, specify the source file and the destination directory or file. If the destination file name is omitted, cp creates a file with the same name as the source file in the specified directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp source_file.txt \/path\/to\/destination\/directory\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-rename-linux-files-during-the-copy\"><span class=\"ez-toc-section\" id=\"rename-linux-files-during-the-copy\"><\/span>Rename linux files during the copy<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To copy and rename a file in one single step, it is easy, <strong>simply specify a new file name at the destination<\/strong>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp source_file.txt \/path\/to\/destination\/new_file_name.txt\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-copy-multiple-linux-files\"><span class=\"ez-toc-section\" id=\"copy-multiple-linux-files\"><\/span>Copy multiple linux files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can copy multiple files to a single destination directory by specifying each source file, separated by spaces.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp file1.txt file2.txt \/path\/to\/destination\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-recursive-copy-of-files-and-directories-in-linux\"><span class=\"ez-toc-section\" id=\"recursive-copy-of-files-and-directories-in-linux\"><\/span>Recursive copy of files and directories in linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To copy entire directories, including all subdirectories and files, use the <code>-r<\/code> or <code>--recursive<\/code> option. It is also a straight forward copy.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp -r \/path\/to\/source\/directory\/ \/path\/to\/destination\/directory\/\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-advanced-copy-options\"><span class=\"ez-toc-section\" id=\"advanced-copy-options\"><\/span>Advanced copy options<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The previous section of the tutorial explained how to copy files and folders using simple linux bash options. Now let&#8217;s dive in more advanced scripts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-verify-copy-integrity\"><span class=\"ez-toc-section\" id=\"verify-copy-integrity\"><\/span>Verify copy integrity<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Use the <code>-v<\/code> option to verify that files are copied correctly.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp -v source_file.txt \/path\/to\/destination\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-prompt-overwrite-during-files-copy\"><span class=\"ez-toc-section\" id=\"prompt-overwrite-during-files-copy\"><\/span>Prompt overwrite during files copy<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>By default, cp will overwrite files without warning. This behaviour can be dangerous in some cases. To enable a prompt before overwriting, use the -i option.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp -i source_file.txt \/path\/to\/destination\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-copy-and-prevent-overwriting\"><span class=\"ez-toc-section\" id=\"copy-and-prevent-overwriting\"><\/span>Copy and prevent overwriting<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To prevent completely the cp command from overwriting existing files, use the -n option.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp -n source_file.txt \/path\/to\/destination\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-preserving-linux-file-attributes\"><span class=\"ez-toc-section\" id=\"preserving-linux-file-attributes\"><\/span>Preserving linux file attributes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To preserve the file attributes such as timestamp and permissions, use the -p option. It will prevent for example to have a creation date equal to the date the file was copied. <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp -p source_file.txt \/path\/to\/destination\/\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-using-wildcards-for-pattern-matching\"><span class=\"ez-toc-section\" id=\"using-wildcards-for-pattern-matching\"><\/span>Using Wildcards for Pattern Matching<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Wildcards can be used to copy multiple files that match a specific pattern. As we previously saw this <a href=\"https:\/\/expert-only.com\/en\/ms-dos\/copy-windows-files-with-cmd\/\"><strong>copy and filter option in the MS-DOS file system<\/strong><\/a>, it is extremely powerful to filter and copy only a specific extension type, like for example: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>txt<\/li>\n\n\n\n<li>csv<\/li>\n\n\n\n<li>xml<\/li>\n\n\n\n<li>html<\/li>\n<\/ul>\n\n\n\n<p>Indeed, this wildcard option combined with the recursive copy can help a lot when sorting and copying a large number of files in multiple folder levels.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bash\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cp \/path\/to\/source\/*.txt \/path\/to\/destination\/\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-use-advanced-linux-options-for-effective-copy\"><span class=\"ez-toc-section\" id=\"use-advanced-linux-options-for-effective-copy\"><\/span>Use advanced linux options for effective copy<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This guide covers the basics and some advanced examples on how to copy files and folders using linux bash. Whether you are copying single files, entire directories, or using advanced options for specific requirements, understanding and using these commands will enhance your skills in Linux file management.<\/p>\n\n\n\n<p>For further information and support on <strong>Linux distributions where these copy commands are applicable<\/strong>, you can visit the official websites of popular distributions like these ones: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/ubuntu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/getfedora.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fedora<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.debian.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Debian<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.opensuse.org\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">openSUSE<\/a><\/li>\n\n\n\n<li>CentOS<\/li>\n\n\n\n<li>Arch Linux<\/li>\n\n\n\n<li>Linux Mint<\/li>\n\n\n\n<li>and Manjaro.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Copying files and folders in linux bash scripts is a fundamental task in any operating system. In Linux, this can be efficiently done using the Bash shell and the cp command. This tutorial provides a n overview with examples <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\" title=\"How to copy files and folders in Linux ?\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":10619,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[691],"tags":[],"class_list":{"0":"post-29433","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-linux"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to copy files and folders in Linux ? Linux Bash Scripting<\/title>\n<meta name=\"description\" content=\"To copy files and folders with linux, use bash scripts with useful options like: recursive, wildcard and overwriting copy for example.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to copy files and folders in Linux ?\" \/>\n<meta property=\"og:description\" content=\"To copy files and folders with linux, use bash scripts with useful options like: recursive, wildcard and overwriting copy for example.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-23T10:39:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-23T17:45:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"How to copy files and folders in Linux ?\",\"datePublished\":\"2023-11-23T10:39:00+00:00\",\"dateModified\":\"2023-11-23T17:45:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\"},\"wordCount\":571,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg\",\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\",\"url\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\",\"name\":\"How to copy files and folders in Linux ? Linux Bash Scripting\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg\",\"datePublished\":\"2023-11-23T10:39:00+00:00\",\"dateModified\":\"2023-11-23T17:45:43+00:00\",\"description\":\"To copy files and folders with linux, use bash scripts with useful options like: recursive, wildcard and overwriting copy for example.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to copy files and folders in Linux ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to copy files and folders in Linux ? Linux Bash Scripting","description":"To copy files and folders with linux, use bash scripts with useful options like: recursive, wildcard and overwriting copy for example.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to copy files and folders in Linux ?","og_description":"To copy files and folders with linux, use bash scripts with useful options like: recursive, wildcard and overwriting copy for example.","og_url":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2023-11-23T10:39:00+00:00","article_modified_time":"2023-11-23T17:45:43+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"How to copy files and folders in Linux ?","datePublished":"2023-11-23T10:39:00+00:00","dateModified":"2023-11-23T17:45:43+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/"},"wordCount":571,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg","articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/","url":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/","name":"How to copy files and folders in Linux ? Linux Bash Scripting","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg","datePublished":"2023-11-23T10:39:00+00:00","dateModified":"2023-11-23T17:45:43+00:00","description":"To copy files and folders with linux, use bash scripts with useful options like: recursive, wildcard and overwriting copy for example.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/digitization-FD44BBF7CF9_1920x1080.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/linux\/how-to-copy-files-and-folders-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to copy files and folders in Linux ?"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/29433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=29433"}],"version-history":[{"count":15,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/29433\/revisions"}],"predecessor-version":[{"id":29450,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/29433\/revisions\/29450"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/10619"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=29433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=29433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=29433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}