find . -exec grep -q 'foobar' '{}' \; -print
This searches in the current directory including its subdirectories and finds files that contain foobar.
find . -exec grep -q 'foobar' '{}' \; -print
mdfind Ruby
mdfind -name stdlib.h
mdfind Ruby | grep 'pdf'
mdfind -onlyin ~/ '(kMDItemFSContentChangeDate >= $time.today)'
Problem: You have a DIVX/DVD video on your computer and you want to watch it on your iPad.
Solution: There are a few options how to convert your video:
If you have some esoteric data format or you have to get more control over the encoding process or simply you want to get better quality than HD 480p, then you have to use something else.
Basically there are plenty of choice (I assume you are coming from Unix world):
I had a luck with tool number 2. Here is an example how I converted some video files to iPad format:
for i in *.avi; do ffmpeg -i "$i" -acodec libfaac \
-ab 96k -vcodec libx264 -s 1024x576 -vpre lossless_ultrafast \
-crf 20 -threads 2 "$i".mp4; done
The only thing left now is to add the newly converted file to your iTunes library and sync with your iPad.
Enjoy!
# changed files
sudo fslogger | awk '/FSE_ARG_STRING/ { print $5 }'
# file change type
sudo fslogger | awk '/type.*=/ { print $3 }'
# process that caused the change
sudo fslogger | awk '/pid.*=.*\(.*\)/ { print $4$5 }'
ls | sort
ls -l | sort -k5 -n
I guess you already know about && operator, which is very common. But || is not so common.
To better illustrate how it works here is an example:
>(exit 1) && echo '0' || echo '1'
1
>(exit 0) && echo '0' || echo '1'
0
also you can do tricks like that
>t=`( echo 'some output'; exit 0) && echo $t || echo 'Error!!!'
some output
>t=`( echo 'some output'; exit 1) && echo $t || echo 'Error!!!'
Error!!!
Very tasty usefulness! Isn't it ?