Add current user to all groups on the system except “nobody/nogroup”

sudo usermod -G $(cat /etc/group | grep -v 65534 | cut -d\: -f1 | tr ‘\n’ ‘,’ | sed -e “s/\,$//) $USER
Breakdown of the subshell: cat /etc/group # contents of file containing all groups on the system grep -v 65534 # filter out the ‘nobody’ group cut -d\: -f1 # extract the group names themselves tr ‘\n’ ‘,’ # replace all new lines in the extracted output with commas sed -e “s/\,$//“ # remove trailing comma from the end of the output After rebooting, if you type the “groups” command, you’ll find yourself added to (almost) every group on the system.

What Others Think

0. Your quotes got convertered to inverted commas so that the comand fails as it was displayed here. 1. No reboot is necessary. Just start a new login shell. 2. The full command is missing a double quote for the final sed. 3. Useless cat. No need to specifiy "-e" for the sed 4. No need to escape the semicolon or comma 5. Assumes the GID for nobody is 65534. Not always true. 6. Assumes max number of groups per user is large enough to hold the result of this command. The Linux default (65536) is fine, but other OSs or NFS mounts are smaller (16 in many cases). 7. A group name might contain the substring '65534'. The grep found filter that out. Adding boundaries helps (grep -v ':65534:'), but you really want to filter on the 3rd field. 8. This one-liner filters on the 1st and 3rd fields. It doesn't check for empty fields (shouldn't happen), or check the total number of groups. sudo usermod -G "$(awk -F: '$3 != 65534 && $1 != "nobody" {printf "%s," $1}' /etc/group | sed 's/,$//')" "$USER" 9. I'd make a backup of /etc/group before doing this. 10. Why would you want to do this?
dana · 8 weeks and 1 day ago
Thanks for publishing this details. I simply wish to let you know that I just look into your site and also I locate it really fascinating and useful. cookie clicker
erdmanthurman · 8 weeks and 1 day ago
Good to see the post here. It is really informative for all since always they try to introduce a new command and their feature for us. SO that it is really helpful for us. Thanks a lot for sharing. diamonds rings near me
zaiyamariya · 8 weeks and 1 day ago
These core programming ethics help alot during solving some technical SEO problems. Being the head of SEO agency and content writing services, I am keenly interested in all these commands and programming shortcuts as sometimes we use to cut down the long yet useless line of codes in order to make the backend fully optimized!
amyjetson · 8 weeks ago
AHEC is an acronym for academic help and e-counseling. Established in 2017, AHEC has by far assisted over 15000 students across 4-5 continents— including countries such as UK, USA, Australia, UAE— and helped them obtain excellent grades. We live in a fast-paced world these days, and as a student, you may often get caught up with more activities than you can efficiently deal with. All of these activities demand equal attention, which is nearly impossible to give. Now, you can just sit back and relax, because AHEC is always there to help you. You can focus on activities that need your presence and delegate some tasks which you never thought could be delegated. AHEC is an India-based platform that offers academic help and e-counseling for undergraduate as well as for postgraduate students. We have a team of professional writers and online counselors & tutors who are considered estimable in their respective fields. Professional writers deliver plagiarism-free content, and counselors and tutors address your queries and offer the best solution to your problems related to academics. Visit us:- AHECounselling Contact us:- https://www.ahecounselling.com/contact-us Our Services:- https://www.ahecounselling.com/services Our Blogs:- https://www.ahecounselling.com/blogs
AHECounselling · 7 weeks and 6 days ago
Krogers Survey gives you the opportunity to win 50 fuel points. Kroger Feedback is an online website where people can get prizes of up to $5000. krogerfeedback
jonahhill · 7 weeks and 6 days ago
I am new here this is my website thanks.
jamesgist112 · 7 weeks and 5 days ago
Your post is very helpful and information is reliable. I am satisfied with your post. Thank you so much for sharing this wonderful post. https://carpetcleanercairns.com.au/
johnlead · 7 weeks and 3 days ago
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. ??????
toto808 · 7 weeks and 3 days ago
Fortune Jackets care for your fashion requirements. We uphold the premium quality jackets. Visit site Thanks. The Dark Knight Joker Goon Leather Jacket
MichelKong · 7 weeks and 2 days ago
Minel Socks, the wholesale sock sales site, worldwide
130000 · 7 weeks and 2 days ago
I was very encouraged to find this site. The reason being that this is such an informative post. Thanks for sharing! jersey shore home watch
Chaddychaddy · 7 weeks and 2 days ago
https://ariyanteb.com/shop/store-11 ariyanteb
Hfarshi · 7 weeks and 1 day ago
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. Android Final
Advaldoxp · 6 weeks and 4 days ago
Esse aqui é de notícias G7 Esse de tecnologia Android Final De Ouvir Músicas Spotify Premium APK de Tecnologia windows T2iD De portal de notícias Plu7 Fim, gostou?
Advaldoxp · 6 weeks and 4 days ago
Gotoassignmenthelp is team of leading professional writers for University assignment help Writing Services to students all around the world. Contact us today for Best best assignment help at very affordable price. Under GotoAssignmentHelp we provide many types of help to the students. We are the most reliable assignment helpers. We have gained our specialization after spending most of our times in making ourselves perfect. We providing 100% plagiarism free Assignment Help. At the point when you pick our academic assignment help assistance, our faculty will consider the quality and your evaluation criteria.
annybank2018 · 6 weeks and 4 days ago
Garmin express is an application that is used to manage, set up, and register the Garmin devices. It is helpful for users in installing all the software and map updates. Whenever new updates are available, it gives you notifications at the same time. Users can save their desired maps and locations with garmin.com express and can view the data on the navigation device. So, Garmin.com/express ensures quick and precise navigation.
Avaebrahim28 · 6 weeks and 1 day ago
because today you are a lot stronger than you were yesterday! check this link out private investigator lexington ky
TamaraYeo · 6 weeks ago
life is truly what you make it. so check this link out! kitchen remodeling honolulu
TamaraYeo · 6 weeks ago
do what makes you happy, so check this link out! hearing aids st augustine
TamaraYeo · 6 weeks ago
???? ????? ???? ?? ????? ????? ????? ???? ???? ????? ???? ??? ???? ???? ???? ????? ???????? ?? ???? ??? ??????? ?????? ????? ???? ????? ???? ?????? ??? ????? ???? ??????? ?? ???? ??? ??????? ?????? . ????? ???? ??????? ???? ?????? ??? ????? ???? ?? ?????? ?? ???? ??? ??????? ?????? . ????? ???? ?? ?????? ???? ?????? ??? ????? ???? ????? ?? ???? ??? ??????? ?????? . ????? ???? ????? ???? ?????? ??? ????? ???? ???????? ?? ???? ??? ??????? ?????? . ????? ???? ???????? ????? ???? ???? ????? ???? ???? ????? ???? ????? ????? ???? ?????
dewoweb · 5 weeks and 6 days ago
dewoweb (https://www.dewoweb.com) dewoweb (https://www.dewoweb.com/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d9%88%da%a9%d9%84%d8%a7) dewoweb (https://www.dewoweb.com/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d8%a7%d8%b1%d8%b2%d8%a7%d9%86) dewoweb (https://www.dewoweb.com/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d8%a7%d9%85%d9%84%d8%a7%da%a9) dewoweb (https://www.dewoweb.com/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d8%a7%d8%ae%d8%aa%d8%b5%d8%a7%d8%b5%db%8c) dewoweb (https://www.dewoweb.com/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d8%a8%d8%a7-%d9%88%d8%b1%d8%af%d9%be%d8%b1%d8%b3) dewoweb (https://www.dewoweb.com/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d8%b4%d8%b1%da%a9%d8%aa%db%8c) dewoweb (https://www.dewoweb.com/%d8%b7%d8%b1%d8%a7%d8%ad%db%8c-%d8%b3%d8%a7%db%8c%d8%aa-%d9%81%d8%b1%d9%88%d8%b4%da%af%d8%a7%d9%87%db%8c-4)
dewoweb · 5 weeks and 6 days ago
real estate web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design
dewoweb · 5 weeks and 6 days ago
real estate web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design
dewoweb · 5 weeks and 6 days ago
real estate web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design read me more plez click link web design
dewoweb · 5 weeks and 6 days ago
Secret issue dating locales are an incredible method for meeting an appealing accomplice privately and invest a charming energy. Internet dating is extremely well known today best sites for milfs since it opens up new freedoms for people. Free enlistment on the mysterious dating site requires just a few minutes, permitting wedded people to get comfortable covertly to meet their own objectives.
hostinark · 5 weeks and 2 days ago
Thanks for the information and for helping us every time. https://www.concretecontractorsstlouis.com
petersongame217 · 5 weeks and 1 day ago
BUY HIGH-QUALITY GRADE AA++MEDICAL MARIJUANA AND CANNABIS PRODUCTS ONLINE WhatsApp: +14154846196 https://420budmall.com Are you depressed, suffering from cancer, glaucoma, headache, insomnia, joint pains, multiple sclerosis, muscle cramps, nausea, etc, and need the best strains of medical marijuana and cannabis products to help ease your pain ?? You have reached the perfect destination with quality herbs that guarantee a good and healthy life. Buy carts online, Dispensary weed, Buy marijuana online, Order weed online, weed for sale, when you buy from 420budmall dispensary we do top discreet shipping and delivery to your address. Buy medical Marijuana Online. Buy thc products online, buy carts online. Buy wax shatter edibles, live resin, CBD oil etc Buy weed online cheap, Buy cannabis products online, Buy marijuana online weed shop, marijuana buds the flower is usually consumed by smoking or vaporizing you can buy marijuana flowers in pounds from our weed store @ 420budmall.com. We have exotic weed strains like the Runtz strain, Biscotti, LA pack boys, and many orders. Skunk weed for sale Buying weed online cheap has never been this easy with the help of 420budmall.com Weed shop, You can purchase marijuana flower buds Today. The marijuana industry has always revolved around deals, even when it was only in the black market realm. Marijuana for sale online cheap, Get the strongest marijuana products on sale at 420budmall.com marijuana online shopping for less, the highest quantity weed for the least money with the high level of competition in the cannabis market. Our marijuana dispensary is mainly focused to serve the world with the best quality marijuana and expand even further with new states starting medical and recreational programs as we will in no doubt create opportunities for everyone to be able to purchase weed online. Legit Online weed shop worldwide delivery - Marijuana for sale online cheap - Buy real kush online cheap -Purchase real weed online UK - Order real marijuana online Canada - Marijuana for sale - Marijuana dispensary shipping worldwide - Buy weed Online cheap - Legit weed dispensary shop in the USA, cheap weed online shop. Skunk weed for sale Mail order weed online UK Marijuana Dispensary USA deliveries, we deliver Mail Order marijuana products across UK, Ireland, EU, and worldwide. We offer a marijuana discreet shipping USA without being discovered. UK Mail Order Marijuana. Buy Weed Online USA and Enjoy our vast selection of craft cannabis flowers, edibles, and concentrates from the comfort of your own home! Our goal is to provide our clients with the most secure, reliable, and safe experience when you buy weed online cheap or mail order weed online with the fastest deliveries, Skunk weed for sale Skunk weed for sale also known as AAA weed, buy skunk weed online today and have it delivered at your doorstep. top-shelf exotic weed for. Buy real weed from 420budmall.com if you want to buy some weed or how to order weed, how to order weed online, AAA weed for sale online, kali weed, Skunk weed UK, buy hash online USA, how to get free, buy AAA weed or the best quality, UK Cali, UK Cali, Cali apparel UK, buy green crack online, are there girl scout cookies in England, Cali UK, is weed legal in England, buy kush edibles UK, is weed legal in Scotland, Buy Cannabis Products Online, buy sour diesel online, tko carts, death star og, is cheap weed ca legit cookies carts, death star og, 420 bud WhatsApp: +14154846196 Website: https://420budmall.com/ Email: watsonmuld@gmail.com
BUDMALL · 5 weeks ago
BUY HIGH-QUALITY GRADE AA++MEDICAL MARIJUANA AND CANNABIS PRODUCTS ONLINE WhatsApp: +14154846196 https://420budmall.com Are you depressed, suffering from cancer, glaucoma, headache, insomnia, joint pains, multiple sclerosis, muscle cramps, nausea, etc, and need the best strains of medical marijuana and cannabis products to help ease your pain ?? You have reached the perfect destination with quality herbs that guarantee a good and healthy life. Buy carts online, Dispensary weed, Buy marijuana online, Order weed online, weed for sale, when you buy from 420budmall dispensary we do top discreet shipping and delivery to your address. Buy medical Marijuana Online. Buy thc products online, buy carts online. Buy wax shatter edibles, live resin, CBD oil etc Buy weed online cheap, Buy cannabis products online, Buy marijuana online weed shop, marijuana buds the flower is usually consumed by smoking or vaporizing you can buy marijuana flowers in pounds from our weed store @ 420budmall.com. We have exotic weed strains like the Runtz strain, Biscotti, LA pack boys, and many orders. Skunk weed for sale Buying weed online cheap has never been this easy with the help of 420budmall.com Weed shop, You can purchase marijuana flower buds Today. The marijuana industry has always revolved around deals, even when it was only in the black market realm. Marijuana for sale online cheap, Get the strongest marijuana products on sale at 420budmall.com marijuana online shopping for less, the highest quantity weed for the least money with the high level of competition in the cannabis market. Our marijuana dispensary is mainly focused to serve the world with the best quality marijuana and expand even further with new states starting medical and recreational programs as we will in no doubt create opportunities for everyone to be able to purchase weed online. Legit Online weed shop worldwide delivery - Marijuana for sale online cheap - Buy real kush online cheap -Purchase real weed online UK - Order real marijuana online Canada - Marijuana for sale - Marijuana dispensary shipping worldwide - Buy weed Online cheap - Legit weed dispensary shop in the USA, cheap weed online shop. Skunk weed for sale Mail order weed online UK Marijuana Dispensary USA deliveries, we deliver Mail Order marijuana products across UK, Ireland, EU, and worldwide. We offer a marijuana discreet shipping USA without being discovered. UK Mail Order Marijuana. Buy Weed Online USA and Enjoy our vast selection of craft cannabis flowers, edibles, and concentrates from the comfort of your own home! Our goal is to provide our clients with the most secure, reliable, and safe experience when you buy weed online cheap or mail order weed online with the fastest deliveries, Skunk weed for sale Skunk weed for sale also known as AAA weed, buy skunk weed online today and have it delivered at your doorstep. top-shelf exotic weed for. Buy real weed from 420budmall.com if you want to buy some weed or how to order weed, how to order weed online, AAA weed for sale online, kali weed, Skunk weed UK, buy hash online USA, how to get free, buy AAA weed or the best quality, UK Cali, UK Cali, Cali apparel UK, buy green crack online, are there girl scout cookies in England, Cali UK, is weed legal in England, buy kush edibles UK, is weed legal in Scotland, Buy Cannabis Products Online, buy sour diesel online, tko carts, death star og, is cheap weed ca legit cookies carts, death star og, 420 bud WhatsApp: +14154846196 Website: https://420budmall.com/ Email: watsonmuld@gmail.com
BUDMALL · 5 weeks ago
5 Tips to Consider Before Buying a Kitchen Sink Here's how to find the kitchen sink of your dreams. Choosing a new kitchen sink is an investment that will completely change the look and function of your kitchen. From the right materials, the ideal size, to the great choice between a base or a sink, wenovin.com Here's everything you need to think about before buying a kitchen sink. 1. Consider the materials; When it comes to kitchen sinks, There are many materials to choose from: 2. Choice between built-in or surface; A sink falls into the counter, So there is a visible lip on the counter. 3. Choose the right size; wenovin.com You need to ask yourself a few questions when choosing a sink size. You want to consider the budget - in general, The bigger the sink, the higher the price. 4. Determine whether you need to adjust the cabinet or not; Consider your cabinets as a base for your sink. 5. Choose one side: one bowl or two bowls? wenovin.com Have you ever encountered someone who complains about the size of their sink? Yes, we did not think so. If you have space and money, consider a double bowl sink.
ramtinsaboori · 4 weeks and 6 days ago
https://medical-phd.blogspot.com/ https://ma-study.blogspot.com/
medicalphd · 4 weeks and 3 days ago
I appreciate the help and I hope you will help more people in need. Thanks! concrete work knoxville tn
johnrico022117 · 3 weeks and 6 days ago
????? ???
artin · 3 weeks ago
easytec https://easytec.info/
master1 · 2 weeks and 5 days ago
easytec
master1 · 2 weeks and 5 days ago
I truly value this superb post that you have accommodated us. I guarantee this would be helpful for a large portion of the general population. Call girl in allahabad
markcooper · 2 weeks and 5 days ago
Buy Psychedelics Online in USA here at your favorite psychedelics shop. Welcome to the BuyPsychedelicsUSA, The place for all your psychedelic drug and herbs. You’re at the right place to receive new experiences, insights, experiences. BuyPsychedelicsUSA has a large collection of products such as DMT, Magic Mushroom ,LSD , kratom, Ayahuasca and more . buy psychedelics online Take the time to see everything and don’t hesitate to contact us if you have questions or for advice. buy legal psychedelics online is usa uk and australia. buy dmt online buy lsd online buy ayahuasca online ibogaine for sale mdma for sale buy kratom online buy mescaline online buy mushroom online buy psychedelics online usa 4 ACO DMT For Sale Buy 5 MEO DMT Online buy dmt online NN DMT Erowid For Sale dmt vape pens for sale Changa DMT buy lsd gel tabs liquid lsd for sale buy lsd online buy psychedelics online Buy dmt online 5 meo dmt for sale 4-aco-dmt for sale dmt dose how to smoke dmt whats dmt making dmt 4aco dmt smooking dmt mushroom edibles magic mushroom chocolate how to make dmt how long does dmt last buy magic mushrooms online stiiizy pods buy magic mushrooms online Psychedelic Magic Mushrooms For Sale Online Where Can I get Psilocybin Mushroom Online What Are Psilocybins Mushroom buy magic mushrooms online shop dry magic mushroom buy mushroom capsules online shop psilocybin magic mushroom buy magic mushroom edibles buy thc carts online buy thc carts online THC Vapes Carts For Sale Buy Prefilled Vape Cartridges THC Vape Pens For Sale Best THC Vape Cartridge buy dmt online buy lsd online buy psychedelics online Buy dmt online 5 meo dmt for sale 4-aco-dmt for sale https://thcbulksupplies.com buy weed online buy stiiizy pods online buy marijuana online with worldwide shipping buy weed online usa buy weed online Weed For Sale Online in USA where to buy weed online Buying Weed Online Where To Buy Weed Online in USA Buy magic mushrooms Buy nembutal Online 4 aco dmt australia 4 aco dmt buy usa 4 aco dmt for sale 4 aco dmt supplier 4 aco dmt uk 5 meo dmt buy 5 meo dmt where to buy acid blotter paper ayahuasca tea canada Ayahuasca tea for sale buy 5 meo dmt Canada buy 5 meo dmt online Buy ayahuasca tea online Buy DMT Buy DMT online Buy DMT online Canada buy dmt online usa buy dmt vape pen buy liquid lsd Buy lsd Buy LSD acid Buy LSD Gel Tabs online buy lsd online buy LSD tabs online buy lysergic acid DMT for sale dmt pen dmt vape DMT Vape Pen DMT vape pen for sale online dmt vape pens DMT Vape Cartridge LSD acid for sale LSD blotter paper for sale LSD blotter sale lsd blotters for sale lsd for sale lsd for sale online lsd gel tabs lsd tabs for sale lysergic acid for sale Order ayahuasca tea online purchase ayahuasca tea Where can I buy 5-MeO-DMT online Where can I buy ayahuasca tea a href="https://thcbulksupplies.com/"rel="dofollow">buy weed online buy stiiizy pods online buy marijuana online with worldwide shipping buy marijuana edibles online smart bud moon rocks for sale buy cbd oil online dank vapes for sale order brass knuckles online stiiizy pod exotic carts moon rocks drugs buying weed online acdc weed granddaddy purple near me buy new york city diesel grape god strain buy 30 cannabis fat burner capsules buy marijuana flowers online buy sun rocks online buy red congolese live resin online buy pre-rolled joints online buy real weed onlin cheape buy sour diesel online mail order weed order marijuana online weed for sale pineapple punch strain backwood preroll where can i buy weed online buy weed online usa tko carts order weed online buy medical weed online buy weed online usa buy legal weed online where can i buy weed online can you buy weed online order marijuana online marathon-og buy psychedelics online in usa buy weed online in usa
snupdablogger · 1 week and 2 days ago
If you’re studying in a college or university in Sydney, you can take Sydney assignment help from Grow With Grades (GWG). We can write assignments for all college subjects. So, don’t waste your time and choose only the best.
growwithgrades · 1 week ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: