useful commands Linux

Posted on 2014-11-26 10:58:46

1. Command about user 1.1. Create user và assign home directory

sudo useradd -d /home/<name user> -m <name user>

1.2. Add user to group

sudo usermod -a -G <name group> <name user>

1.3. Set default shell for user

chsh -s <url to shell> <name user>

Example: Set bash shell for hwuser:

chsh -s /bin/bash hwuser

2. Other commands 2.1. View info of package (Ubuntu)

sudo apt-cache show <name package>

2.2. Show info of url of command (Ubuntu)

whereis <name command>

ls: /bin/ls /usr/share/man/man1/ls.1.gz

2.3. View status of firewall (Ubuntu)

ufw status