Tips for Bash

$ echo {{1,2,3},1,2,3}
1 2 3 1 2 3

$ echo {{1,2,3}1,2,3}
11 21 31 2 3


DATE
Set date
# date -s "2009-12-31 12:59:59"

$ date +%d-%b-%Y
30-Jul-2006

FIND
Find any text files which other user can read:
find . -perm -o=r -iname "*.txt"

Find any text files which other user can read, then chmod them to o-rwx:
find ~ -iname "*.txt" -perm -o=r -exec chmod o-rwx '{}' \;

Find any files which > 50MB:
find . -size +50M

RPM MANAGER
$ rpm -ql $(rpm -qa | grep httpd)

$ today=`ls | grep txt`
$ stat today

$ find / -name foo

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Trackbacks:0

Listed below are links to weblogs that reference
Tips for Bash from Aji's Journal
TOP