LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 04:19 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 225

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 04:26 AM.
 
Old 01-14-2010, 04:28 AM   #2
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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.
 
Old 01-14-2010, 04:34 AM   #3
Volcano
Member
 
Registered: Sep 2005
Posts: 225

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, 04:38 AM   #4
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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, 04:40 AM   #5
Volcano
Member
 
Registered: Sep 2005
Posts: 225

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, 04:40 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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.
Old 01-14-2010, 04:44 AM   #7
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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, 05:14 AM   #8
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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



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

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

All times are GMT -5. The time now is 10:53 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