Skip to content
Readerstacks logo Readerstacks
  • Home
  • Softwares
  • Angular
  • Php
  • Laravel
  • Flutter
Readerstacks logo
Readerstacks
Copy command in ubuntu

Copy command in Ubuntu

Aman Jain, October 31, 2021October 31, 2021

Copy is very command in Ubuntu terminal. whenever we want to copy the directories or files copy command come in to the action. In this article we will lean to copy the directory, copy files, copy with hidden files, copy recursively, copy multiple files, copy with backup, copy interactively.

So, the basic copy command statement is below

cp [options] source destination

Or you can say

cp [options] old old

Table of content
  • Copy a file in same folder Ubuntu terminal
  • Copy a file in different folder Ubuntu terminal
  • Copy a folder recursively Ubuntu terminal
  • Copy a file or folder interactively
  • Copy specific extension file
  • Copy file or folder with backup

Copy a file in same folder Ubuntu terminal

To copy a single file in Ubuntu we can use below command

cp test.txt test2.txt

Here cp is used for copy command, test.txt is source file, test2.txt is destination file.

Copy a file in different folder Ubuntu terminal

cp test.txt folder_name/path/test2.txt

folder_name/path/test2.txt, we can copy in folder_name.

Copy a folder recursively Ubuntu terminal

Copy a folder with all content using -R options

cp -R source_folder destination_folder

Copy a file or folder interactively

-i option is used to interactively show the prompt before copy.

cp -i source_folder destination_folder

Copy specific extension file

In some case it requires to copy only some specific file format file then we can use

cp  *.txt destination_folder

Copy file or folder with backup

Sometimes we need take backup before copying the files so here is command

cp -b test.txt test2.txt

Related

Devops Ubuntu CopyterminalUbuntu

Post navigation

Previous post
Next post

Related Posts

How to start, stop and restart apache linux ?

August 28, 2021August 28, 2021

Before start i hope you know well about the apache, if not then you can read this article what is apache and install on ubuntu. Commands to start, stop, status and restart the apache are as follow: Start Apache in ubuntu command line sudo service apache2 start Restart Apache in…

Read More
Devops How to Install multiple versions of PHP?

How to Install multiple versions of PHP?

September 18, 2021September 21, 2021

Sometimes it’s required to install the different version of PHP rather then the default one of Ubuntu Repository System. To install the different version we will follow the basic steps before installation of PHP Step 1 : Add ppa:ondrej/php to Ubuntu system Open the terminal or ssh connection and then…

Read More

What is apache web server and install on ubuntu?

August 28, 2021August 29, 2021

Apache is a web server which is used to serve the http request from a client computer. A client can open a webpage to view the website using web browsers like chrome, firefox etc. and browsers sent their requests to web servers like apache http server. How to install Apache…

Read More

Aman Jain
Aman Jain

With years of hands-on experience in the realm of web and mobile development, they have honed their skills in various technologies, including Laravel, PHP CodeIgniter, mobile app development, web app development, Flutter, React, JavaScript, Angular, Devops and so much more. Their proficiency extends to building robust REST APIs, AWS Code scaling, and optimization, ensuring that your applications run seamlessly on the cloud.

Categories

  • Angular
  • CSS
  • Dart
  • Devops
  • Flutter
  • HTML
  • Javascript
  • jQuery
  • Laravel
  • Laravel 10
  • Laravel 11
  • Laravel 9
  • Mysql
  • Php
  • Softwares
  • Ubuntu
  • Uncategorized

Archives

  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • October 2024
  • July 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • July 2023
  • March 2023
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Recent Posts

  • Mapping Together: The Vibrant Spirit of OpenStreetMap Japan
  • Understanding High Vulnerabilities: A Deep Dive into the Weekly Summary
  • Building a Million-Dollar Brand: The Journey of Justin Jackson
  • Mastering Schedule Management with Laravel Zap
  • The Resilience of Nature: How Forests Recover After Fires
©2023 Readerstacks | Design and Developed by Readerstacks
Go to mobile version