Display file names that are being deleted


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Display file names that are being deleted
# 1  
Old 02-20-2006
Question Display file names that are being deleted

The print command lists the path of the file being found. I want the output as the file name along with the date that particular files were created i.e similar to a ls -l command.

I am using find to list all the files that satisfy the selection criteria and delete them using rm. Can I display all those file names along with the date of creation which were being deleted using rm

Thanks in advance
# 2  
Old 02-21-2006
Try doing an ls -l of the file path before each rm
# 3  
Old 02-21-2006
find path selection-criteria -ls -exec rm {} \;
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

2. UNIX for Dummies Questions & Answers

How to recover deleted file?

Hi All By mistake i have deleted some file in a directory, is there any way to get it back in Unix( i am using sh ) (2 Replies)
Discussion started by: parthmittal2007
2 Replies

3. UNIX for Dummies Questions & Answers

How to display only Owner and directory/sub directory names under particular root

hai, I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc". (here "oasitqtc" is the owner of the directory or sub directory.) i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Discussion started by: gagan4599
6 Replies

4. Solaris

using ls -ltr : display only last four file names

Hi , Server details – Machine hardware: sun4u OS version: 5.9 Processor type: sparc Hardware: SUNW,Sun-Fire-880 When I put ls –ltr command I get – /users/testuser> ls -ltr -rw-rw-r-- 1 testuser dba 76 Jan 13 2009 ftp.scr -rwxr-xr-x 1... (6 Replies)
Discussion started by: rahulbahulekar
6 Replies

5. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies

6. Shell Programming and Scripting

Shell Script to display function names (called & defined) in a C++ Source Code

Hello to all, I am looking for a way to display only the names of function (calls & definition) of a C++ source code.There is already a post related to this, but the script is to find the functions using a specific variable, and the replies are not that convincing since they cannot be used for... (2 Replies)
Discussion started by: frozensmilz
2 Replies

7. UNIX for Dummies Questions & Answers

how to know who has deleted the file.

Hi, We have a file which needs supper user previleges to delete. There are 10 users having super user preveleges. Some times back that file got deleted. How to know who has deleted that file? (6 Replies)
Discussion started by: siba.s.nayak
6 Replies

8. Shell Programming and Scripting

Lock a file from being deleted?

Hi In my script, users have the option to delete files from a directory, however, I don't want them to be able to delete the automatically generated log file. Is there anyway to lock a file from being deleted? Note: The file can't be read only as it has to be written to quite frequently. ... (3 Replies)
Discussion started by: Darren Taylor
3 Replies

9. UNIX and Linux Applications

display only file names

Hi, I want to display only the file names of the ls command with a delimiter of comma. For example:- ls /etc/dir/N* gives the following output /etc/dir/N1 /etc/dir/N2 /etc/dir/N3 I want the output as N1,N2,N3,-->Here i need the final comma also. Also, here /etc/dir is being... (4 Replies)
Discussion started by: dnat
4 Replies

10. Linux

how can i restore a deleted file

I am a relatively new linux user.would like to know how to undo a deleted file (2 Replies)
Discussion started by: wojtyla
2 Replies
Login or Register to Ask a Question