-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aidan Casey
committed
Dec 11, 2018
1 parent
46cae0b
commit 371cc07
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
# Today-I-Learned | ||
Based on https://github.com/mborn319/today-i-learned and https://github.com/jbranchaud/til. | ||
# Today I Learned | ||
|
||
Things I have learned over time, a reference for me and any who may stumble across this repository. | ||
|
||
## Categories | ||
|
||
* [Linux](#linux) | ||
|
||
## Linux | ||
|
||
* [Get a full list of Groups](linux/get-a-full-list-of-groups.md) | ||
* [List all members of a Group](linux/list-all-members-of-a-group.md) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Get a full list of Groups | ||
|
||
For an entire group list, use the following. | ||
|
||
```bash | ||
cut -d: -f1 /etc/group | sort | ||
``` | ||
|
||
[Found on StackOverflow](https://stackoverflow.com/questions/14059916/is-there-a-command-to-list-all-unix-group-names) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# List all members of a Group | ||
|
||
## To list members of a group | ||
|
||
```bash | ||
grep '{{groupName}}' /etc/group | ||
``` | ||
|
||
## To add some color | ||
|
||
```bash | ||
grep -i --color '{{groupName}}' /etc/group | ||
``` | ||
|
||
## To list only member names of a group | ||
|
||
```bash | ||
awk -F':' '/{{groupName}}/{print $4}' /etc/group | ||
``` | ||
|
||
[Found on CyberCiti](https://www.cyberciti.biz/faq/linux-list-all-members-of-a-group/) |