I often want to open the entire directory I'm working in by using the mate
command, but how do I pass in the working directory itself?
For example, if I'm working in a rails app and I want to open the app folder into the TextMate tree, I would do mate app
, but how could I pass in the working directory itself (i.e. open the entire rails app in the tree)?
Or you can using
mate $PWD/app
The current working directory as set by the cd command is available in shell variable
PWD
, e.g.The command you might be looking for is
Getting the current directory is as simple as typing
pwd
, orecho $PWD
.Now, if you want to open TextMate in a particular directory, you can do: