sh-3.2# wall
Type your message here
wall supports up to 20 lines

type control d to close

That will result in everyone on the system seeing your message regardless of wether mesg is enabled or not

Broadcast Message from me@JBook.local
(/dev/ttys001) at 21:13 CST...

Type your message here
wall supports up to 20 lines

type control d to close

another quick line is to

echo "Your message here" | wall

find by name
find /directory -name “filename.ext”
find /directory -name filename.*
find /directory -name *.php

ignore case
find /directory -iname “filename.ext”

invert results (list files that don’t end with .php)
find /home/test ! -name “*.php”

search only 1 directory deep
find /home/test -maxdepth 2 -name “*.php”

only 2 directories deep
find /home/test -maxdepth 3 -name “*.php”

Find all directories
# find . -type d

Find only the normal files
# find . -type f

Find all the hidden files
# find . -type f -name “.*”

Find all the hidden directories
# find -type d -name “.*”

Find files bigger than the given size
# find ~ -size +100M

Find files smaller than the given size
# find ~ -size -100M

Find files that matches the exact given size
# find ~ -size 100M

Accessed files

Find based on minutes (60 minutes)
find /home -amin -60

Long list the files which are accessed within the last 1 hour.
find /home -amin -60 -exec ls -l {} \;

Find based on day(s) (24 hours)
find /home -atime -1

Long list the files which are accessed within the last 1 day.
find /home -atime -1 -exec ls -l {} \;

Modified files

Find based on minutes (60 minutes)
find /home -mmin -60

Long list the files which are accessed within the last 1 hour.
find /home -mmin -60 -exec ls -l {} \;

Find based on day(s) (24 hours)
find /home -mtime -1

Long list the files which are accessed within the last 1 day.
find /home -mtime -1 -exec ls -l {} \;

hide errors (Permission denied)
find -name “*.txt” 2>>/dev/null

To display the full path in the Finder title in Leopard, open Terminal.app and run:
$ defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

then

$ osascript -e ‘tell app “Finder” to quit’

Then relaunch the Finder from the dock. To undo:

$ defaults write com.apple.finder _FXShowPosixPathInTitle -bool NO

Be warned…. this is probably dangerous, and will probably destroy your computer and kick your dog. You probably shouldn’t do this, but if you want to here is how:

Edit the /etc/auto_master file. You’ll need admin privileges to do this like so: sudo vi /etc/auto_master. All you need to do is comment out the line that starts /home by putting a pound sign (#) in front of it. When you are done, here’s how the file should look:

#
# Automounter master map
#
+auto_master         # Use directory service
/net             -hosts       -nobrowse,nosuid
#/home             auto_home     -nobrowse
/Network/Servers     -fstab
/-              -static

Once you do this, you need to restart your machine.

find /whatever/directory/here -type f -name “.DS_Store” -delete -print

for example:

find /Users/me/Documents/-Actionscript-Flash -type f -name “.DS_Store” -delete -print

or

find /home/vhosts/dev31 -type f -name “._*” -delete -print

Here are some subversion examples

find . -type d -name ‘.svn’ -print0 | xargs -0 rm -rdf

find ./ -name “.svn” | xargs rm -Rf

Yes I understand you can export to get rid of them. But there has been more than one occasion where I wanted to exactly this without purging thru subversion and I’m sure I’m not the only one that has ever wanted to… so here is how.

© 2012 James Border Suffusion theme by Sayontan Sinha