EDIT: This post have been getting very many views lately so ‘fess up in the comments if you want a part 2 with more advanced and new ways to use Mac OS X commands and wildcard characters.
This tip/post is going to be about several common Mac OS X commands and wildcard characters I have discovered, at work, that is useful to understand and know how to use. First off, wildcard characters are special characters such as * and ? that help you to find groups of filenames that have something in common.
For example, say I have a couple of files that I want to find in my home directory. My home directory is cluttered with junk files that I never take the time to organize. But somewhere within that junk pile of files there lay 8 files I would like. Their filenames are ssw_idl.a285, ssw_idl.r391, ssw_idl.z988, ssw_idl.c293, and the other 4 files are named similarly (“ssw_idl.” followed by a letter, then 3 numbers).
Open up terminal (or something similar like X11’s xterm) and type in
then enter. This lists all your files and folders in the current directory.
– changes directories (directories = folders). to go up a directory and to go to a folder in the current directory.
– deletes files/folders.
– makes directories (folders).
– computer says ‘Hello!’
– opens up a text file for viewing inside the command line/shell.
Now the actual reason I wrote up this post was to show you how to display only certain files with similar names. So we’ll go on to learn about wildcard characters (to be completely honest, I am a noob to this whole wildcard thing; I am stilling learning also), and then about how to use wildcard characters in the Mac OS X command line. Skip ahead if you already know about wildcard characters.
——– The Good Stuff ——-
– this star means “everything”.
will display all folders and all files within those folders.
– means any character. means any two characters. So basically will only display files/folders that have filenames 2 or more characters long.
– typing in any letters or numbers means that files/folders must have those exact letters/numbers.
– lists all files that are jpeg images (.jpg extension)
The “\.” (backslash then dot with no space, in case you couldn’t see it well) means a literal dot. No backslash before the dot would mean just any single character except for a new line (\n).
– lists files/folders starting with an “a”.
– lists only files because folders don’t have a dot in their name.
– lists only folders with a one character letter for their name.
– lists any files/folders starting with “frame” and then any 1 number.
A very nicely made reference page for Mac OS X Commands:
Any comments welcome! Show me something cool & new!