Codeigniterbrasil - Chuyên trang tin tức công nghệ hàng đầu
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại
No Result
View All Result
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại
No Result
View All Result
Codeigniterbrasil - Chuyên trang tin tức công nghệ hàng đầu
No Result
View All Result

Linux Command Line (10) Copy Files and Directories

admin by admin
May 25, 2020
in Lập Trình Linux
0
Linux Command Line (10) Copy Files and Directories



The copy command works similar to the move command, the word copy is shortened down to 2 letters cp and then we type in the source and the destination

cp errorfile.txt Newdirectory

To copy to the same directory you would type cp the filename then the copy-filename

cp errorfile.txt errorfile-copy.txt

We can add options -f for force (overwrite if file exists), -n for no-clobber (Do not overwrite file if it exits), -v for verbose, and -i for interactive (Ask before overwriting the file) to the copy command

cp -vi errorfile.txt Newdirectory

We add some files to the Newdirectory2 directory with the command:
Touch Newdirectory/Newdirectory2/file{a,b,c}.txt

This will create three files filea.txt, fileb.txt, and filec.txt

When copying a directory, we must use the -r option to recursively copy everything in that directory
cp -r Newdirectory/Newdirectory2/ .

If you use the -i for interactive when copying a directory, it will ask to confirm copy file for every file in that directory (control+c with cancel you out of that)

Using the -u option will only copy files that have been updated

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/

Xem thêm Bài Viết:

  • Hướng dẫn sử dụng hệ điều hành linux siêu tốc – bài 25 Xem cấu hình hệ thống (cpu, ram, hdd)
  • Linux cat command summary with examples
  • Cài nhiều hệ điều hành Windows và Linux trên một máy tính
  • Hướng dẫn tạo USB Boot DLC2019 (NTFS / UEFI) Trên windows 10 ( sử dụng USB 32 GB )
  • Hướng dẫn gỡ bỏ Ubuntu sạch sẽ nhất bằng lệnh trên Windows theo chuẩn UEFI-GPT
Previous Post

Cựu thứ trưởng Nguyễn Văn Hiến bị đề nghị khai trừ Đảng | Tin tức an ninh 24h mới nhất | Tin nóng

Next Post

Tin tức dịch bệnh corona ( Covid-19 ) sáng 17/4 Tin tổng hợp virus corona Việt Nam đại dịch Vũ Hán

Next Post
Tin tức dịch bệnh corona ( Covid-19 ) sáng 17/4 Tin tổng hợp virus corona Việt Nam đại dịch Vũ Hán

Tin tức dịch bệnh corona ( Covid-19 ) sáng 17/4 Tin tổng hợp virus corona Việt Nam đại dịch Vũ Hán

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tin Hot

Tại sao các sàn môi giới bất động sản cần ứng dụng CRM để quản lý khách hàng

Tại sao các sàn môi giới bất động sản cần ứng dụng CRM để quản lý khách hàng

July 26, 2022
Đập hộp Z590 Vision G

Trên tay Gigabyte Z590 Vision G – Sẵn sàng cho người sáng tạo nội dung

May 15, 2021
Cách khắc phục lỗi mất biểu tượng loa trong Windows 10

Cách khắc phục lỗi mất biểu tượng loa trong Windows 10

October 21, 2020
Mẹo và Thủ thuật Máy tính Mọi người Nên Biết

Mẹo và Thủ thuật Máy tính Mọi người Nên Biết

September 25, 2020
Cách nhập ảnh từ iPhone sang Mac

Cách nhập ảnh từ iPhone sang Mac

September 10, 2020
Test loa karaoke bluetooth Soundmax A-2120, có điều khiển từ xa | META.vn

Test loa karaoke bluetooth Soundmax A-2120, có điều khiển từ xa | META.vn

May 28, 2020
  • Liên Hệ
  • Chính Sách Bảo Mật

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Công Nghệ
  • Lập Trình Linux
  • Lập Trình PHP
  • Điện Thoại

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.