Find code and diagrams at:
Renaming, moving, copying, and deleting files in Linux command line is easy. Renaming files uses the same command as move. As an administrator if you do not own the files you are interacting with you may have to add sudo to the beginning of the command to give yourself the required privileges.
Rename Files
mv file file2 – to rename a file use mv command followed by original file name, space and then new file name
Move Files
mv file folder/file – to move files use mv command followed by original file name, space and then new location and file name. BE CAREFUL because you can move AND rename a file at the same time.
Copy Files
cp file file.bak – to copy a file use the cp command followed by the original file, space and name of copy.
Delete Files
rm file – to delete a file use rm followed by file name
rm file file.bak – to delete multiple files use rm followed by file name separated by spaces.
Note: you can use wild cards for the remove command to delete multiple file. Such as rm *.bak . BE VERY CAREFUL WITH THIS!
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
Suell
April 27, 2020mv: cannot move 'test' to '/Documents/test': No such file or directory
help—-
SMJSmoK
April 27, 2020What's with the dislikes? It's a solid tutorial for people who are new to this kind of thing.
Claudius Laurentiae
April 27, 2020How do you create your own binaries (like cp, mv, rm) without using " ./ " to execute them but using only their names ?
v0od0o
April 27, 2020No.
mm7071
April 27, 2020I already know all these but I still watched the video to pay homage to old Eli style video. Warm memories of happy days
Shyann&Wade Tracy
April 27, 2020why do you not make use of the ctrl l function?
Shyann&Wade Tracy
April 27, 2020im running Ubuntu 18.04 and when I give this command I have to omit the forward slash. it will then move the file in question but with an error MSG. "mv: cannot stat 'folde' : no such file or directory" why might this be going on?
Chev Chelios
April 27, 2020Eli is a tech neck, a red neck into tech 🙂
Andy Oreo
April 27, 2020Vim user and proud.
Apache Attack Helicopter
April 27, 2020Thank you for the vid!
astr0b0y
April 27, 2020Interesting!!!
dilan hoshyar
April 27, 2020thanks for your assistance