First 50 Ubuntu Commands Every Administrator Should Know
These 50 commands cover the core operations you will perform daily on Ubuntu servers: checking system state, navigating the filesystem, managing files and processes, controlling services, and investigating network issues. Each command includes a practical example you can run immediately in a terminal.
System information
These commands answer the first questions when you sit down at an unfamiliar server: what is it running, who am I, and how long has it been up.
| # | Command | What it shows |
|---|---|---|
| 1 | uname -a | Kernel version, architecture, and hostname in one line |
| 2 | hostnamectl | Hostname, OS, kernel, machine ID, and virtualization type |
| 3 | lsb_release -a | Ubuntu version, codename (e.g. jammy, noble) |
| 4 | uptime | How long the system has been running and load averages |
| 5 | whoami | Your current username |
| 6 | id | Your UID, GID, and all group memberships |
| 7 | date | Current date and time |
| 8 | timedatectl | Timezone, NTP sync status, and hardware clock info |
uname -a
hostnamectl
lsb_release -a
uptime
whoami
id
date
timedatectl
File system navigation
These commands let you orient yourself in the filesystem, find files, and check how much disk space is used.
| # | Command | What it does |
|---|---|---|
| 9 | pwd | Print current working directory |
| 10 | ls -la | List files with permissions, owner, size, and modification time |
| 11 | cd /etc | Change to a directory (use cd - to go back) |
| 12 | find /var/log -name "*.log" | Find files matching a name pattern |
| 13 | locate filename | Fast file search using an index (run updatedb first) |
| 14 | df -h | Disk space used and available on each mounted filesystem |
| 15 | du -sh /var/log | Total disk usage of a specific directory |
pwd
ls -la /etc
cd /var/log
find /var/log -name "*.log" -mtime -1
df -h
du -sh /var/log/*
File operations
Creating, copying, moving, and archiving files are the most frequent file system tasks on a server.
| # | Command | What it does |
|---|---|---|
| 16 | cp -r /src /dest | Copy files or directories recursively |
| 17 | mv file newname | Move or rename a file |
| 18 | rm -i file | Remove with a confirmation prompt (safer than plain rm) |
| 19 | mkdir -p /a/b/c | Create nested directories in one command |
| 20 | touch file.txt | Create an empty file or update its timestamp |
| 21 | ln -s /target /link | Create a symbolic link |
| 22 | tar -czf backup.tar.gz /etc | Create a compressed archive of a directory |
| 23 | tar -xzf backup.tar.gz | Extract a compressed archive |
# Copy a config directory
cp -r /etc/nginx /tmp/nginx-backup
# Create a timestamped archive
tar -czf /tmp/etc-backup-$(date +%F).tar.gz /etc
# Extract to a specific directory
tar -xzf backup.tar.gz -C /tmp/restore/
Reading file content
Reading log files and configuration files is one of the most common daily tasks for an Ubuntu administrator.
| # | Command | What it does |
|---|---|---|
| 24 | cat /etc/os-release | Print entire file to the terminal |
| 25 | less /var/log/syslog | Scroll through a file (press q to quit) |
| 26 | head -n 20 file | Show the first 20 lines of a file |
| 27 | tail -n 50 file | Show the last 50 lines of a file |
| 28 | tail -f /var/log/syslog | Follow a log file in real time (Ctrl+C to stop) |
| 29 | grep -r "error" /var/log/ | Search for text across all files in a directory |
| 30 | wc -l file | Count the number of lines in a file |
# Show last 100 lines of auth log
tail -n 100 /var/log/auth.log
# Follow syslog in real time
tail -f /var/log/syslog
# Search for failed login attempts
grep "Failed password" /var/log/auth.log
# Count how many times an IP appears in a log
grep "192.168.1.100" /var/log/nginx/access.log | wc -l
Permissions and ownership
Understanding and setting file permissions is critical for both security and functionality on Ubuntu servers.
| # | Command | What it does |
|---|---|---|
| 31 | chmod 755 script.sh | Set permissions: owner=rwx, group=rx, others=rx |
| 32 | chmod 644 config.conf | Set permissions: owner=rw, group=r, others=r |
| 33 | chown user:group file | Change file owner and group |
| 34 | stat file | Detailed file info: permissions, owner, size, timestamps |
| 35 | umask | Show or set the default permission mask for new files |
# Make a script executable by owner only
chmod 700 /usr/local/bin/myscript.sh
# Set web root ownership to www-data
chown -R www-data:www-data /var/www/html
# View full permission details
stat /etc/passwd
# Check permissions in octal format
stat -c "%a %n" /etc/sudoers
Process management
Finding which processes are running and stopping ones that are misbehaving are regular server administration tasks.
| # | Command | What it does |
|---|---|---|
| 36 | ps aux | List all running processes with CPU and memory usage |
| 37 | ps aux | grep nginx | Find a specific process by name |
| 38 | top | Interactive real-time process monitor (q to quit) |
| 39 | kill -9 PID | Force-terminate a process by its PID |
| 40 | pkill nginx | Kill processes matching a name pattern |
# Find PID of a process
ps aux | grep sshd
# Kill a stuck process
kill -9 $(pgrep -f stuck-process)
# Show top 10 memory-consuming processes
ps aux --sort=-%mem | head -11
# Show processes owned by a user
ps -u www-data
Services and logs
Ubuntu uses systemd for service management. These commands cover the full service lifecycle and log inspection.
| # | Command | What it does |
|---|---|---|
| 41 | systemctl status nginx | Show service status, recent log lines, and active PIDs |
| 42 | systemctl start nginx | Start a stopped service |
| 43 | systemctl restart nginx | Restart a running service |
| 44 | systemctl enable nginx | Enable service to start automatically at boot |
| 45 | journalctl -fu nginx | Follow service logs in real time |
# Check all failed services
systemctl --failed
# See service logs since last boot
journalctl -b -u nginx
# Show last 50 error-level messages from any service
journalctl -p err -n 50 --no-pager
# Check if a service is enabled at boot
systemctl is-enabled ssh
Networking
These commands cover IP address inspection, open port discovery, connectivity testing, and DNS resolution.
| # | Command | What it does |
|---|---|---|
| 46 | ip a | List all network interfaces and their IP addresses |
| 47 | ss -tulpn | Show all listening TCP/UDP ports with the owning process |
| 48 | ping -c 4 8.8.8.8 | Test basic network connectivity (4 packets) |
| 49 | curl -I https://example.com | Check HTTP response headers without downloading the body |
| 50 | nslookup domain.com | DNS lookup: resolve a hostname to an IP address |
# Show IP addresses
ip a
# List all listening ports and owning services
ss -tulpn
# Test DNS resolution
nslookup google.com
# Check what process is using port 443
ss -tulpn | grep :443
# Test HTTP response from a server
curl -I http://localhost
Practice checklist
Work through this checklist on a fresh Ubuntu VM to build muscle memory with the 50 commands above:
- Check system info: run commands 1–8 and note the output on your test VM.
- Navigate the filesystem: explore
/etc,/var/log, and/homeusingls -laandcd. - Find files: use
findto locate all.conffiles under/etc. - Check disk usage: identify which directory under
/varis using the most space. - Read a live log: use
tail -fon/var/log/syslogwhile triggering a login in another window. - Manage a service: stop, start, and check the status of
ssh. - Inspect ports: identify which process is listening on port 22.
- Search file content: grep
/var/log/auth.logfor your own username.
Summary
These 50 commands cover the daily reality of Ubuntu server administration. Start with system information commands to orient yourself, use file navigation and content commands for investigation, control services with systemctl and journalctl, and use networking commands to diagnose connectivity. The most important habit is reading the output of every command carefully rather than just running it and moving on.
FAQ
Is First 50 Ubuntu Commands Every Administrator Should Know important for Ubuntu administrators?+
Yes. It supports practical Ubuntu administration because it connects directly to server reliability, security, troubleshooting, or daily operations.
Should I practice this on a live server?+
Use a lab VM first. After you understand the command output and rollback path, apply the workflow carefully on real systems.
What should I do after reading this article?+
Run the practice commands, write down what each one shows, and continue to the next article in the Ubuntu roadmap.
Need help with Ubuntu administration?
Work directly with Muhammad Irfan Aslam for Ubuntu Server, Linux, cloud, Docker, DevOps, CI/CD, or infrastructure troubleshooting support.
Hire Me for Support