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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-14-2010, 04:19 AM
|
#1
|
Member
Registered: Sep 2005
Posts: 225
Rep:
|
what command to shoot ?
cp -i goulash.war recipes/hungarian
This copies the file to destination 'recipes/hungarian'
is there any chance to rename the file name to goulash-14-jan-2010.war while copying ?
in otherwords , I want this copied file to be renamed to goulash-14-jan-2010.war
what command to shoot ? any one line command ?
Thanks
Last edited by Volcano; 01-14-2010 at 04:26 AM.
|
|
|
01-14-2010, 04:28 AM
|
#2
|
Senior Member
Registered: Dec 2008
Posts: 4,732
|
Execute the following command from the directory in which goulash.war is located.
Code:
mv goulash.war goulash-14-jan-2010.war
Last edited by Aquarius_Girl; 01-14-2010 at 04:29 AM.
|
|
|
01-14-2010, 04:34 AM
|
#3
|
Member
Registered: Sep 2005
Posts: 225
Original Poster
Rep:
|
Quote:
Originally Posted by anishakaul
Execute the following command from the directory in which goulash.war is located.
Code:
mv goulash.war goulash-14-jan-2010.war
|
mv is equivalent to cut ...is not it ? I don't want cut ...i want copy
and also can you also add the dirtectory
|
|
|
01-14-2010, 04:38 AM
|
#4
|
Senior Member
Registered: Dec 2008
Posts: 4,732
|
Quote:
Originally Posted by Volcano
mv is equivalent to cut ...is not it ? I don't want cut ...i want copy
and also can you also add the dirtectory
|
I am saying that after you have copied this file in your desired location, then u can run this command to rename it !!
|
|
|
01-14-2010, 04:40 AM
|
#5
|
Member
Registered: Sep 2005
Posts: 225
Original Poster
Rep:
|
Quote:
Originally Posted by anishakaul
I am saying that after you have copied this file in your desired location, then u can run this command to rename it !!
|
ok ...so you mean two commands then 
|
|
|
01-14-2010, 04:40 AM
|
#6
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Just specify the filename in the cp command.
Code:
cp -i goulash.war recipes/hungarian/goulash-14-jan-2010.war
Evo2.
PS. cut, extracts a column from a file or standard input.
Last edited by evo2; 01-14-2010 at 04:41 AM.
Reason: PS
|
|
1 members found this post helpful.
|
01-14-2010, 04:44 AM
|
#7
|
Senior Member
Registered: Dec 2008
Posts: 4,732
|
Quote:
Originally Posted by Volcano
ok ...so you mean two commands then
|
Oh u have problems in running 2 commands ?
Anyway evo2's suggested solution will work for u !
Thanks for reminding the cp command evo2.
|
|
|
01-14-2010, 05:14 AM
|
#8
|
Senior Member
Registered: Dec 2008
Posts: 4,732
|
This also works !
Code:
mv a.c ~/Desktop/b.c
Here mv command moves a.c to Desktop while renaming it to b.c at the same time !
Oh yeah! It doesn't copy, it moves the file..
|
|
|
All times are GMT -5. The time now is 01:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|