Basics For FSL Users – The Command Line

When I started using FSL for DTI tractography, I was told that I needed to get off of the GUI and start using the command line for submitting “jobs” (tractography, segmentation, and other FSL functions). But without a basic understanding of using the command line, it wasn’t realistic to jump into complex FSL commands without knowing the basics of navigating the server. Below is a list of commands that I identified as most useful for myself and other workers in our lab. If you are starting out in the world of tractography, and like me, have little to no experience using the command line, you may find the commands below especially useful for getting started.

First, you’ll need to open your computer’s terminal program (in Mac, you can use X11 or Terminal) and then log in to the server you’ll be using. Your server administrator will set you up with a special command and login to access your server.  For tractography, it is most likely you will be running commands through a server, and not your local computer, since tractography is very computationally expensive.

Basic Terminal Commands

pwd                                              print working directory (tells you where you are)

ls                                                    list files

ls –l                                               list files in column format with date created/modified

cd foldername                           change directory to foldername (go into folder)

cd ..                                               move up one directory

mkdir foldername                    make directory/create a new directory or folder with your specified name

cat                                                 see what’s in a file (useful for waytotal files; “cat waytotal”)

mv filename1 filename 2        change the name of a file (from filename1 to filename2)

&                                                    use after commands to keep X11/terminal window active

qmon                                            open Grid Engine (program that tracks progress of fsl runs on your server)

Use the command line to access the underbelly of your computer/server.

FSL Commands in the Terminal

fsl                                                 open fsl

fslview filename                       open file in fslview

fslmaths                                     used to open multiple commands in fsl; to be covered in upcoming tutorials


One thought on “Basics For FSL Users – The Command Line

Your thoughts?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s