Skip to content

Instantly share code, notes, and snippets.

@tjoskar
Last active August 29, 2015 13:57
Show Gist options
  • Save tjoskar/9621726 to your computer and use it in GitHub Desktop.
Save tjoskar/9621726 to your computer and use it in GitHub Desktop.

UNIX (ubuntu) Commands

Remove gpg key.

$ sudo apt-key list
pub   1024R/B455BEF0 2010-07-29
uid                  Launchpad clicompanion-nightlies
$ sudo apt-key del B455BEF0

Enable the “Universe” repository

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"

Change current shell.

$ exec /bin/bash (temporarily)   
$ chsh -s /bin/bash (permanently)

Find out all available shells in the system.

$ cat /etc/shells

Get groups for user

$ groups root

Add group to user

$ usermod -aG group1 user1

Add user

$ useradd user1
$ passwd user1

Switch between users.

$ whoami
user1
$ su - user2
$ whoami
user2
$ su -
$ whoami
root

Show all users.

$ cat /etc/passwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment