To reboot your Linux machine, use the sudo reboot
command. Another way is to type sudo shutdown -r now
.
This command will also shut down your machine.
┌─[jason@darkstar]─[~] └──╼ $sudo init 0 |
Use this command to reboot your computer.
┌─[jason@darkstar]─[~] └──╼ $sudo init 6 |
To lookup the IP address of a host, use the nslookup command. For example: nslookup google.com
.
ubuntu@ip-172-31-20-234 ~ % nslookup google.com Server: 172.31.0.2 Address: 172.31.0.2#53 Non-authoritative answer: Name: google.com Address: 74.125.237.193 Name: google.com Address: 74.125.237.194 Name: google.com Address: 74.125.237.195 Name: google.com Address: 74.125.237.196 Name: google.com Address: 74.125.237.197 Name: google.com Address: 74.125.237.198 Name: google.com Address: 74.125.237.199 Name: google.com Address: 74.125.237.200 Name: google.com Address: 74.125.237.201 Name: google.com Address: 74.125.237.206 Name: google.com Address: 74.125.237.192 |
To add a user to a group, use the useradd
command. For example, this command will add the user homer to the technician`s group.
sudo useradd -G technicians homer |
To lock a user account and stop them logging in, use the passwd -l
command.
sudo passwd -l homer |
The example above will lock the user account homer.
The sudo passwd command may be used to change a users password. For example, the below command will change a password for the user homer.
sudo passwd homer |
Then type a new password for the user account.