LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-22-2006, 02:35 PM   #1
zach014
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 16

Rep: Reputation: 0
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)
 
Old 11-22-2006, 02:42 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
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.
 
Old 11-22-2006, 02:48 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
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....

Last edited by michaelk; 11-22-2006 at 02:49 PM.
 
Old 11-22-2006, 03:05 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
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!
 
Old 11-22-2006, 03:36 PM   #5
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by michaelk
Nevermind someone else has blown my lesson....
Sorry. I'm typically an advocate for RTFM...
 
Old 11-23-2006, 09:16 AM   #6
zach014
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: 0
yeah, about the cp command. Can I specify a directory to copy it to?
 
Old 11-23-2006, 09:23 AM   #7
zach014
LQ Newbie
 
Registered: Nov 2006
Distribution: Ubuntu
Posts: 16

Original Poster
Rep: Reputation: 0
ok never mind

Thanks guys!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy vid tape to file and burn file to DVD jim mann Linux - Software 4 01-24-2006 09:57 PM
How to copy mysql file into text file lumba General 0 09-26-2005 05:08 AM
Is arrangement of file systems will differ if we copy a file from FAT 32 to ext 3 ? anindyanuri Linux - Software 2 02-20-2005 11:39 AM
Shell script to copy file name with part of directory Transition Linux - General 5 01-18-2005 05:40 PM
shell script to copy lines from a file Warmduvet Programming 2 09-14-2004 09:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration