🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 167 (from laksa149)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

đź“„
INDEXABLE
âś…
CRAWLED
4 days ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.1 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://beebom.com/how-copy-files-linux/
Last Crawled2026-04-07 08:06:33 (4 days ago)
First Indexed2023-07-01 09:30:20 (2 years ago)
HTTP Status Code200
Meta TitleHow to Copy Files in Linux (2 Ways) | Beebom
Meta DescriptionCopying files is a basic operation an operating system should be able to do, and Linux is capable. Let's look at how to copy files in Linux.
Meta Canonicalnull
Boilerpipe Text
Learning file management in Linux is the key to efficient workflow. One of the most basic tasks that you would need to learn as a Linux beginner is copying files. Terminal is your friend in Linux and it can be used to most even the simplest of tasks quickly. As a beginner, if you’re struggling with copying files, here’s a tutorial with two different methods detailing how to copy files in Linux. How to Copy Files in Linux Using Terminal Copying files in Linux via the terminal is simple enough. All you need to do is use the “cp” command followed by two directories — one containing the file with the file name and the other where you want the file to be copied. cp stands for copy and this is the easiest Linux command to copy files from one location to another. Here’s the syntax for cp command in Linux: cp /path/to/file /path/to/destination Here’s an example where we copy the file Beebom.txt in the /Desktop directory to /Downloads. cp /home/abubakarmohammed/Desktop/Beebom.txt /home/abubakarmohammed/Downloads In the above example, we copied Beebom.txt which was in the Desktop directory to the Downloads directory. If you have a file in a directory different than what you’re currently in and want to copy the same in the current directory you’d need to specify the path to the directory with the file and just the name of the directory you want to copy the file in. For copying a file from a different directory to the current directory, use this syntax: cp /path/to/file ./directory For example, let’s copy Beebom.txt to a directory called /example_directory. cp /home/abubakarmohammed/Desktop/Beebom.txt ./example_directory 1. Copy Multiple Files into a Directory using cp Command There are two ways to go about this — by mentioning every file in cp and moving them to a directory, or by using a Regex-like method to copy files with similar extensions to a directory. Here’s the syntax. cp /path/to/file path/to/file2 /directory Here’s an example to copy multiple files in a directory one by one. Using the below command, we’re moving the files Beebom.txt and Beebom1.desktop to /example_directory. cp /home/abubakarmohammed/Desktop/Beebom.txt /home/abubakarmohammed/Desktop/Beebom1.desktop ./example_directory 2. Copy Files with Matching Extensions using cp Command To copy files of similar extensions in Linux, the syntax would be: cp /path/to/file/*.txt ./directory This example will copy every .txt file from Desktop into the example_directory. cp /home/abubakarmohammed/Desktop.*.txt ./example_directory 2. Copy a Directory into Another Directory using cp Command To copy a directory into another directory in Linux, you’d need to use the “-r” identifier. This lets the cp command know that you intend to copy a directory into another. Here’s the syntax: cp -r ./path/to/directory ./directory A real-time example of the command would be: cp -r ./home/abubakarmohammed/Desktop/beebom ./example_directory How to Copy Files in Linux using GUI Like on Windows, most distros ship with their own file managers and shortcuts to copy/paste by dragging/dropping files and folders. For example, Nautilus is a files app that ships with distros that use GNOME, and Dolphin ships with KDE distributions, both support dragging and dropping files and copy/paste. If you’re new to Linux and don’t find Terminal that appealing, they’re your best bet. Here’s how to copy files using Nautilus. 1. Launch Nautilus > go to the file directory > right-click on the file. 2. Clicking Copy will copy the file whereas clicking Copy to will open another Nautilus pop-up window where you can choose where you want to copy the file to. 3. Click on a directory where you want to copy the file and then click Select at the top-right corner. That’s as simple as it gets. Beebom Staff Bringing the latest in technology, gaming, and entertainment is our superhero team of staff writers. They have a keen eye for latest stories, happenings, and even memes for tech enthusiasts.
Markdown
Skip to content [Beebom](https://beebom.com/) - [News](https://beebom.com/category/news/) - [Opinions](https://beebom.com/tag/opinion/) - [Reviews](https://beebom.com/category/reviews/) - [Gaming](https://beebom.com/category/games/) - [Roblox](https://beebom.com/tag/roblox/) - [Roblox Codes](https://beebom.com/tag/roblox-codes/) - [Puzzle Games](https://beebom.com/puzzle/) - [GTA](https://beebom.com/tag/gta/) - [Minecraft](https://beebom.com/tag/minecraft/) - [Genshin Impact](https://beebom.com/tag/genshin-impact/) - [Honkai Star Rail](https://beebom.com/tag/honkai-star-rail/) - [Fortnite](https://beebom.com/tag/fortnite/) - [Tech](https://beebom.com/category/tech/) - [Instagram](https://beebom.com/tag/instagram/) - [WhatsApp](https://beebom.com/tag/whatsapp/) - [Meta](https://beebom.com/tag/meta/) - [Discord](https://beebom.com/tag/discord/) - [Snapchat](https://beebom.com/tag/snapchat/) - [Spotify](https://beebom.com/tag/spotify/) - [Apple](https://beebom.com/tag/apple/) - [AI](https://beebom.com/tag/ai/) - [Android](https://beebom.com/tag/android/) - [App](https://beebom.com/tag/app/) - [Entertainment](https://beebom.com/category/entertainment/) - [Netflix](https://beebom.com/tag/netflix/) - [DC](https://beebom.com/tag/dc/) - [Marvel](https://beebom.com/tag/marvel/) - [Anime](https://beebom.com/tag/anime/) - [One Piece](https://beebom.com/tag/one-piece/) - [Disney](https://beebom.com/tag/disney/) - [Beebom Gadgets](https://gadgets.beebom.com/) [Beebom Gadgets](https://gadgets.beebom.com/) Search For : Search Results Load More - [News](https://beebom.com/category/news/) - [Opinions](https://beebom.com/tag/opinion/) - [Reviews](https://beebom.com/category/reviews/) - [Gaming](https://beebom.com/category/games/) - [Roblox](https://beebom.com/tag/roblox/) - [Roblox Codes](https://beebom.com/tag/roblox-codes/) - [Puzzle Games](https://beebom.com/puzzle/) - [GTA](https://beebom.com/tag/gta/) - [Minecraft](https://beebom.com/tag/minecraft/) - [Genshin Impact](https://beebom.com/tag/genshin-impact/) - [Honkai Star Rail](https://beebom.com/tag/honkai-star-rail/) - [Fortnite](https://beebom.com/tag/fortnite/) - [Tech](https://beebom.com/category/tech/) - [Instagram](https://beebom.com/tag/instagram/) - [WhatsApp](https://beebom.com/tag/whatsapp/) - [Meta](https://beebom.com/tag/meta/) - [Discord](https://beebom.com/tag/discord/) - [Snapchat](https://beebom.com/tag/snapchat/) - [Spotify](https://beebom.com/tag/spotify/) - [Apple](https://beebom.com/tag/apple/) - [AI](https://beebom.com/tag/ai/) - [Android](https://beebom.com/tag/android/) - [App](https://beebom.com/tag/app/) - [Entertainment](https://beebom.com/category/entertainment/) - [Netflix](https://beebom.com/tag/netflix/) - [DC](https://beebom.com/tag/dc/) - [Marvel](https://beebom.com/tag/marvel/) - [Anime](https://beebom.com/tag/anime/) - [One Piece](https://beebom.com/tag/one-piece/) - [Disney](https://beebom.com/tag/disney/) - [Beebom Gadgets](https://gadgets.beebom.com/) No results found [Home](https://beebom.com/) \> [Tech](https://beebom.com/category/tech/) \> How to Copy Files in Linux (2 Ways) # How to Copy Files in Linux (2 Ways) [![Portrait of Beebom Staff](https://secure.gravatar.com/avatar/88f09cba9de8e068a82d0247a49a0039323375b287a39234e6e6b53a09ba7c92?s=32&d=mm&r=g) Beebom Staff](https://beebom.com/author/staff/) Updated: October 15, 2025 [Comments 0](https://beebom.com/how-copy-files-linux/#comments-497072) Share Copied Learning file management in Linux is the key to efficient workflow. One of the most basic tasks that you would need to learn as a Linux beginner is copying files. Terminal is your friend in Linux and it can be used to most even the simplest of tasks quickly. As a beginner, if you’re struggling with copying files, here’s a tutorial with two different methods detailing how to copy files in Linux. ## How to Copy Files in Linux Using Terminal Copying files in Linux via the terminal is simple enough. All you need to do is use the “cp” command followed by two directories — one containing the file with the file name and the other where you want the file to be copied. cp stands for copy and this is the easiest Linux command to copy files from one location to another. Here’s the syntax for cp command in Linux: ``` cp /path/to/file /path/to/destination ``` Here’s an example where we copy the file Beebom.txt in the /Desktop directory to /Downloads. ``` cp /home/abubakarmohammed/Desktop/Beebom.txt /home/abubakarmohammed/Downloads ``` ![Copying files in Linux using cp command](https://static.beebom.com/wp-content/uploads/2023/06/Copying-a-file-to-another-direct-1.jpg?w=640) In the above example, we copied Beebom.txt which was in the Desktop directory to the Downloads directory. If you have a file in a directory different than what you’re currently in and want to copy the same in the current directory you’d need to **specify the path** to the directory with the file and just the name of the directory you want to copy the file in. For copying a file from a different directory to the current directory, use this syntax: ``` cp /path/to/file ./directory ``` For example, let’s copy Beebom.txt to a directory called /example\_directory. ``` cp /home/abubakarmohammed/Desktop/Beebom.txt ./example_directory ``` ### 1\. Copy Multiple Files into a Directory using cp Command There are two ways to go about this — by mentioning every file in cp and moving them to a directory, or by using a Regex-like method to copy files with similar extensions to a directory. Here’s the syntax. ``` cp /path/to/file path/to/file2 /directory ``` Here’s an example to copy multiple files in a directory one by one. Using the below command, we’re moving the files Beebom.txt and Beebom1.desktop to /example\_directory. ``` cp /home/abubakarmohammed/Desktop/Beebom.txt /home/abubakarmohammed/Desktop/Beebom1.desktop ./example_directory ``` ![Copying multiple files in Linux using cp command](https://static.beebom.com/wp-content/uploads/2023/06/copying-multiple-files-in-Linux.jpg?w=640) ### 2\. Copy Files with Matching Extensions using cp Command To copy files of similar extensions in Linux, the syntax would be: ``` cp /path/to/file/*.txt ./directory ``` This example will copy every .txt file from Desktop into the example\_directory. ``` cp /home/abubakarmohammed/Desktop.*.txt ./example_directory ``` ![How to Copy Files in Linux (2 Ways)](https://static.beebom.com/wp-content/uploads/2023/07/copy-files-with-matching-extensions-in-Linux.jpg?w=640) ### 2\. Copy a Directory into Another Directory using cp Command To copy a directory into another directory in Linux, you’d need to use the “-r” identifier. This lets the cp command know that you intend to copy a directory into another. Here’s the syntax: ``` cp -r ./path/to/directory ./directory ``` A real-time example of the command would be: ``` cp -r ./home/abubakarmohammed/Desktop/beebom ./example_directory ``` ![Copying a directory into another directory using cp command](https://static.beebom.com/wp-content/uploads/2023/06/Copy-directory-to-another-direct.jpg?w=640) ## How to Copy Files in Linux using GUI Like on Windows, most distros ship with their own file managers and shortcuts to copy/paste by dragging/dropping files and folders. For example, Nautilus is a files app that ships with distros that use GNOME, and Dolphin ships with KDE distributions, both support dragging and dropping files and copy/paste. If you’re new to Linux and don’t find Terminal that appealing, they’re your best bet. Here’s how to copy files using Nautilus. 1\. Launch Nautilus \> go to the file directory \> right-click on the file. ![Copy to in nautilus](https://static.beebom.com/wp-content/uploads/2023/06/Copy-to-in-nautilus.png?w=1024) 2\. Clicking Copy will copy the file whereas clicking Copy to will open another Nautilus pop-up window where you can choose where you want to copy the file to. ![Copy to pop up nautilus](https://static.beebom.com/wp-content/uploads/2023/06/Copt-to-pop-up-nautilus.png?w=1024) 3\. Click on a directory where you want to copy the file and then click Select at the top-right corner. That’s as simple as it gets. ![Portrait of Beebom Staff](https://secure.gravatar.com/avatar/88f09cba9de8e068a82d0247a49a0039323375b287a39234e6e6b53a09ba7c92?s=200&d=mm&r=g) Beebom Staff Bringing the latest in technology, gaming, and entertainment is our superhero team of staff writers. They have a keen eye for latest stories, happenings, and even memes for tech enthusiasts. Comments 0 Leave a Reply Cancel reply Loading comments... *** Recommended Articles [![DeepSeek vs ChatGPT: The Ultimate AI Comparison for 2026](https://static.beebom.com/wp-content/uploads/2026/03/deepseek-vs-chatgpt-comparison.jpg?w=300&quality=75)](https://beebom.com/deepseek-vs-chatgpt/) [DeepSeek vs ChatGPT: The Ultimate AI Comparison for 2026](https://beebom.com/deepseek-vs-chatgpt/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha [![How to Set the PATH Variable in Linux (2 Ways)](https://static.beebom.com/wp-content/uploads/2023/06/how-to-set-the-PATH-variable-in-Linux.png?w=300&quality=75)](https://beebom.com/how-set-path-variable-linux/) [How to Set the PATH Variable in Linux (2 Ways)](https://beebom.com/how-set-path-variable-linux/) ![Portrait of Beebom Staff](https://secure.gravatar.com/avatar/88f09cba9de8e068a82d0247a49a0039323375b287a39234e6e6b53a09ba7c92?s=24&d=mm&r=g) Beebom Staff [![I Tested Wispr Flow AI Dictation App and It Transcribes My Voice Faster than I Can Type](https://static.beebom.com/wp-content/uploads/2026/02/wispr-flow-on-mac.jpg?w=300&quality=75)](https://beebom.com/wispr-flow-ai-dictation-app-transcribes-voice-faster-than-typing/) [I Tested Wispr Flow AI Dictation App and It Transcribes My Voice Faster than I Can Type](https://beebom.com/wispr-flow-ai-dictation-app-transcribes-voice-faster-than-typing/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha [![Nano Banana 2 vs Nano Banana Pro Comparison: Bigger Isn't Always Better](https://static.beebom.com/wp-content/uploads/2025/09/google-brings-its-viral-nano-banana-image-generator-to-X.jpg?w=300&quality=75)](https://beebom.com/nano-banana-2-vs-nano-banana-pro-comparison/) [Nano Banana 2 vs Nano Banana Pro Comparison: Bigger Isn't Always Better](https://beebom.com/nano-banana-2-vs-nano-banana-pro-comparison/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha [![Wondershare Relumi: The AI Photo Retake App That Lets You Recreate Moments](https://static.beebom.com/wp-content/uploads/2026/03/wondershare-relumi-ai-photo-retake-app.jpg?w=300&quality=75)](https://beebom.com/wondershare-relumi-ai-photo-retake-app/) [Wondershare Relumi: The AI Photo Retake App That Lets You Recreate Moments](https://beebom.com/wondershare-relumi-ai-photo-retake-app/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha [![What to Expect from Apple's March 2026 Event: Budget MacBook, iPhone 17e, New iPads and More](https://static.beebom.com/wp-content/uploads/2026/03/Apple-March-Event-announcement-image.jpg?w=300&quality=75)](https://beebom.com/what-to-expect-from-apple-march-2026-event/) [What to Expect from Apple's March 2026 Event: Budget MacBook, iPhone 17e, New iPads and More](https://beebom.com/what-to-expect-from-apple-march-2026-event/) ![Portrait of Anshuman Jain](https://static.beebom.com/wp-content/uploads/2026/01/Anshuman-Jain-Profile-Picture-Beebom.jpg?w=290&h=290&crop=1&quality=75) Anshuman Jain [![What Is Nano Banana 2 Explained: Inside Google's Best AI Image Model Yet](https://static.beebom.com/wp-content/uploads/2026/02/nano-banana-2-explained.jpg?w=300&quality=75)](https://beebom.com/what-is-nano-banana-2-explained/) [What Is Nano Banana 2 Explained: Inside Google's Best AI Image Model Yet](https://beebom.com/what-is-nano-banana-2-explained/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha More In Tech [![Wondershare Relumi: The AI Photo Retake App That Lets You Recreate Moments](https://static.beebom.com/wp-content/uploads/2026/03/wondershare-relumi-ai-photo-retake-app.jpg?w=300&quality=75)](https://beebom.com/wondershare-relumi-ai-photo-retake-app/) [Wondershare Relumi: The AI Photo Retake App That Lets You Recreate Moments](https://beebom.com/wondershare-relumi-ai-photo-retake-app/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha [![DeepSeek vs ChatGPT: The Ultimate AI Comparison for 2026](https://static.beebom.com/wp-content/uploads/2026/03/deepseek-vs-chatgpt-comparison.jpg?w=300&quality=75)](https://beebom.com/deepseek-vs-chatgpt/) [DeepSeek vs ChatGPT: The Ultimate AI Comparison for 2026](https://beebom.com/deepseek-vs-chatgpt/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha [![ChatGPT Adult Mode: How to Get NSFW (18+) Chat and Messages](https://static.beebom.com/wp-content/uploads/2026/03/Animated-image-of-an-anime-girl-with-ChatGPT-logo-at-the-bottom.jpg?w=300&quality=75)](https://beebom.com/chatgpt-adult-mode-nsfw-chat-and-messages/) [ChatGPT Adult Mode: How to Get NSFW (18+) Chat and Messages](https://beebom.com/chatgpt-adult-mode-nsfw-chat-and-messages/) ![Portrait of Anshuman Jain](https://static.beebom.com/wp-content/uploads/2026/01/Anshuman-Jain-Profile-Picture-Beebom.jpg?w=290&h=290&crop=1&quality=75) Anshuman Jain [![What to Expect from Apple's March 2026 Event: Budget MacBook, iPhone 17e, New iPads and More](https://static.beebom.com/wp-content/uploads/2026/03/Apple-March-Event-announcement-image.jpg?w=300&quality=75)](https://beebom.com/what-to-expect-from-apple-march-2026-event/) [What to Expect from Apple's March 2026 Event: Budget MacBook, iPhone 17e, New iPads and More](https://beebom.com/what-to-expect-from-apple-march-2026-event/) ![Portrait of Anshuman Jain](https://static.beebom.com/wp-content/uploads/2026/01/Anshuman-Jain-Profile-Picture-Beebom.jpg?w=290&h=290&crop=1&quality=75) Anshuman Jain [![I Tested Wispr Flow AI Dictation App and It Transcribes My Voice Faster than I Can Type](https://static.beebom.com/wp-content/uploads/2026/02/wispr-flow-on-mac.jpg?w=300&quality=75)](https://beebom.com/wispr-flow-ai-dictation-app-transcribes-voice-faster-than-typing/) [I Tested Wispr Flow AI Dictation App and It Transcribes My Voice Faster than I Can Type](https://beebom.com/wispr-flow-ai-dictation-app-transcribes-voice-faster-than-typing/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha [![I Tried HitPaw's VikPea AI Video Enhancer to Upscale, Denoise, and Restore Videos](https://static.beebom.com/wp-content/uploads/2026/02/HitPaw-VikPea-Video-enhancement-tool-showcase.jpg?w=300&quality=75)](https://beebom.com/hitpaw-vikpea-ai-video-enhancer-upscale-restore-videos/) [I Tried HitPaw's VikPea AI Video Enhancer to Upscale, Denoise, and Restore Videos](https://beebom.com/hitpaw-vikpea-ai-video-enhancer-upscale-restore-videos/) ![Portrait of Partner Content](https://secure.gravatar.com/avatar/0675f77f5b1da134fe53528e8e0f5c75d8dbc03b6db30672e69a55e49790a5a8?s=24&d=mm&r=g) Partner Content [![Nano Banana 2 vs Nano Banana Pro Comparison: Bigger Isn't Always Better](https://static.beebom.com/wp-content/uploads/2025/09/google-brings-its-viral-nano-banana-image-generator-to-X.jpg?w=300&quality=75)](https://beebom.com/nano-banana-2-vs-nano-banana-pro-comparison/) [Nano Banana 2 vs Nano Banana Pro Comparison: Bigger Isn't Always Better](https://beebom.com/nano-banana-2-vs-nano-banana-pro-comparison/) ![Portrait of Arjun Sha](https://static.beebom.com/wp-content/uploads/2026/01/20241011_1337401.png?w=290&h=290&crop=1&quality=75) Arjun Sha ### Trending Stories in \#terminal 01 [How to Extract or Untar a File on Linux](https://beebom.com/how-extract-untar-file-linux/) Abubakar Mohammed 02 [How to Change Directory in Linux Terminal](https://beebom.com/how-change-directory-linux-terminal/) Beebom Staff 03 [How to Create a User in Linux](https://beebom.com/how-create-user-linux/) Beebom Staff 04 [How to Create Symbolic Links in Linux](https://beebom.com/how-create-symbolic-links-linux/) Beebom Staff 05 [How to Check System Uptime in Linux (5 Methods)](https://beebom.com/how-check-uptime-linux-system/) Beebom Staff Beebom is one of the leading consumer technology websites aimed at helping people understand and use technology in a better way. - [About Us](https://beebom.com/about-us/) - [Careers](https://beebom.com/careers/) - [Get in touch](https://beebom.com/contact-us/) - [Advertise](https://beebom.com/advertise/) - [Privacy Policy](https://beebom.com/privacy-policy/) - [Editorial Guidelines](https://beebom.com/editorial-guidelines/) Beebom is one of the leading consumer technology websites aimed at helping people understand and use technology in a better way. - [About Us](https://beebom.com/about-us/) - [Careers](https://beebom.com/careers/) - [Get in touch](https://beebom.com/contact-us/) - [Advertise](https://beebom.com/advertise/) - [Privacy Policy](https://beebom.com/privacy-policy/) - [Editorial Guidelines](https://beebom.com/editorial-guidelines/) *** © Beebom Media Private Limited
Readable Markdown
Learning file management in Linux is the key to efficient workflow. One of the most basic tasks that you would need to learn as a Linux beginner is copying files. Terminal is your friend in Linux and it can be used to most even the simplest of tasks quickly. As a beginner, if you’re struggling with copying files, here’s a tutorial with two different methods detailing how to copy files in Linux. ## How to Copy Files in Linux Using Terminal Copying files in Linux via the terminal is simple enough. All you need to do is use the “cp” command followed by two directories — one containing the file with the file name and the other where you want the file to be copied. cp stands for copy and this is the easiest Linux command to copy files from one location to another. Here’s the syntax for cp command in Linux: ``` cp /path/to/file /path/to/destination ``` Here’s an example where we copy the file Beebom.txt in the /Desktop directory to /Downloads. ``` cp /home/abubakarmohammed/Desktop/Beebom.txt /home/abubakarmohammed/Downloads ``` ![Copying files in Linux using cp command](https://static.beebom.com/wp-content/uploads/2023/06/Copying-a-file-to-another-direct-1.jpg?w=640) In the above example, we copied Beebom.txt which was in the Desktop directory to the Downloads directory. If you have a file in a directory different than what you’re currently in and want to copy the same in the current directory you’d need to **specify the path** to the directory with the file and just the name of the directory you want to copy the file in. For copying a file from a different directory to the current directory, use this syntax: ``` cp /path/to/file ./directory ``` For example, let’s copy Beebom.txt to a directory called /example\_directory. ``` cp /home/abubakarmohammed/Desktop/Beebom.txt ./example_directory ``` ### 1\. Copy Multiple Files into a Directory using cp Command There are two ways to go about this — by mentioning every file in cp and moving them to a directory, or by using a Regex-like method to copy files with similar extensions to a directory. Here’s the syntax. ``` cp /path/to/file path/to/file2 /directory ``` Here’s an example to copy multiple files in a directory one by one. Using the below command, we’re moving the files Beebom.txt and Beebom1.desktop to /example\_directory. ``` cp /home/abubakarmohammed/Desktop/Beebom.txt /home/abubakarmohammed/Desktop/Beebom1.desktop ./example_directory ``` ![Copying multiple files in Linux using cp command](https://static.beebom.com/wp-content/uploads/2023/06/copying-multiple-files-in-Linux.jpg?w=640) ### 2\. Copy Files with Matching Extensions using cp Command To copy files of similar extensions in Linux, the syntax would be: ``` cp /path/to/file/*.txt ./directory ``` This example will copy every .txt file from Desktop into the example\_directory. ``` cp /home/abubakarmohammed/Desktop.*.txt ./example_directory ``` ![How to Copy Files in Linux (2 Ways)](https://static.beebom.com/wp-content/uploads/2023/07/copy-files-with-matching-extensions-in-Linux.jpg?w=640) ### 2\. Copy a Directory into Another Directory using cp Command To copy a directory into another directory in Linux, you’d need to use the “-r” identifier. This lets the cp command know that you intend to copy a directory into another. Here’s the syntax: ``` cp -r ./path/to/directory ./directory ``` A real-time example of the command would be: ``` cp -r ./home/abubakarmohammed/Desktop/beebom ./example_directory ``` ![Copying a directory into another directory using cp command](https://static.beebom.com/wp-content/uploads/2023/06/Copy-directory-to-another-direct.jpg?w=640) ## How to Copy Files in Linux using GUI Like on Windows, most distros ship with their own file managers and shortcuts to copy/paste by dragging/dropping files and folders. For example, Nautilus is a files app that ships with distros that use GNOME, and Dolphin ships with KDE distributions, both support dragging and dropping files and copy/paste. If you’re new to Linux and don’t find Terminal that appealing, they’re your best bet. Here’s how to copy files using Nautilus. 1\. Launch Nautilus \> go to the file directory \> right-click on the file. ![Copy to in nautilus](https://static.beebom.com/wp-content/uploads/2023/06/Copy-to-in-nautilus.png?w=1024) 2\. Clicking Copy will copy the file whereas clicking Copy to will open another Nautilus pop-up window where you can choose where you want to copy the file to. ![Copy to pop up nautilus](https://static.beebom.com/wp-content/uploads/2023/06/Copt-to-pop-up-nautilus.png?w=1024) 3\. Click on a directory where you want to copy the file and then click Select at the top-right corner. That’s as simple as it gets. ![Portrait of Beebom Staff](https://secure.gravatar.com/avatar/88f09cba9de8e068a82d0247a49a0039323375b287a39234e6e6b53a09ba7c92?s=200&d=mm&r=g) Beebom Staff Bringing the latest in technology, gaming, and entertainment is our superhero team of staff writers. They have a keen eye for latest stories, happenings, and even memes for tech enthusiasts.
Shard167 (laksa)
Root Hash3942313026910408367
Unparsed URLcom,beebom!/how-copy-files-linux/ s443