Skip to content

Instantly share code, notes, and snippets.

@slavafomin
Last active August 29, 2015 14:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slavafomin/426942c5f848a4bcb389 to your computer and use it in GitHub Desktop.
Save slavafomin/426942c5f848a4bcb389 to your computer and use it in GitHub Desktop.
Useful commands for Ubuntu

ACL

Remove all ACL entries

setfacl -R -b <path>

Archives related commands

Unzip a ZIP-file

apt-get install unzip

unzip <zip-file> -d <destination>

Locale related commands

Generate locales

locale-gen en_US en_US.UTF-8 ru_RU ru_RU.UTF-8

Misscelaneous commands

Start php5-fpm manually

/usr/sbin/php5-fpm --daemonize --fpm-config /etc/php5/fpm/php-fpm.conf

Ubuntu Networking

How to specify DNS servers?

Add the following line: dns-nameservers 8.8.8.8 8.8.4.4 to the: /etc/network/interfaces.

User related commands

Delete user

deluser <username>

Delete group

delgroup <groupname>

Create user (interactive mode)

adduser <username>

Allow user to issue sudo commands

usermod -a -G sudo <username>

Add existing user to an existing group

usermod -a -G <groupname> <username>

Disable root account

passwd -dl root

Run command as another user

sudo -H -u <username> bash -c 'echo "I am $USER, with uid $UID"'

Create a group

addgroup <groupname>

Delete user from group

deluser <username> <groupname>

Lock user account

passwd -l <username>

Unlock user account

passwd -u <username>

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