Last active
August 29, 2015 14:06
-
-
Save jrosco/dce046ee73f23ae5a2cc to your computer and use it in GitHub Desktop.
Oneliners
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Checks disk usage in directories | |
for x in $(ls -l / | awk {'print $9'}); do du -sh /$x; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change -mtime X to days older then X to delete | |
find /path/to/files* -mtime +X -exec rm {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -i -pe 's{^#!/bin/sh}{#!/bin/bash}' /path/to/file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment