Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Recursive remove files with exception Post 302376028 by zivsegal on Monday 30th of November 2009 11:15:44 AM
Old 11-30-2009
Data Recursive remove files with exception

Hi,
I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like:

\rm -rf < find . * | grep -v .SYNC

The find works ok but I do not know how to redirect it.

Please help.

Regards,
Ziv
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

recursive copy of hidden files

I need to know how to copy hidden files recursively? cp -r sourceDir/* targetDir/. ignores the hidden files. Thank you!! (2 Replies)
Discussion started by: usfrog
2 Replies

2. Programming

Recursive remove directory.

What is the best way to completely remove dir with it's content ??? rmdir deletes only EMPTY dirs as i know. The man page of remove function says "remove() deletes a name from the file system." Can it remove any dir recursively ??? :rolleyes: (7 Replies)
Discussion started by: Trump
7 Replies

3. Shell Programming and Scripting

recursive saving of files and folders

Hi all I have a bash script, that loops through a folders files and all subfolders for .shtml files. It looks for a string and replaces it, creating a backup of the original file. This all works great, but I'd like, when the backup is done, that the files are then also created in their... (4 Replies)
Discussion started by: terrid
4 Replies

4. Shell Programming and Scripting

Command running for all recursive files

hi, I have installed ACL(access control list) in my ubuntu box in order to know which all are the users having permissions to read and write the files; If u run the command like; $getfacl /root/ It will give following output: # file: root/ # owner: root # group: root user::rwx... (2 Replies)
Discussion started by: ajaypadvi
2 Replies

5. Shell Programming and Scripting

Recursive looping through files and directories

hi; i need a script which will go to all directories and subdirectories and print the filenames as follow; here i m printing only files listing in current directory reason i m doing this is coz i want to perform some operations according to filename achieved so cant use find command;... (4 Replies)
Discussion started by: ajaypadvi
4 Replies

6. Shell Programming and Scripting

Disk Quota Exception while deleting the files

This is the full file name I get when I do ls -lt from my current directory. EXPORT_v1x0_20120811_11_T_065800_070000.dat.gz File names also consist of date as well. In the above file date is 20120811. So I am trying to delete all the files which starts with EXPORT_v1x0 and whose... (7 Replies)
Discussion started by: raihan26
7 Replies

7. Shell Programming and Scripting

Monitor logs for exception and if exception come then sent an email

Hi Folks, please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies

8. UNIX for Advanced & Expert Users

Recursive grep with only certain types of files

Can I please have some ideas on how to do a recursive grep with certain types of files? The file types I want to use are *.c and *.java. I know this normally works with all files. grep -riI 'scanner' /home/bob/ 2>/dev/null Just not sure how to get it to work *.c and *.java files. (5 Replies)
Discussion started by: cokedude
5 Replies

9. Shell Programming and Scripting

Compare 2 files using third file as an exception

Hi All, Is it possible to compare 2 files using the contents of a third file as a guide using a bash script? I have 2 files I want t compare (1 and 2 below) the difference between the two is the first line (a) I want my script to ignore this difference if the difference is stored in file... (5 Replies)
Discussion started by: nwalsh88
5 Replies

10. UNIX for Beginners Questions & Answers

Recursive remove files

Hi folks, I have several directories with multiple files of all kinds in them. For example directory ###### contains: ######B1.TIF ######B2.TIF ........... ######B8.TIF ######.tar ######.txt ######.jpg ######r ######r.hdr ######rSVD ######rSVD.hdr ######t ######t.hdr How do I... (8 Replies)
Discussion started by: spirospap
8 Replies
DPNS-RM(1)							DPNS User Commands							DPNS-RM(1)

NAME
dpns-rm - remove DPNS files or directories in the name server SYNOPSIS
dpns-rm [-f] [-i] filename... dpns-rm [-f] [-i] -r dirname... DESCRIPTION
dpns-rm removes DPNS files or directories in the name server. For directories either -r or -R must be present. For regular files, it calls dpns_unlink while for directories, it calls dpns_rmdir. This requires write permission in the parent directory and the file itself. If write permission on an entry is denied, the standard input is a terminal and the -f option is not given, the prompt "override write protection" appears and if the response is not y, the entry is not deleted. Entries directly under a protected directory are never deleted. path specifies the DPNS pathname. If path does not start with /, it is prefixed by the content of the DPNS_HOME environment variable. OPTIONS
The following options are supported: -f Do not give an error message if the file/directory does not exist. -i Request acknowledge before removing each individual entry. -R Recursive mode (equivalent to -r). -r Recursive mode. EXIT STATUS
This program returns 0 if the operation was successful or >0 if the operation failed. SEE ALSO
Castor_limits(4), dpns_rmdir(3), dpns_unlink(3) AUTHOR
LCG Grid Deployment Team DPNS
$Date: 2002/10/18 11:57:00 $ DPNS-RM(1)
All times are GMT -4. The time now is 11:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy