How to get ordered, defined or all columns except or after or before a given column
问题 In BASH I run the following one liner to get an individual column/field after splitting on a given character (one can use AWK as well if they want to split on more than one char i.e. on a word in any order, ok). #This will give me first column i.e. 'lori' i.e. first column/field/value after splitting the line / string on a character '-' here echo "lori-chuck-shenzi" | cut -d'-' -f1 # This will give me 'chuck' echo "lori-chuck-shenzi" | cut -d'-' -f2 # This will give me 'shenzi' echo "lori