Hi,
It is possible that it isn't covered there, although I thought it was.
Anyway, the principle is that the star is a placeholder of a string (name) of any length.
So, for example, let's say that the following files existing in your directory:
myparams.txt struct.nii.gz vol0000.nii.gz vol0001.nii.gz vol0002.nii.gz vol0003.nii.gz
If you then typed:
ls vol*
it would become:
ls vol0000.nii.gz vol0001.nii.gz vol0002.nii.gz vol0003.nii.gz
Since the shell (terminal) will replace vol* with things starting with "vol" but ending with anything.
If you had instead done:
ls *.nii.gz
then if would become:
ls struct.nii.gz vol0000.nii.gz vol0001.nii.gz vol0002.nii.gz vol0003.nii.gz
as it would match names starting with anything but ending with ".nii.gz"
You can also have more than one, so that:
ls vol*2*.gz
would become
ls vol0002.nii.gz
Each star represents any sequence of letters and can be different from the other stars.
Also note that "ls" here is not special in any way. This would occur for any command that you typed into a terminal.
I hope this helps.
All the best,
Mark
I actually went through all those tutorials, but that is one of a few things I did not understand. I'l do some more digging, though.
Thank you!
Hi,
I am currently going through some tutorials provided by FSL, specifically the FSLUtils tutorial. I am working through a section that involves fslsplit/fslmerge, and I am confused on something the tutorial states. Here is an image on what the text
says:
https://imgur.com/a/jESfu72
(I know the image is small, but if you zoom in, it should look okay).
Basically, I am confused on the part that states "(note that the * is expanded by the terminal to fit any characters in all possible filenames present, and so can be used in any commands, not just ls, as we will see below)." I am honestly very confused as to
what this is trying to say. Any clarity would be fantastic!
This is something that is standard when using the shell (terminal) in unix (or linux or mac). If you have not come across this type of wildmasking then I strongly recommend that you go through the Unix section of our preparatory materials (see
http://fsl.fmrib.ox.ac.uk/fslcourse/ ).
You should also find the introductory lecture helpful and would also benefit from the introductory textbook that we've written, aimed at people new the field and those who are taking the FSL Course:
http://www.neuroimagingprimers.org/
All the best,
Mark