ls & rm with regular expression
e.g. rm -rf backup-20070[8-9]-*
would delete :
- backup-200708-morning
- backup-200708-evening
- backup-200709-night
- backup-200709-latenight
but not :
- backup-200706-morning
- backup-200707-afternoon
- backup-200711-midnight
e.g. ls backup-20070[1-9] would list all backup starting from January to September but leave October, November & December out, of year 2007.
Related posts:
- Regular Expression Cheat Sheet for you out there always trying to grep, ls, vi...
- Workflow with Automator … I have always use my mac for surfing, emailing, messaging...
- useful unix command: xargs In our mailserver, we backup every incoming email and keep...
- Install MySQL5 on Mac OSX With Darwin Port Before installing MySQL5, please be sure you have Darwin Port...
- postgresql82-server compile error on Apple Leopard with Macports 1.5 I wasn’t able to compile postgresql82-server on my machine, it’s...
- How to Install FreeBSD 5.4 on Your Machine FreeBSD is an advanced operating system for x86 compatible (including...
- Servers Uptime. More Than 356 days, 1 Year Old Phew, time flies… I’ve been working with AIMS for more...
- TextMate: Creating New Project in Shell Instantly Been using TextMate recently, really loving it like hell. There...
- ssh client hang after a few minutes of inactivity specify the parameter “ServerAliveInterval 60″ in /etc/ssh_config or /etc/ssh/ssh_config. for...
- convert epoch using date command date -d ‘<Unix epoch> <epoch date> sec’ e.g. date -d...