LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-13-2010, 12:32 PM   #1
rajesh1978
LQ Newbie
 
Registered: Jun 2010
Posts: 26

Rep: Reputation: 0
Exclamation Repeating the command after one execution


Hi,
I have seen command like $rm aa dd cc bb ee
then something like $ >> zz // it removes zz also
Where aa dd cc bb ee zz are the files in my directory.
Do not know exactly.
Please suggest

Thanks
 
Old 10-13-2010, 12:36 PM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Hi,

Please mention it with some examples.Not able to understand what are you trying to say.
 
Old 10-13-2010, 12:36 PM   #3
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Thumbs up

Hi,

Please mention it with some examples.Not able to understand what are you trying to say.
 
Old 10-13-2010, 12:50 PM   #4
rajesh1978
LQ Newbie
 
Registered: Jun 2010
Posts: 26

Original Poster
Rep: Reputation: 0
Actually I see people do it very fast so i did not catch it.

It is something like
suppose I have aa bb cc dd and zz files are there in my directory
I want to remove the files
I gave the command
$rm aa bb cc dd
I forgot to give zz
then
again without typing rm zz
i wrote in the command prompt like $ >> zz

The operation is not know to me clearly.It was done very fast. I just witnessed the fast going operation
 
Old 10-13-2010, 02:31 PM   #5
ericchenry
LQ Newbie
 
Registered: Jun 2010
Location: Kentucky
Distribution: Xubuntu 10.04
Posts: 3

Rep: Reputation: 0
I believe the command that you are looking for is !! i.e.
$ rm file1 file2 file3
$ !! file4

!! is the shortcut to repeat your last command issued to your shell (if you are using Bash), however, I don't exactly remember how it works with arguements.

Good Luck
 
Old 10-13-2010, 02:37 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by ericchenry View Post
I believe the command that you are looking for is !! i.e.
$ rm file1 file2 file3
$ !! file4

!! is the shortcut to repeat your last command issued to your shell (if you are using Bash), however, I don't exactly remember how it works with arguements.

Good Luck

That's history expansion ... look it up in "man bash"

However, w/ a command like "rm" I fail to see the benefit
... it's 3 keystrokes to do "!!" or ">>" ;} ... two for
the real thing.



Cheers,
Tink
 
Old 10-13-2010, 10:41 PM   #7
rajesh1978
LQ Newbie
 
Registered: Jun 2010
Posts: 26

Original Poster
Rep: Reputation: 0
The things you all have told also useful.
Thanks all
 
  


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
Only execute 2nd command on successufl execution of 1st command kregec05 Linux - Newbie 3 08-19-2009 10:29 AM
repeating command monu Linux - General 3 10-20-2007 06:18 PM
repeating the command ekdya Debian 2 03-31-2006 04:47 PM
traceroute command AND repeating the destination in output dan99 Linux - Networking 1 01-22-2005 10:00 PM
command execution leonidas Linux - General 1 09-22-2004 12:29 AM

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

All times are GMT -5. The time now is 02:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration