How to delete specific files only


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to delete specific files only
# 1  
Old 06-22-2008
How to delete specific files only

Hello,

I have these files in my directory.

ABC123 ABC12.sls.20080809111121
ABC233 ABC12.sls.20080403123212
ABC543 ABC12.sls.20080804231212
ABC323 ABC12.sls.20080809111232
ABC765 ABC12.sls.20080809112343
ABC654 ABC12.sls.20080809113133

I want to delete only files in first column.
If i say
rm ABC*
all files will be deleted.
Files I do not want to delete start with ABC12.sls.*
Any idea ?
# 2  
Old 06-22-2008
Code:
rm ABC???

Regards
# 3  
Old 06-22-2008
Thank you.

Problem solved.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Delete all files created in specific year

I have more than 200K files created in year 2017 under directory having size of 50GB. I want to all these files in one shot. Is there any faster option available with find command to delete all these file ? (6 Replies)
Discussion started by: sp23029
6 Replies

2. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurrence of a specific word

he following are the files available in my directory RSK_123_20141113_031500.txt RSK_123_20141113_081500.txt RSK_126_20141113_041500.txt RSK_126_20141113_081800.txt RSK_128_20141113_091600.txt Here, "RSK" is file prefix and 123 is a code name and rest is just timestamp of the file when its... (7 Replies)
Discussion started by: kridhick
7 Replies

3. UNIX Desktop Questions & Answers

How to delete files from a specific date?

Guys, I am wondering how to remove files for a specific date in a directory? for instance when I do ls -l , i see many files. And i want to delete files for date May 15: 58252015 May 10 03:45 my_05102012.log 58252015 May 15 06:45 my_05152012.log Thanks (8 Replies)
Discussion started by: DallasT
8 Replies

4. Shell Programming and Scripting

rsync delete specific files - from different target folder

Hi, I need to use rsync to delete multiple files(only specified files not all) using --delete option, these files are located in different target folders. Instead of running rsync command multiple times for each file, can we achieve this with one time execution? your help is much... (0 Replies)
Discussion started by: MVEERA
0 Replies

5. Shell Programming and Scripting

Delete files in a folder with a specific ending

Hi I have files that end with .txt.txt that i want to delete. But I also have files that end with .txt that I want to leave intact. How do I specifically delete files that end with .txt.txt in a folder. thanks (5 Replies)
Discussion started by: kylle345
5 Replies

6. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurence of a specific word

Hello, I have several files in a specific directory. A specific string in one file can occur in another files. If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string. Example. file1 ShortName "Blue... (2 Replies)
Discussion started by: premier_de
2 Replies

7. Shell Programming and Scripting

How to delete files in specific dir

I've got a problem how to delete files from specific directory. I don't want do it recursively but only in specific directory. So, command like find /home/dirname/ -mtime +8 -type f -exec rm {} \; is not for me because this command will remove ifs files in /home/dirname and all... (2 Replies)
Discussion started by: zukes
2 Replies

8. Shell Programming and Scripting

Delete files created before specific date.

There is a system logging a huge amount of data and we need to delete some of the older logs .I mean the files that are created before one week from today. Here is a listing of files that are sitting there: /usr/WebSphere/AppServer/logs # ls -l -rw-r--r-- 1 root system 3740694 May... (5 Replies)
Discussion started by: moustafashawky
5 Replies

9. Shell Programming and Scripting

How do I delete all files that contain specific text?

Hi all, I want to remove the files from a folder whcih contain a specific text in it. eg: If i have the files like xxxx.NAME.adadd.ajfaj.kjfha agsg.NAME.dfshd.djsh.sdjhf asgd.NAME2.sdhj.djhf.sjdhf shdd.NAME2.dhse.tywe.eyio How to remove the files which contain the pattern "NAME"... (3 Replies)
Discussion started by: sparks
3 Replies

10. Shell Programming and Scripting

delete files in specific directory

i have a directory "ABC" with lots of old files and sub directories in it. the issue now is i want to delete away files which are older than 15 days in "ABC" without deleting the files in the sub directories and without deleting the sub directory. i tried using find command but it will drill down... (2 Replies)
Discussion started by: legato
2 Replies
Login or Register to Ask a Question