Chinaunix首页 | 论坛 | 博客
  • 博客访问: 696360
  • 博文数量: 260
  • 博客积分: 7033
  • 博客等级: 少将
  • 技术积分: 2633
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-13 23:15
文章分类

全部博文(260)

文章存档

2012年(2)

2011年(41)

2010年(78)

2009年(139)

我的朋友

分类:

2010-07-06 23:00:59



find . -name "._*" -depth -exec rm {} \;


参考:



A script to remove .DS_Store files on any *NIX Machine UNIX
There have been hints here about removing those pesky .DS_Store files, but many fail under certain conditions (usually when there are special characters in a file or folder name), or require BSD find. This script has been tested on Debian Linux (Woody, 3.0r1). It does NOT work on Jaguar (never tested on Panther), since it requires GNU find (tested w/ version 4.1.7).

This removes all .DS_Store files in the current directory and its subdirectories. rm gets a little upset if there are no such files present, but this is minor (really only a problem if you put it in a crontab or something like that).

#!/bin/bash
find . -name .DS_Store -printf \"%p\"\ \ | xargs rm


阅读(1944) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~