LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 01-14-2010, 05:19 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 176

Rep: Reputation: 15
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 05:26 AM.
 
Old 01-14-2010, 05:28 AM   #2
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
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 TheIndependentAquarius; 01-14-2010 at 05:29 AM.
 
Old 01-14-2010, 05:34 AM   #3
Volcano
Member
 
Registered: Sep 2005
Posts: 176

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by anishakaul View Post
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
 
Old 01-14-2010, 05:38 AM   #4
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
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 !!
 
Old 01-14-2010, 05:40 AM   #5
Volcano
Member
 
Registered: Sep 2005
Posts: 176

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by anishakaul View Post
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
 
Old 01-14-2010, 05:40 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
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 05:41 AM. Reason: PS
 
1 members found this post helpful.
Old 01-14-2010, 05:44 AM   #7
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
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.
 
Old 01-14-2010, 06:14 AM   #8
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

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


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
shoot me in the head for stupidity rbees Linux - Newbie 19 12-28-2008 08:02 PM
Gonna Shoot Myself.. (What Not To Do) ToBe Linux - Newbie 5 09-02-2005 07:15 PM
Don't shoot me, CD-4 question Wakim Mandriva 4 01-02-2005 10:17 PM
shoot the newbie... Tisch Debian 2 01-17-2004 06:30 PM
startx !!!! help me im about to shoot myself hydro Linux - Newbie 6 02-20-2003 03:10 AM

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

All times are GMT -5. The time now is 11:13 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration