LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to remove last tags after the colon from these hashes? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-remove-last-tags-after-the-colon-from-these-hashes-4175591661/)

freeroute 10-18-2016 10:41 AM

How to remove last tags after the colon from these hashes?
 
I would like to know which is the easiest way on unix terminal to remove last tags in these hashes?
So I need only after the colon (blackstorm, desire123, azsxdcfvgbhn)

Thank you in advance.


$5$rounds=7500$cJNFD+6EuP8Gv6sD$LIPpiqULXUzH7yypeHQFSeGmO5QyPmSGuyx/3XiqW17:blackstorm
$5$rounds=7500$I5Pzc1oB9WlbEdkI$is/LPDr.k6Orxp5Qc0gDDDb45IV5aYtfFDjIM7mTs8/:desire123
$5$rounds=7500$HQrhBBftG/qeSLoI$HhkdHN3eWi0e0Jv3vZsSjtA0vCWZzsceGCIt.oJGXOB:azsxdcfvgbhn

grail 10-18-2016 12:59 PM

What have you tried? If nothing, then I suggest searching the net, as here you are required to put in some effort.

szboardstretcher 10-18-2016 01:08 PM

Fairly easy command:

Code:

grep -o ':.*$' | cut -c 2-

schneidz 10-18-2016 01:12 PM

man awk.

szboardstretcher 10-18-2016 01:20 PM

Sed:
Code:

sed 's/.*://'
Awk, as requested:
Code:

awk -F: '{print $2}'
Cut
Code:

cut -f2 -d":"

freeroute 10-18-2016 01:42 PM

Thank you very much.


All times are GMT -5. The time now is 07:06 PM.