Answers for "get last line of output bash"

1

bash get last field in line

Use rev command altogether with cut command as follows:
echo "a1 a2 a3 a4 a5" | rev | cut -d ' ' -f '1' | rev
#rev reverses string, then you cut from 2th field to end and reverse back
Posted by: Guest on November-10-2020
0

keep only last line bash

yourCommand | tail -n 1
Posted by: Guest on July-24-2021
0

displaying the last line of output bash

tail -1
Posted by: Guest on May-03-2022

Code answers related to "get last line of output bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language