Skip to content

Instantly share code, notes, and snippets.

@adamveld12
Last active August 29, 2015 14:27
Show Gist options
  • Save adamveld12/a9be08f211a6b19e699d to your computer and use it in GitHub Desktop.
Save adamveld12/a9be08f211a6b19e699d to your computer and use it in GitHub Desktop.
Linux terminal crap

To see disk size: df

To list all users you can use:

cut -d: -f1 /etc/passwd

To add a new user you can use:

sudo adduser new_username or: sudo useradd new_username

See also: What is the difference between adduser and useradd?

To remove/delete a user, first you can use: sudo userdel username

Then you may want to delete the home directory for the deleted user account :

sudo rm -r /home/username (Please use with caution this command!)

To modify the username of a user:

usermod -l new_username old_username

To change the password for a user:

sudo passwd username

To change the shell for a user:

sudo chsh username

To change the details for a user (for example real name):

sudo chfn username

Be sure to read the man pages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment