11/10/2022 0 Comments Windows terminal commands copy cp
:~# Example:6) Archive files and directory during copy (-a) rw-r-r- 1 root root 7 Feb 3 17:41 file_5txt Now verify the contents of linuxtechi directory on target place, :~# ls -l /mnt/backup/linuxtechi/ĭrwxr-xr-x 2 root root 4096 Feb 3 17:41 data In above command, -r option will copy the files and directory recursively. Let’s assume we want to copy the home directory of linuxtechi user to “/mn/backup”, :~# cp -r /home/linuxtechi /mnt/backup/ To copy a directory from one place to another use -r or -R option in cp command. :~# Example:5) Copying a directory or folder (-r or -R) In case you want to use both interactive mode and verbose mode then use the options “-iv” :~# cp -iv /etc/fstab /mnt/backup/ If you want the verbose output of cp command then use “-v” option, example is shown below :~# cp -v /etc/fstab /mnt/backup/ In the above command one has to manually type ‘y’ to allow the copy operation Example:4) Verbose output during copy command (-v) If you wish to copy the files from one place to another interactively then use the “-i” option in cp command, interactive option only works if the destination directory already has the same file, example is shown below, :~# cp -i /etc/passwd /mnt/backup/ :~# Example:3) Copying the files interactively (-i) Let’s assume we want to copy multiples (/etc/passwd, /etc/group
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |