Last active
December 14, 2018 00:39
-
-
Save delphym/0d6ec4736ad129019d6fd57a6946fb05 to your computer and use it in GitHub Desktop.
MISC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Howto capture regexp group and print it | |
ll -1 | |
em110msp_1.0.13-10_release-unsigned.apk | |
em110msp_1.0.13-10_release-unsigned.json | |
# daniel@mcs-Ubuntu: | |
ls -1 | pcregrep -o2 "(.*)_(.*)_(.*)(.apk|.pom|.json)$" | |
1.0.13-10 | |
1.0.13-10 | |
### -o, --only-matching=n show only the part (#group) of the line that matched | |
### To list all users in 'sudo' and 'adm' group for usr in `sudo cat /etc/passwd | awk -F':' '{print $1}'`; do id $usr; done | grep sudo | grep -e "(adm)" | |
for usr in `sudo cat /etc/passwd | awk -F':' '{print $1}'`; do id $usr; done | grep sudo | grep -e "(adm)" | |
### To remove a user from sudo group | |
sudo deluser $usr sudo | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment