# Created on savesnippets.com · https://savesnippets.com/pnuL6bHgdnwRr6 arr=(a b c d e f g) echo "${arr[@]:2}" # c d e f g — from index 2 to end echo "${arr[@]:2:3}" # c d e — 3 elements starting at index 2 echo "${arr[@]:0:1}" # a — first element only echo "${arr[@]: -2}" # f g — last 2 (note the space before -)