commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
fcd : file change directory
A bash function that takes a fully qualified file path and cd's into the directory where it lives. Useful on the commadline when you have a file name in a variable and you'd like to cd to the directory to RCS check it in or look at other files associated with it.
Will run on any ksh, bash, likely sh, maybe zsh.
There are 5 alternatives - vote for the best!
Had trouble with the other function, because of missing semicolons. (According to my bash on OS X)
If you can do better, submit your command here.
You must be signed in to comment.