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.

#CommandWhat it shows
1uname -aKernel version, architecture, and hostname in one line
2hostnamectlHostname, OS, kernel, machine ID, and virtualization type
3lsb_release -aUbuntu version, codename (e.g. jammy, noble)
4uptimeHow long the system has been running and load averages
5whoamiYour current username
6idYour UID, GID, and all group memberships
7dateCurrent date and time
8timedatectlTimezone, 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.

#CommandWhat it does
9pwdPrint current working directory
10ls -laList files with permissions, owner, size, and modification time
11cd /etcChange to a directory (use cd - to go back)
12find /var/log -name "*.log"Find files matching a name pattern
13locate filenameFast file search using an index (run updatedb first)
14df -hDisk space used and available on each mounted filesystem
15du -sh /var/logTotal 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.

#CommandWhat it does
16cp -r /src /destCopy files or directories recursively
17mv file newnameMove or rename a file
18rm -i fileRemove with a confirmation prompt (safer than plain rm)
19mkdir -p /a/b/cCreate nested directories in one command
20touch file.txtCreate an empty file or update its timestamp
21ln -s /target /linkCreate a symbolic link
22tar -czf backup.tar.gz /etcCreate a compressed archive of a directory
23tar -xzf backup.tar.gzExtract 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.

#CommandWhat it does
24cat /etc/os-releasePrint entire file to the terminal
25less /var/log/syslogScroll through a file (press q to quit)
26head -n 20 fileShow the first 20 lines of a file
27tail -n 50 fileShow the last 50 lines of a file
28tail -f /var/log/syslogFollow a log file in real time (Ctrl+C to stop)
29grep -r "error" /var/log/Search for text across all files in a directory
30wc -l fileCount 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.

#CommandWhat it does
31chmod 755 script.shSet permissions: owner=rwx, group=rx, others=rx
32chmod 644 config.confSet permissions: owner=rw, group=r, others=r
33chown user:group fileChange file owner and group
34stat fileDetailed file info: permissions, owner, size, timestamps
35umaskShow 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.

#CommandWhat it does
36ps auxList all running processes with CPU and memory usage
37ps aux | grep nginxFind a specific process by name
38topInteractive real-time process monitor (q to quit)
39kill -9 PIDForce-terminate a process by its PID
40pkill nginxKill 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.

#CommandWhat it does
41systemctl status nginxShow service status, recent log lines, and active PIDs
42systemctl start nginxStart a stopped service
43systemctl restart nginxRestart a running service
44systemctl enable nginxEnable service to start automatically at boot
45journalctl -fu nginxFollow 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.

#CommandWhat it does
46ip aList all network interfaces and their IP addresses
47ss -tulpnShow all listening TCP/UDP ports with the owning process
48ping -c 4 8.8.8.8Test basic network connectivity (4 packets)
49curl -I https://example.comCheck HTTP response headers without downloading the body
50nslookup domain.comDNS 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 /home using ls -la and cd.
  • Find files: use find to locate all .conf files under /etc.
  • Check disk usage: identify which directory under /var is using the most space.
  • Read a live log: use tail -f on /var/log/syslog while 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.log for 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