🧠
BRIDGE Lab Documentation
  • BRIDGE Lab Documentation
  • 📘General
    • About Us
    • Onboarding
      • First Steps
      • Research Specialist Training
      • Project Coordinator Training
    • Misc
      • How to do misc things
      • Burning Scans to a Disc
      • Setting Up Meetings in the Conference Room
      • Printing
    • Imaging Glossary
  • 🖇️Admin
    • Ourday
    • Training
    • Regulatory
    • Social Media
    • REDCap
      • Archiving REDCap Projects
  • 🖥️Tech
    • Setting Up Meetings in the Conference Room
    • Effective Troubleshooting
    • Remote Work Resources
    • Arthur
    • Servers
      • Connecting to an External Server
    • Bash 101
      • What is Bash?
      • Bash Examples
      • How to add elements to your bash profile
    • git and Github
  • 🩻Image Acquisition
    • ViSTa
  • 🗃️Data Organization
    • BIDs Data Formatting
    • MRI Data Organization
  • 🖼️Image Analysis
    • Image QC
      • Raw Data QC
        • Diffusion QC
        • T1/T2 QC
        • ViSTa QC
        • Spectroscopy QC
      • PyDesigner QC
    • Project Lifecycle
    • General Concepts
    • Raw Data
    • Preprocessing
      • Denoising UNI MP2RAGE Images
      • PyDesigner
      • ViSTa
    • Native Space Analysis
      • TractSeg
        • TractSeg + Within-Subject Registration
      • Segmentation
        • LST
        • Freesurfer
        • NOMIS
    • Registration
      • DTI-TK
      • TBSS
      • Coordinate Systems
    • Other Pipelines
    • Archiving
  • 📊Data Viz and Stats
    • Plotting in R
  • 📚Imaging Library
Powered by GitBook
On this page
  1. Tech
  2. Bash 101

How to add elements to your bash profile

Last updated 1 year ago

In order to access software such as Freesurfer or FSL via your Terminal, it is first helpful to add these programs to your bash profile. This tells bash where the source codes for these programs live on your computer so that all you need to do is type specific commands into your terminal rather than entire paths to the code for each command.

As you can see in the example above, some pieces of software are set up to automatically add elements to your bash profile upon installation (such as MRtrix3). However, some elements need to be added manually.

You can do this by doing the following:

Open a terminal window

Type vi .bash_profile

When you see your bash profile open (which may be empty at first, type “i” (this stands for “insert” and will allow you to type things into the window that you will later save.

Start by adding a header to indicate which program you’re adding to your bash profile by using #. # at the beginning of a line indicates that a line is a comment and will not by read by any program as usable script. As you can see, I have headings for all programs beginning with # in my profile above.

Add whatever you need to add* dependent on the program. Typically, this will involve inputting export PATH=$PATH:/path-to-application/

Hit “Esc”, then “;” (the semi-colon), then “wq” (this stands for “write/save and quit”, then “enter”.

*If you are uncertain of what you need to add to your profile to get bash to recognize the program you want it to recognize, you can copy the lines in the example above based on the program in question. Or you can Google “add [program] to bash profile”

After you successfully add a program to your bash profile, you should be able to access all of the call-able commands the software offers. Such as “bet” or “flirt” from FSL or “recon-all” from Freesurfer.

Programs to consider adding to your bash profile: PyDesigner, FSL, MRIcroGL, Freesurfer, MRtrix3, or anything you will regularly call from your Terminal.

🖥️