<p>I want to delete all but the 4 newest directories in my parent directory. How would you do this in Bash?</p>

```
```
ls -atrd */ | head --lines=-4 | xargs rm -rf
```
```
Edit:
added 'a' argument to ls