top

Command Line Navigation Tutorial

A majority of Freesurfer tools are command-line based. This short tutorial touches upon a few basic command-line key sequences which helps navigating. You just need to open the terminal for this tutorial.

Movement

A typical command in a Freesurfer environment looks like the following. Type the following in your terminal and press Enter to view the current date.


date


For our illustration, we'll use the following command. Type this but don't press Enter. In fact, we won't use Enter anymore since we'll be operating on this single command.


mksurfer subject lh inflated


Now, the cursor will be at the end of the command. We notice that instead of tksurfer, we have typed mksurfer. The normal method would be to use the left arrow key to go to the beginning of the command and replace m with t. However, a faster way is to use Esc-b ( type Escape key and the b key in immediate succession ). This key takes your cursor one word back. Repeat the key sequence few times to go to the start of the command. The navigation in opposite direction is Esc-f which takes you one word forward. Shuttle between the beginning and the end a few times by taking word jumps.

A faster way is to simply use Ctrl-a which takes you to the beginning of the command directly. Use this to go to the beginning and change m to t. And it's counterpart Ctrl-e takes you to the end of the command. Shuttle between the two boundaries of the command a few times.

Ctrl-l is a special sequence which is used to clear the screen. It'll clear the screen and place your prompt and the command in the first line of the cleared screen. Press Ctrl-l now and clear the screen. Note that the command is still intact.

Mnemonics

Deletion

Now, go to the end of the command... Yes, Ctrl-e. You should be at the end of the word inflated. Suppose you want to view the white surface, you must replace inflated with white. Press Esc-Backspace to delete from the cursor to the start of the word. Type in white. Your command should look like this now:

tksurfer subject lh white

Suppose you want to view the right hemisphere - rh instead of lh. Try and go to the start of the word lh.. Yes, Esc-b two times. Press Esc-d to delete from the cursor to the end of the word. Type rh. Your command will look like

tksurfer subject rh white

Many times, you would want to delete characters till the end of the current line. Suppose you are between the words tksurfer and subject. ( Navigate there using the sequences.) You want to change the subject to sub1, rh to lh and white to pial, it's wiser to delete everything from the cursor position to the end of the command. Ctrl-k does just that. It kills everything from cursor to end. Try and delete till end of command and type such that your new command looks like:


tksurfer sub lh pial


Mnemonics

Think of the key Esc as a substitute for word. We have seen that Esc-b and Esc-f take you back and forward by one word respectively.

Notes

FsTutorial/CommandLineNavigation (last edited 2009-01-17 05:30:10 by KrishSubramaniam)