Wednesday, 27 April 2016

Unix commads : Find command example

find . -not -path '*/\.*' -type d \( -iname "$version_id" \) ! -newermt `date +%y%m%d -d "30 days ago"` | tee -a "$log_file"



find . -not -path '*/\.*' -type d \( -iname "$version_id" \) - Find the directory not present in hidden directories

! -newermt `date +%y%m%d -d "30 days ago"`  - Older than 30 days


find . ! -newermt 2016-02-22 ! -type d -delete - Delete the older before the specified date


find . -type l -ls - Find all links


find . -not -path '*/\.*' -type d \( -iname "$version_id" \) ! -newermt `date +%y%m%d -d "63 days ago"` | xargs  rm -rf -- To delete

No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...