Even before we start, an explanation of the title: 'man pages' are the D UNIX manuals, already tucked away on your Mac. You can type "man < an style="font-style: italic;">command" in Terminal for a detailed (not to say overwhelming) rundown on any command-line tool. As we've mentioned before, an excellent intro to Terminal in Tiger can be found over at the O'Reilly Mac Dev Center. We also posted about Unix for the Begi ing Mage, an amusing begi er's guide to the plumbing under Mac OS X.
Our fine feathered friend today is 'ls' -- the UNIX directory list command. Read on for more...The 'ls' command will, in basic form, list the contents of a directory. Type 'ls ~/Desktop' sa quotes in Terminal, and get a readout of the files on your Desktop:
Last login: Mon Dec 18 00:02:44 on ttyp1"Cool bea ," you say, "but can't I do that from the Finder?" Ye but with some optio , 'ls' can:
Welcome to Darwin!
MTR-iMac-242:~ miker$ ls ~/Desktop
Desktop 20060904 MacHeist ?? Bundle Receipt.pdf
Desktop 20061217 TuneTalk.JPG
- list ALL the files in a directory: 'ls -a ~/Desktop' -- great for finding mystery file C.K. posted about this a while back
- give a detailed readout including permi io : 'ls -l' -- or combine with above for all the invisibles and all the permi io : 'ls -la'
- see the otherwise-hard-to-find ACLs for a directory or file: 'ls -e'
- sort the file list by modification date, most recent first: 'ls -t'
No comments:
Post a Comment