LinuxQuestions.org
Help answer threads with 0 replies.
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, 11:41 AM   #1
freeroute
Member
 
Registered: Jul 2016
Location: Hungary
Distribution: Debian
Posts: 69

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, 01:59 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,028

Rep: Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200Reputation: 3200
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, 02:08 PM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Fairly easy command:

Code:
grep -o ':.*$' | cut -c 2-
 
1 members found this post helpful.
Old 10-18-2016, 02:12 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326

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

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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, 02:42 PM   #6
freeroute
Member
 
Registered: Jul 2016
Location: Hungary
Distribution: Debian
Posts: 69

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 09:46 AM
shell script to remove tags lipun4u Linux - Newbie 3 12-05-2011 04:07 PM
Need to remove / (slash) and replace ; (semi-colon) with new line rakesh.bharad Linux - Newbie 2 05-06-2011 03:01 AM
After Editing Tags with JuK - XMMS do not display tags correctly Artik Linux - Software 0 07-23-2005 06:55 AM
Remove XML style tags using C kuronai Programming 8 11-12-2004 01:27 AM

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

All times are GMT -5. The time now is 01:03 PM.

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
Open Source Consulting | Domain Registration