Subscribe to Lily Avida Subscribe to Lily Avida's comments

Archive for the ‘programming’ category

Find text within files in sub directories
find . -type f -exec grep -il “text string” {} \;

Change the photo files name:
for f in 100_*.jpg; do mv $f ${f/100_/p}; done

Add an ‘s’ to thumbnail:
for f in p*.jpg; do mv $f ${f/./s.}; done

List all files including sub directories into file ‘a.txt’:
ls -R > a.txt

Remove the ‘s’ character from the result:
sed -e ‘s/s//g’ a.txt > b.txt

Remove duplicates:
uniq a.txt > b.txt

List directories in reverse order:
ls -r > ‘c.txt’

One fine swoop:

ls -R > a.txt; sed -e 's/s//g' a.txt > b.txt; uniq b.txt > c.txt; sed -e "s/.jpg/' => Array\(2009,  2, 1, \" \"),/g" c.txt > d.txt; sed -e "s/100_/\'100_/g" d.txt > e.txt;

OLD CODE:
ls -R > a.txt; sed -e 's/s//g' a.txt > b.txt; uniq b.txt > c.txt; sed -e "s/.jpg/'\' => Array\(2008,  12, 1, \" \"),/g" c.txt > d.txt; sed "s/p/\'/g" d.txt > e.txt; sed ’s/Thumb.db//g’   e.txt > final.txt; ls -r > dirs.txt;

Create Direcotories a, b, c:
mkdir a; mkdir b; mkdir c

I have spent a large portion of today fighting the good fight with Typo3. Typo3 won the battle. I am sure if I knew what I am doing it would have been an easy task, but since I am still fumbling with that CMS, it was very hard and didn’t yield anything like what I hoped it would do. Bummer!

Out of morbid curiosity I looked for a similar plugin in WordPress and I found this one. Switching to WordPress looks like a brilliant idea right now… Sob! registration

Here is a list of ASCII characters I use often enough to create an entry on the blog, but not often enough to remember them off the top of my head.

‘ ‘ Single beginning quotation mark
’ ’ Single ending quotation mark
“ “ Double beginning quotation mark
” ” Double ending quotation mark
— — Em dash
™ ™ Trade mark
° ° Degree sign
¼ ¼ Fraction one quarter
½ ½ Fraction one half
¾ ¾ Fraction three quarters

Links:
Wikpedia: Ascii :: printable characters