LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to rename a file and copy a file in a shell (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-rename-a-file-and-copy-a-file-in-a-shell-503999/)

zach014 11-22-2006 02:35 PM

how to rename a file and copy a file in a shell
 
Can someone tell me how to rename a file in a shell (root). Also i need to know how to copy in a shell (root)

weibullguy 11-22-2006 02:42 PM

Rename
Code:

mv -v old_file new_file
Copy
Code:

cp -v old_file old_file_copy
The -v isn't strictly necessary, but provides feedback.

michaelk 11-22-2006 02:48 PM

May I suggest googling for "linux bash shell commands copy rename".

Once you have found the commands you can google for the man pages that explain their syntax.

Edit...
Nevermind someone else has blown my lesson....

matthewg42 11-22-2006 03:05 PM

One thing - be cautious. The shell commands assume you know what you want to do. If you move one file to a name which already exists, the existing file will be overwritten without warning or confirmation that you are sure.

The rm command deletes files. There is no undelete. Be careful!

weibullguy 11-22-2006 03:36 PM

Quote:

Originally Posted by michaelk
Nevermind someone else has blown my lesson....

Sorry. I'm typically an advocate for RTFM...

zach014 11-23-2006 09:16 AM

yeah, about the cp command. Can I specify a directory to copy it to?

zach014 11-23-2006 09:23 AM

ok never mind

Thanks guys!


All times are GMT -5. The time now is 12:20 PM.