Last active
November 8, 2017 17:44
-
-
Save ravnoor/b70651b75ec2ecda697b4dc3757898b8 to your computer and use it in GitHub Desktop.
list, sort and unique to get directory name from filenames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -1 | awk -F'_' '{print $1 $2}' | sort -u | |
# FLP_001_t2.nii | |
# FLP_001_t1_nii | |
# FLP_004_t2.nii | |
# FLP_004_t1.nii | |
# || | |
# || | |
# FLP_001 | |
# FLP_004 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment