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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-18-2016, 11:41 AM
|
#1
|
Member
Registered: Jul 2016
Location: Hungary
Distribution: Debian
Posts: 69
Rep:
|
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
|
|
|
10-18-2016, 01:59 PM
|
#2
|
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,028
|
What have you tried? If nothing, then I suggest searching the net, as here you are required to put in some effort.
|
|
|
10-18-2016, 02:08 PM
|
#3
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Fairly easy command:
Code:
grep -o ':.*$' | cut -c 2-
|
|
1 members found this post helpful.
|
10-18-2016, 02:12 PM
|
#4
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
man awk.
|
|
1 members found this post helpful.
|
10-18-2016, 02:20 PM
|
#5
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Sed:
Awk, as requested:
Code:
awk -F: '{print $2}'
Cut
|
|
1 members found this post helpful.
|
10-18-2016, 02:42 PM
|
#6
|
Member
Registered: Jul 2016
Location: Hungary
Distribution: Debian
Posts: 69
Original Poster
Rep:
|
Thank you very much.
|
|
|
All times are GMT -5. The time now is 01:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|