LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-18-2016, 10:41 AM   #1
freeroute
Member
 
Registered: Jul 2016
Location: Hungary
Distribution: Debian
Posts: 59

Rep: Reputation: Disabled
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
 
Old 10-18-2016, 12:59 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,544

Rep: Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898Reputation: 2898
What have you tried? If nothing, then I suggest searching the net, as here you are required to put in some effort.
 
Old 10-18-2016, 01:08 PM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
Fairly easy command:

Code:
grep -o ':.*$' | cut -c 2-
 
1 members found this post helpful.
Old 10-18-2016, 01:12 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,147

Rep: Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887
man awk.
 
1 members found this post helpful.
Old 10-18-2016, 01:20 PM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
Sed:
Code:
sed 's/.*://'
Awk, as requested:
Code:
awk -F: '{print $2}'
Cut
Code:
cut -f2 -d":"
 
1 members found this post helpful.
Old 10-18-2016, 01:42 PM   #6
freeroute
Member
 
Registered: Jul 2016
Location: Hungary
Distribution: Debian
Posts: 59

Original Poster
Rep: Reputation: Disabled
Thank you very much.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Remove html tags with particular string inside georgi Linux - Newbie 4 05-03-2012 08:46 AM
shell script to remove tags lipun4u Linux - Newbie 3 12-05-2011 03:07 PM
Need to remove / (slash) and replace ; (semi-colon) with new line rakesh.bharad Linux - Newbie 2 05-06-2011 02:01 AM
After Editing Tags with JuK - XMMS do not display tags correctly Artik Linux - Software 0 07-23-2005 05:55 AM
Remove XML style tags using C kuronai Programming 8 11-12-2004 12:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration