A list of useful commands involving the find tool.

Empty directories

Identify empty directories below the current directory

find . -type d -empty

Identify empty directories that have do not start with “.git”:

find . -path "./.git" -prune -o -type d -empty -print

See also: here

Show one’s own/other’s groups

groups
groups LOGIN

Show all groups on the system (with group id):

cat /etc/group | less

Create new group

groupadd GROUP

Add user to group

usermod -G GROUP -a USER

Assign a specific home directory and shell to a user

usermod -s /bin/bash USER
usermod -d /tmp USER

If the user shall only be allowed to do SCP/SFTP transfers, then an appropriate login shell is scponly.