LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 09-27-2006, 02:57 PM   #1
Reaver76
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
Deleting from command line


Hi everyone! I'm a newbie that is just starting to learn about Linux, so I'll be bothering you with questions like the one I'll ask now...

Say I have files called Testing, Testing1, Testing2, Testing3, and so on. I want to keep the original Testing file but delete the other Testing files with one command. How would I do that?

I thought a command like:

>rm Testing[*]

would work, wouldn't it?
 
Old 09-27-2006, 03:21 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
no, that doesn't make sense, and if you were to run the legal version... "rm Testing*" then that would be bad as * can be null too. instead use ? to signify a single character. "rm Testing?" will match anyhting with a single character after the word "Testing"
 
Old 09-27-2006, 04:42 PM   #3
Reaver76
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up

Great! Thanks so much for the reply. I did a

>rm Testing?*

command, and it worked!
 
  


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
deleting all spaces at end of line in vi Tonatiuh Linux - General 4 08-16-2006 02:34 PM
c++ console output: deleting a line Ictus Programming 3 03-29-2006 02:28 PM
problem deleting file using solaris command line. szehanz Solaris / OpenSolaris 2 03-22-2005 07:52 PM
Deleting a line with gawk/awk caps_phisto Linux - General 4 11-06-2004 02:31 PM
deleting characters at the beginning of a line poobeany Programming 6 09-23-2003 05:17 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration