Linux Classroom notes 26/mar/2026

Linux Commands:

User & Permission Commands

whoami

Description: Print current username.
Syntax: whoami
Example:

$ whoami
developer

Common flags: None.


id

Description: Show user and group IDs.
Syntax: id [USER]
Example:

$ id
uid=1000(developer) gid=1000(developer) groups=1000(developer),27(sudo)

Common flags: -u, -g, -G, -n


chmod

Description: Change file permissions.
Syntax: chmod MODE FILE
Examples:

$ chmod 644 report.txt
$ ls -l report.txt
-rw-r--r-- 1 developer developer 1234 report.txt

$ chmod u+x,g-w script.sh
$ ls -l script.sh
-rwxr--r-- 1 developer developer 4321 script.sh

Common flags: -R, --reference=FILE


chown

Description: Change file owner/group.
Syntax: chown OWNER[:GROUP] FILE
Example:

$ sudo chown bob:dev report.txt
$ ls -l report.txt
-rw-r--r-- 1 bob dev 1234 report.txt

Common flags: -R


passwd

Description: Change a user’s password.
Syntax: passwd [USER]
Example:

$ passwd
Current password:
New password:
Retype new password:
passwd: password updated successfully

Common flags: -e, -l, -u


User Group Management

Create Users

Syntax:

sudo useradd -m -s /bin/bash USER
sudo adduser USER

Example:

$ sudo useradd -m -s /bin/bash dev1
$ sudo adduser dev2

Create Groups

$ sudo groupadd developers

Add User to Group

$ sudo usermod -aG developers developer

View Groups

$ groups developer
developer : developer sudo developers

Delete Users/Groups

$ sudo userdel -r dev1
$ sudo groupdel developers

Networking Commands

ping

Example:

$ ping -c 2 8.8.8.8
2 packets transmitted, 2 received, 0% packet loss

ip / ifconfig

$ ip addr show eth0
inet 192.168.1.10/24

$ ip route
default via 192.168.1.1 dev eth0

ssh

$ ssh -i ~/.ssh/id_ed25519 -p 2222 developer@server.example.com

scp

$ scp file.txt dev@s13.221.67.64:/home/dev/demo
$ scp developer@server:/var/log/syslog ./syslog

curl

$ curl -I https://example.com
$ curl -L -o page.html https://example.com

wget

$ wget https://example.com/file.tar.gz
$ wget -c https://example.com/large.iso

Summary

  • User management: whoami, id, chmod, chown, passwd\
  • Group management: useradd, groupadd, usermod\
  • Networking: ping, ssh, scp, sftp, curl, wget

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Wordpress Development Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube