Ah. 
The seminal user command is "man man", where you'll learn of all the
man pages present on your machine... You could shortcut to "man find",
and see the options for the command. 

I didn't test the command, and including / it would browse all the
files on your computer, which might be an overkill. And if part of the
filesystem is mounted from other machines, it would read that too,
across the network... the owner might not like it.
Commands are subject to authorization rights, the name of the user
issuing it is an important parameter. Obviously Spotlight doesn't want
you to muck with its files.

You can try these commands, which locates in your home and searches it,
but only the local filesystem (not passing through links to attached
drives, network shares...):
Code:
--------------------
    cd ~
  find -x . -name "strings.txt"
  find: ./.emacs.d/auto-save-list: Permission denied
  find: ./.emacs.d: Permission denied
  find: ./.xxe/addon: Permission denied
  find: ./.xxe/preferences.properties: Permission denied
  find: ./.xxe/ser: Permission denied
  find: ./.xxe/spell: Permission denied
  find: ./.xxe: Permission denied
  ./Downloads/ContextMenu/strings.txt
  ./Downloads/ContextMenu-1/strings.txt
  ./Downloads/Email/strings.txt
  ./Downloads/ExecuteScript/strings.txt
  ./Downloads/FindArt/strings.txt
  ./Downloads/IRBlaster/strings.txt
  ./Downloads/SaverSwitcher-1/strings.txt
  ./Downloads/SrvrPowerCtrl/strings.txt
  ./Downloads/WOL-1/WOL/jive/strings.txt
  ./Library/Application Support/SqueezeCenter/Plugins/SrvrPowerCtrl/strings.txt
  ./Library/Caches/SlimServer/InstalledPlugins/Plugins/SuperDateTime/strings.txt
  ./Library/Caches/SlimServer/InstalledPlugins/Plugins/WeatherTime/strings.txt
--------------------

The first command (use ALT-n SPACE to get the ~ sign) locates you right
in your home dir. The second one starts from the current location (.)
and recursively looks for files named "strings.txt" (StRiNgS.tXt
would'nt match), but exclusively on the current drive (-x).
There are 2 types of output printed to the console: errors are spit out
when the command encounters protected directories; matches are printed
with the full path. Our WeatherTime file is there.

Starting from "/" you'd encounter a *lot* of errors, because "/" is the
realm of the system, it's not a place where a user is expected to fool
around. And as I said, specifying / means search the whole system, tens
of thousands of files, of which /Users/<your home> is only a tiny part.

Ok. You can probably become a user with administrative power, to allow
you to execute dangerous commands, or look where you're not supposed
to. The magic command is called "sudo". It requests your user password
to verify your identity as a user "with administrative rights", then
executes the command as the super-user. This is basically the
command-line version of the prompt requesting your password you get
when updating the system, or installing an application on the mac.
"sudo find / -x -name "WeatherTime" runs for ages and finally returns
this on my computer:

Code:
--------------------
    sudo find -x / -name "WeatherTime"
  Password: <my password>
  /Users/me/Library/Caches/SlimServer/InstalledPlugins/Plugins/WeatherTime
  
/Users/me/Library/Caches/SlimServer/InstalledPlugins/Plugins/WeatherTime/HTML/EN/plugins/WeatherTime
  
/Users/me/Library/Caches/SlimServer/templates/Users/me/Library/Caches/SlimServer/InstalledPlugins/Plugins/WeatherTime
  
--------------------

This time no error is output because the super user has the right to
search anywhere, and my filesystem is not broken.
You can interrupt commands by pressing CTRL-C in the command-line
window if you feel they're running for too long.

Don't horse around with sudo. You can wipe out your machine or disrupt
some network service pretty easily, as a super-user. There is no "undo"
or Trash Can to recover from an error.

This topic is getting out of control. And I shouldn't be the one giving
you a course in Unix and command shell anyway. 
If you're interested, you could look for a good book, as a general
recommendation I'd say the "For dummies" series, and O'Reilly's "in a
nutshell" series. 
The mac is has the outer personnality of a BSD system, plus specific
commands. A linux machine has the, well, linux personnality, which
relates more to Unix System V. 
Both are close cousins, if you have any taste for learning this kind of
stuff, you'll be surely able to reuse the knowledge on many machines. 
Even partly on windows, since it emulates a lot of those systems, just
a bit differently.


-- 
epoch1970
------------------------------------------------------------------------
epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711
View this thread: http://forums.slimdevices.com/showthread.php?t=61335

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to