commands: cp and mvyfeaste/cpsc101/cpsc101f15yvon...commands: cp and mv . unix/linuxcommandcp ! •...
TRANSCRIPT
![Page 1: Commands: CP and MVyfeaste/cpsc101/CPSC101F15Yvon...Commands: CP and MV . Unix/LinuxCommandCP ! • CP#is#the#command#used#in#Unix#and#Linux#to#copy#your#files#or#directories](https://reader033.vdocuments.net/reader033/viewer/2022051601/5ac80ff67f8b9aa3298bb5d4/html5/thumbnails/1.jpg)
Commands: CP and MV
![Page 2: Commands: CP and MVyfeaste/cpsc101/CPSC101F15Yvon...Commands: CP and MV . Unix/LinuxCommandCP ! • CP#is#the#command#used#in#Unix#and#Linux#to#copy#your#files#or#directories](https://reader033.vdocuments.net/reader033/viewer/2022051601/5ac80ff67f8b9aa3298bb5d4/html5/thumbnails/2.jpg)
Unix/Linux Command CP • CP is the command used in Unix and Linux to copy your files or directories.
(http://www.rapidtables.com/code/linux/cp.htm)
![Page 3: Commands: CP and MVyfeaste/cpsc101/CPSC101F15Yvon...Commands: CP and MV . Unix/LinuxCommandCP ! • CP#is#the#command#used#in#Unix#and#Linux#to#copy#your#files#or#directories](https://reader033.vdocuments.net/reader033/viewer/2022051601/5ac80ff67f8b9aa3298bb5d4/html5/thumbnails/3.jpg)
Examples of the CP command: • cp -‐u *.txt newdir
• Copies any file with the extension “.txt” to the directory “newdir” if the files do not already exist, or are newer than the files currently in the directory. The option “-‐u” means “update,” so this is why it will only copy the files this way.
• cp file1.txt newdir
• Copies the file “file1.txt” from the currently selected directory to the “newdir” directory
![Page 4: Commands: CP and MVyfeaste/cpsc101/CPSC101F15Yvon...Commands: CP and MV . Unix/LinuxCommandCP ! • CP#is#the#command#used#in#Unix#and#Linux#to#copy#your#files#or#directories](https://reader033.vdocuments.net/reader033/viewer/2022051601/5ac80ff67f8b9aa3298bb5d4/html5/thumbnails/4.jpg)
Unix/Linux Command MV • MV is the command used in Unix and Linux to move or rename files or directories.
(http://www.rapidtables.com/code/linux/mv.htm)
![Page 5: Commands: CP and MVyfeaste/cpsc101/CPSC101F15Yvon...Commands: CP and MV . Unix/LinuxCommandCP ! • CP#is#the#command#used#in#Unix#and#Linux#to#copy#your#files#or#directories](https://reader033.vdocuments.net/reader033/viewer/2022051601/5ac80ff67f8b9aa3298bb5d4/html5/thumbnails/5.jpg)
Examples of the MV command: • mv file1.txt newdir
• Moves the file “file1.txt” to the directory “newdir”
• mv myfile subdir/myfile2 • Moves the file “myfile” to the sub-‐directory named “myfile2”
• mv bak bak2 • Rename the directory “bak” to “bak2”