Live data from Hacker News

Quickly navigate your filesystem from the command line

jeroenjanssens.com

111–120 of 148 posts

Re: Quickly navigate your filesystem from the command line

#112

For Windows users I have a closely related shameless plug: cdhere navigates your cmd.exe to wherever the current topmost Explorer window is pointed at. It's not the same as the OP's trick, of course, but since you're voluntarily using Windows, I'm going to assume you "live" on the command line less than the average UNIX user, and more on GUI tools such as good old Explorer. https://github.com/eteeselink/cdhere

What many people don't seem to know is that the location bar in Explorer (at least on Windows 8) can act as a run dialog, and it supplies the launched program with the current folder as a parameter. So simply hit Ctrl+L and type "cmd" or "powershell" or whatever command from your PATH and hit enter.

Re: Quickly navigate your filesystem from the command line

#113

For Windows users I have a closely related shameless plug: cdhere navigates your cmd.exe to wherever the current topmost Explorer window is pointed at. It's not the same as the OP's trick, of course, but since you're voluntarily using Windows, I'm going to assume you "live" on the command line less than the average UNIX user, and more on GUI tools such as good old Explorer. https://github.com/eteeselink/cdhere

You can hold shift and right-click in Explorer and select "Open Command Window Here" (at least in Win 7 and 8).

Yep, this works fine, until you did it a 7th time and end up with a task bar full of unused console windows.

Re: Quickly navigate your filesystem from the command line

#114

I set my version up with a -f on the unmark rm so that I don't need to be prompted to remove it. Also added some basic completion for both jump and unmark export MARKPATH=$HOME/.marks function jump { cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1" } function mark { mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1 } function unmark { rm -if $MARKPATH/$1 } function marks { ls -l $MARKPATH | sed 's/ / /g' | cut -…

I recommend avoiding -f on rm if you can. Make one mistake and it can be painful. In this case think removing the -i from the unmark function will accomplish what you want. I made something to the OP's system for the same reason of disdain for super deep trees at work. I'll make a gist and edit this post with it in a few minutes. Edit: https://gist.github.com/desertmonad/6258429 I like the OP's idea of using symbolic…

Why not use unlink?

Re: Quickly navigate your filesystem from the command line

#115
post #102

For Windows users I have a closely related shameless plug: cdhere navigates your cmd.exe to wherever the current topmost Explorer window is pointed at. It's not the same as the OP's trick, of course, but since you're voluntarily using Windows, I'm going to assume you "live" on the command line less than the average UNIX user, and more on GUI tools such as good old Explorer. https://github.com/eteeselink/cdhere

Another useful windows trick: to open a new file explorer window at the pwd of the command prompt, type 'explorer .'.

or slightly shorter: 'start .'

Re: Quickly navigate your filesystem from the command line

#116
post #112

For Windows users I have a closely related shameless plug: cdhere navigates your cmd.exe to wherever the current topmost Explorer window is pointed at. It's not the same as the OP's trick, of course, but since you're voluntarily using Windows, I'm going to assume you "live" on the command line less than the average UNIX user, and more on GUI tools such as good old Explorer. https://github.com/eteeselink/cdhere

What many people don't seem to know is that the location bar in Explorer (at least on Windows 8) can act as a run dialog, and it supplies the launched program with the current folder as a parameter. So simply hit Ctrl+L and type "cmd" or "powershell" or whatever command from your PATH and hit enter.

Amazing tip!

FYI: On Windows 7, you need to press Alt+D to get to the location bar. (I believe that's the case for XP as well.) Ctrl+L doesn't seem to do anything.

Re: Quickly navigate your filesystem from the command line

#117
post #112

Earlier quoted context omitted.

What many people don't seem to know is that the location bar in Explorer (at least on Windows 8) can act as a run dialog, and it supplies the launched program with the current folder as a parameter. So simply hit Ctrl+L and type "cmd" or "powershell" or whatever command from your PATH and hit enter.

Amazing tip! FYI: On Windows 7, you need to press Alt+D to get to the location bar. (I believe that's the case for XP as well.) Ctrl+L doesn't seem to do anything.

Alt+D is my preferred shortcut anyway, since it has the same effect in e.g. fullscreen IE10. Consistency is nice.

Re: Quickly navigate your filesystem from the command line

#119

Earlier quoted context omitted.

Amazing tip! FYI: On Windows 7, you need to press Alt+D to get to the location bar. (I believe that's the case for XP as well.) Ctrl+L doesn't seem to do anything.

Alt+D is my preferred shortcut anyway, since it has the same effect in e.g. fullscreen IE10. Consistency is nice.

Totally. Also works in Chrome and Firefox.

Re: Quickly navigate your filesystem from the command line

#120
This is a very informative thread for people trying to streamline their daily shell experience. I'm looking forward to experimenting with the utilities mentioned here. I spend a significant amount of time in, and moving between CVS sandboxes. All my sandboxes have the same internal directory structure, but the root of the path changes. To speed up navigation time I created a tool to replace directory names with aliases. The aliases are persistent. They can also be "stacked", which allows you to specify a sandbox as an alias, then reuse your existing aliases to navigate within the sandbox. Auto-completion in the shell is an excellent companion as well. More information on "stacked.aliases", as well as the source can be found here: https://github.com/ttomaino/stacked_aliases/wiki. I include one example to illustrate:

As an example, the following two sandboxes contain the Broadcom Ethernet driver:

/build/username/sandbox_a/software/vendors/linux/linux-2.6.35.7/drivers/ethernet/broadcom /build/username/sandbox_b/software/vendors/linux/linux-2.6.35.7/drivers/ethernet/broadcom

Use the add alias command aa to create aliases for the sandboxes:

aa a /build/username/sandbox_a aa b /build/username/sandbox_b

Then create an alias for the Broadcom directory:

aa brcm software/vendors/linux/linux-2.6.35.7/drivers/ethernet/broadcom

To change to the Broadcom directory in sandbox_a, just stack the appropriate aliases using the ua command. Stacking is done by stringing the aliases together with a period delimiter:

ua a.brcm

To change to the Broadcom directory in sandbox_b:

ua b.brcm

Post reply on HN