Physical Address
Metro Manila, Philippines
Physical Address
Metro Manila, Philippines
ific distribution, we will explain the differences.
If you are completely new to Linux, we recommend reading our introductory guide, Linux Explained Simply, before proceeding.
You will need access to a Linux terminal.
You can follow this guide using Ubuntu, Debian, Fedora, Rocky Linux, AlmaLinux, or another modern Linux distribution.
Some commands require additional packages or administrative privileges.
Whenever you encounter sudo, remember that the command may execute with elevated permissions.
PinoyLinux Safety Reminder: Never execute an unfamiliar command on a production server without understanding what it does. Practice system-changing commands in a virtual machine or lab environment first.
Learning how to navigate the terminal is the foundation of working with Linux.
These first five tips will help you move around the file system, inspect directories, and find information about commands.
pwdHave you ever opened a terminal and wondered where you are in the Linux file system?
The pwd command displays your current working directory.
pwdExample output:
/home/pinoylinuxThis tells you that your current directory is /home/pinoylinux.
You will use this command when navigating unfamiliar servers, executing scripts, and managing files.
PinoyLinux Tip: Before running commands that modify files, check your current directory to avoid working in the wrong location.
The ls command lists files and directories.
For a more informative view, use:
ls -lahThe options mean:
| Option | Purpose |
|---|---|
-l | Display detailed file information. |
-a | Include hidden files. |
-h | Display file sizes in a human-readable format. |
Example output:
drwxr-xr-x 5 user user 4.0K Sep 25 10:00 .
drwxr-xr-x 3 root root 4.0K Sep 25 09:00 ..
-rw-r--r-- 1 user user 220 Sep 25 09:00 .bash_logout
-rw-r--r-- 1 user user 3.7K Sep 25 09:00 .bashrc
drwxr-xr-x 2 user user 4.0K Sep 25 09:30 DocumentsThis command helps you inspect file ownership, permissions, sizes, and modification dates.
It is particularly useful when troubleshooting permission problems.
The cd command changes your current directory.
Move into a specific directory:
cd /var/logReturn to your home directory:
cd ~Move one directory higher:
cd ..Return to your previous directory:
cd -The last example is useful when switching between two working directories.
For example, you might move between your application’s configuration directory and its log directory while troubleshooting.
Linux shells such as Bash keep a history of commands you execute, subject to your shell configuration.
Display your command history:
historySearch for previously executed SSH commands:
history | grep sshYou can also press:
Ctrl + RThen type part of a previous command.
Bash will search backward through your command history.
Press Enter to execute the selected command, or use the arrow keys to edit it first.
PinoyLinux Tip: Be careful when recalling commands that contain passwords or sensitive information. Shell history may retain commands containing credentials.
manYou do not need to memorize every Linux command.
Linux provides manual pages that explain command syntax, options, and behavior.
For example:
man lsOr:
man sshUse the arrow keys to navigate and press q to exit.
If you need a quick summary, many commands also support:
ls --helpNot every command supports --help, so manual pages remain an important reference.
Files are central to Linux administration.
Applications, configuration files, logs, scripts, and user data all depend on the file system.
These commands will help you locate, inspect, and manage them.
The find command searches directories based on conditions.
Suppose you need to locate an Nginx configuration file.
Run:
sudo find /etc -type f -name "nginx.conf"The options mean:
/etc is the starting directory.-type f searches for regular files.-name matches the filename.You can also search for log files:
find /var/log -type f -name "*.log"When to use it: When you know a filename but do not know where it is stored.
grepSometimes you know the content you are looking for but not the filename.
For example, you might need to find which Nginx configuration contains a particular domain.
sudo grep -Rni "example.com" /etc/nginx/The options mean:
| Option | Purpose |
|---|---|
-R | Search recursively. |
-n | Display line numbers. |
-i | Ignore letter case. |
This command searches the Nginx configuration directory for references to example.com.
It is useful when troubleshooting virtual hosts, configuration files, and application settings.
Avoid searching sensitive directories unnecessarily because results may expose credentials or other confidential information.
A filename extension does not always tell you what a file contains.
Linux provides the file command to inspect file content and identify its type.
file backup.tar.gzExample output:
backup.tar.gz: gzip compressed dataYou can also inspect an executable:
file /usr/bin/bashThe command can identify executable formats, scripts, images, archives, and other common file types.
PinoyLinux Tip: Use file when investigating an unfamiliar file rather than assuming its contents from the filename.
The cp command copies files and directories.
A basic example:
cp config.conf config.conf.backupThis creates a backup copy, but it can overwrite an existing destination file.
For an interactive confirmation when a destination exists, use:
cp -i config.conf config.conf.backupThe -i option asks for confirmation before overwriting.
For scripts, a different strategy may be appropriate because interactive prompts can interrupt automation.
When to use it: Before modifying configuration files or testing application settings.
The tar command creates and extracts archives.
Suppose you want to archive a website directory:
tar -czvf website-backup.tar.gz website/The options mean:
| Option | Purpose |
|---|---|
-c | Create an archive. |
-z | Compress using gzip. |
-v | Display processed files. |
-f | Specify the archive filename. |
Extract the archive:
tar -xzvf website-backup.tar.gzBefore extracting an unfamiliar archive, inspect its contents:
tar -tzvf website-backup.tar.gzPinoyLinux Tip: Creating an archive is not the same as maintaining a complete backup strategy. Important backups should be stored separately and tested for successful restoration.
When a Linux server becomes slow, stops responding, or runs out of storage, resource monitoring is usually one of the first troubleshooting steps.
These commands help you inspect system health.
The top command displays running processes and system resource usage.
topYou can inspect CPU activity, memory usage, process IDs, and running applications.
Press q to exit.
For a more interactive experience, some distributions provide htop.
On Ubuntu or Debian:
sudo apt install htopThen run:
htopUnlike top, htop may need to be installed separately.
Use:
free -hExample output:
total used free shared buff/cache available
Mem: 15Gi 4.2Gi 2.1Gi 320Mi 8.7Gi 10Gi
Swap: 4.0Gi 0B 4.0GiThe -h option displays values using readable units.
Pay particular attention to the available column.
Linux uses otherwise idle memory for caches, so a low value in the free column does not automatically mean your server is running out of memory.
When to use it: When investigating slow applications, memory pressure, or unexpected server behavior.
Use:
df -hThis displays storage usage for mounted file systems.
Example:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 98G 72G 21G 78% /A nearly full root file system can affect applications, databases, package updates, and logging.
You can inspect a specific file system:
df -h /PinoyLinux Tip: Check disk usage before large application deployments, database imports, and operating system upgrades.
The du command measures disk usage.
To inspect directories under /var:
sudo du -h --max-depth=1 /varTo sort the results by size:
sudo du -h --max-depth=1 /var | sort -hThis helps identify directories consuming storage.
Common locations worth investigating include:
/var/log
/var/cache
/var/lib
/homeDo not delete files simply because they consume substantial disk space.
Database files, container storage, and application data may be essential to running services.
The uptime command displays how long the system has been running.
uptimeExample output:
10:45:31 up 12 days, 4:22, 2 users, load average: 0.18, 0.25, 0.30The output includes system uptime and load averages.
Load average represents the average number of tasks that are runnable or waiting in uninterruptible sleep, typically associated with I/O.
A high load average does not automatically mean the CPU is overloaded.
For example, a server with 32 logical CPUs can handle a different level of runnable work from a server with two logical CPUs.
Investigate load average alongside CPU utilization, memory pressure, and I/O activity.
Applications running on Linux operate as processes.
Web servers, databases, background workers, and scheduled jobs may also be managed as system services.
Understanding these tools is essential for troubleshooting.
Use:
ps auxThis displays information about active processes.
To inspect a particular application:
ps aux | grep nginxA more targeted alternative is:
pgrep -a nginxThe second command displays matching process IDs and their command lines.
When to use it: When checking whether an application is running or identifying unexpected processes.
Run:
ps aux --sort=-%cpu | head -n 10This sorts the process list by reported CPU usage.
To investigate memory consumption:
ps aux --sort=-%mem | head -n 10These commands are useful when a monitoring system reports a resource spike.
However, ps provides a snapshot, not a continuous performance history.
For ongoing monitoring, use tools such as top, Prometheus, or another monitoring solution.
Sometimes an application cannot access or modify a file because another process is using it.
The lsof command lists open files.
For example:
sudo lsof /var/log/syslogYou can also inspect processes associated with a network port:
sudo lsof -i :443The tool may need to be installed separately:
sudo apt install lsofPinoyLinux Tip: Inspect the owning process before attempting to stop it. An unfamiliar process may belong to an important system service.
On distributions using systemd, systemctl manages system services.
Check Nginx:
systemctl status nginxCheck PostgreSQL:
systemctl status postgresqlTo restart Nginx:
sudo systemctl restart nginxA restart stops and starts the service, potentially interrupting active connections.
For Nginx configuration changes, validate the configuration first:
sudo nginx -tIf the test succeeds, you can request a configuration reload:
sudo systemctl reload nginxProduction Caution: Always understand the impact of restarting a service before doing so.
journalctlOn systems using systemd, journalctl provides access to journal logs.
Inspect Nginx logs:
sudo journalctl -u nginxFollow new log entries:
sudo journalctl -u nginx -fInspect logs from the current boot:
sudo journalctl -bView only recent entries:
sudo journalctl -n 50Logs help you understand why an application failed, when a service restarted, or what happened before an incident.
Networking is an important part of Linux administration.
Whether you are hosting a website, managing a database, or troubleshooting SSH access, these commands can help you identify connectivity problems.
Use:
ip link showThis displays the network interfaces recognized by Linux.
You might encounter names such as:
lo
eth0
ens18
enp1s0The actual names depend on your hardware, virtualization platform, and operating system configuration.
The ip command is part of the iproute2 networking utilities. man7.org
Run:
ip addr showFor a shorter output:
ip -br addrExample:
lo UNKNOWN 127.0.0.1/8
ens18 UP 192.168.1.100/24This helps identify which IP addresses are assigned to your interfaces.
If an application is unreachable, confirm that the server is using the expected IP address.
Use:
ip routeExample output:
default via 192.168.1.1 dev ens18
192.168.1.0/24 dev ens18 proto kernel scope linkThe default route determines where traffic is sent when no more specific route matches the destination.
You can also ask Linux which route it would use for a destination:
ip route get 8.8.8.8When to use it: When troubleshooting connectivity between servers, virtual machines, and different network segments.
One of the most useful Linux networking commands is:
sudo ss -tulnpThe options mean:
| Option | Purpose |
|---|---|
-t | Display TCP sockets. |
-u | Display UDP sockets. |
-l | Display listening sockets. |
-n | Display numerical addresses and ports. |
-p | Display process information where permitted. |
Suppose your Nginx service cannot start because port 443 is occupied.
Run:
sudo ss -tulnp '( sport = :443 )'The output may identify the process using that port.
This is a useful first step when troubleshooting web server conflicts.
Reference: Linux ss Manual.
DNS translates domain names into IP addresses and supports other services such as email routing.
The dig command helps you inspect DNS records.
Check an A record:
dig example.com ACheck an MX record:
dig example.com MXQuery a specific DNS resolver:
dig @1.1.1.1 example.com ADisplay a concise answer:
dig +short example.com APinoyLinux Tip: When a domain fails to resolve, compare responses from your configured resolver and a known public resolver. Differences can help identify caching, forwarding, or zone configuration problems.
Linux uses users, groups, and file permissions to control access to system resources.
Understanding these concepts is important when managing shared servers and applications.
Run:
whoamiExample:
pinoylinuxThis displays the effective username associated with your current session.
It is especially useful after switching accounts with su or opening a privileged shell.
Run:
idExample:
uid=1000(pinoylinux) gid=1000(pinoylinux) groups=1000(pinoylinux),27(sudo)The output shows your user ID, primary group, and supplementary groups.
To inspect another account:
id www-dataThis is useful when checking which account runs a web application and which groups it belongs to.
Use:
ls -lExample:
-rw-r----- 1 pinoylinux www-data 2048 Sep 25 config.confThe permission string is divided into three categories:
Owner | Group | Others
rw- | r-- | ---Linux uses three basic permission types:
| Permission | File Meaning |
|---|---|
Read (r) | Read file contents. |
Write (w) | Modify file contents. |
Execute (x) | Execute a file where applicable. |
For directories, these permissions have different access implications, particularly the execute permission, which allows directory traversal.
Understanding permissions helps you troubleshoot errors without granting excessive access.
The chmod command modifies file permissions.
For example:
chmod 600 private.confThis allows the file owner to read and write the file while removing access for the group and others.
For a script:
chmod 750 deploy.shThis gives the owner read, write, and execute permissions, while members of the file’s group receive read and execute permissions.
Security Reminder: Avoid using chmod 777 as a general solution to permission problems.
It grants read, write, and execute permissions to everyone, which can introduce unnecessary security risks.
The chown command changes file ownership.
Example:
sudo chown pinoylinux:pinoylinux config.confThis assigns the file to the specified user and group.
To inspect the result:
ls -l config.confOwnership problems commonly occur when files are created using sudo, copied between servers, or deployed by different service accounts.
Production Caution: Avoid recursively changing ownership of an application directory without checking its required permissions and service accounts.
A package manager installs, updates, and removes software.
Different Linux distributions use different package management tools.
The following examples use APT, which is common on Ubuntu and Debian.
Run:
sudo apt updateThis downloads updated package information from configured repositories.
It does not install the available updates.
The distinction is important because checking for updates and installing them are separate operations. Ubuntu
Use:
apt search nginxThis searches configured package repositories for packages matching the term.
To search for a particular utility:
apt search htopPackage searches help you identify software names before installation.
On Debian-based distributions, use:
dpkg -lTo find an installed package:
dpkg -l | grep nginxYou can also use:
apt list --installedThese commands help you confirm whether an application was installed through the operating system’s package manager.
Remember that software installed through Docker, npm, source compilation, or other methods may not appear in this list.
Use:
command -v nginxExample:
/usr/sbin/nginxThis tells you which executable or shell-resolved command would be used in the current environment.
You can also check:
command -v nodeThis is useful when troubleshooting multiple Node.js installations, Python environments, and conflicting executable paths.
Use:
apt show nginxThe output can include package version, dependencies, description, and other metadata.
Before installing an unfamiliar package, review its description and dependencies.
For example:
apt show postgresqlPinoyLinux Tip: On production servers, review software versions and dependencies before upgrading or installing packages. Package changes may affect running applications.
Linux administrators spend considerable time reading configuration files and logs.
These commands make text-based troubleshooting easier.
The grep command searches text for matching patterns.
For example:
grep -i "error" application.logSearch for HTTP 404 responses in an Nginx access log:
sudo grep '" 404 ' /var/log/nginx/access.logYou can also search recursively through a directory:
sudo grep -Rni "connection refused" /var/log/Use targeted searches when possible. Large log directories can generate substantial output.
Use:
tail -f application.logThis displays the end of a file and follows new lines as they are appended.
For an Nginx access log:
sudo tail -f /var/log/nginx/access.logPress Ctrl + C to stop.
You can also display a specified number of recent lines:
tail -n 100 application.logWhen to use it: During application deployments, troubleshooting, and live monitoring of an individual service.
awkThe awk command processes structured text.
For example, suppose a file contains:
alice 25
bob 30
charlie 28You can display only the first field:
awk '{print $1}' users.txtOutput:
alice
bob
charlieThis is useful when extracting fields from reports and command output.
For simple web server logs, awk can also help count requests by source IP, provided the log format is understood.
sedThe sed command can transform text.
For example:
echo "Hello Linux" | sed 's/Linux/PinoyLinux/'Output:
Hello PinoyLinuxTo preview replacements in a configuration file:
sed 's/old.example.com/new.example.com/g' config.confThis prints the transformed content without modifying the original file.
PinoyLinux Tip: Preview your changes before using sed -i, which modifies files in place.
Use:
wc application.logTo count only lines:
wc -l application.logThis can be useful for determining the number of entries in a file.
For example:
grep -c "ERROR" application.logThe second command counts matching lines containing ERROR.
It does not necessarily count individual error occurrences if multiple matches appear on one line.
SSH is one of the most important tools for managing Linux servers remotely.
It provides encrypted communication between your computer and a remote system.
These commands are useful for system administrators, developers, and DevOps engineers.
The basic SSH syntax is:
ssh username@server-ipExample:
ssh admin@192.0.2.10For a custom SSH port:
ssh -p 2222 admin@192.0.2.10The first time you connect, SSH may ask you to verify the server’s host key fingerprint.
Verify the fingerprint through a trusted source before accepting it.
This helps protect against connecting to an impersonated server.
SSH keys allow you to authenticate using public-key cryptography.
For a typical modern OpenSSH setup, generate an Ed25519 key:
ssh-keygen -t ed25519 -C "admin@example.com"Follow the prompts to select a filename and passphrase.
The command creates a private key and a corresponding public key.
For the default filename, these are commonly:
~/.ssh/id_ed25519
~/.ssh/id_ed25519.pubThe public key can be installed on a server.
The private key must remain confidential.
A passphrase adds protection if someone obtains a copy of the private key.
OpenSSH documents its supported key-generation options in the official manual: OpenSSH Manual Pages. OpenSSH
The scp command copies files between computers using SSH-based transport.
For example:
scp backup.tar.gz admin@192.0.2.10:/home/admin/To copy a file from the remote server:
scp admin@192.0.2.10:/home/admin/report.txt .The dot represents your current local directory.
Use SCP when transferring individual files or small collections between Linux systems.
For large or repeated transfers, rsync may be more appropriate.
The rsync command synchronizes files and directories.
For example:
rsync -avh website/ backup/The options mean:
| Option | Purpose |
|---|---|
-a | Archive mode. |
-v | Display transfer information. |
-h | Display readable file sizes. |
To synchronize with a remote server:
rsync -avh website/ admin@192.0.2.10:/home/admin/website/Before performing a transfer, preview the operation:
rsync -avhn website/ backup/The -n option performs a dry run.
Production Caution: Rsync’s --delete option can remove destination files that are absent from the source. Avoid using it until you fully understand the synchronization direction and have reviewed a dry run.
SSH can execute commands without opening an interactive shell.
For example:
ssh admin@192.0.2.10 "uptime"Or:
ssh admin@192.0.2.10 "df -h"You can inspect a remote service:
ssh admin@192.0.2.10 "systemctl status nginx --no-pager"This technique is useful when administering multiple servers and gathering system information.
For larger environments, configuration management tools such as Ansible can help manage repeated administrative tasks.
The final five tips focus on understanding your system, checking security configurations, and inspecting operating system status.
These activities should be part of regular Linux administration.
Run:
cat /etc/os-releaseExample output:
PRETTY_NAME="Ubuntu 24.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
ID=ubuntuThe exact output depends on your installed operating system.
Knowing the distribution and release is important when selecting installation instructions, repositories, and troubleshooting procedures.
Do not assume that commands designed for Ubuntu will work unchanged on Fedora or Rocky Linux.
Use:
uname -rThis displays the release identifier of the currently running kernel.
For additional system information:
uname -aKernel information is useful when troubleshooting drivers, hardware compatibility, and security updates.
Remember that the installed kernel package and the currently running kernel may differ if the system has not been rebooted after an update.
Different Linux distributions use different firewall management systems.
On Ubuntu, UFW is commonly used.
Check its status:
sudo ufw status verboseOn systems using firewalld:
sudo firewall-cmd --list-allYou may also encounter nftables:
sudo nft list rulesetThese tools do not necessarily describe every network security control affecting your server.
Cloud firewalls, network access control lists, and upstream security devices may enforce additional restrictions.
Production Caution: Never modify firewall rules on a remote server without confirming that your SSH management connection will remain accessible.
Accurate system time is important for logs, authentication, certificates, monitoring, and distributed applications.
On systems using systemd, run:
timedatectlExample output may include:
System clock synchronized: yes
NTP service: activeThe displayed fields depend on the system configuration.
You can also inspect the configured time synchronization service.
For systems using systemd-timesyncd:
systemctl status systemd-timesyncdOther systems may use Chrony or another NTP implementation.
PinoyLinux Tip: When comparing logs across multiple servers, confirm that their clocks are synchronized and account for differences in displayed time zones.
The final tip is useful when a server restarts unexpectedly or fails to start an application after rebooting.
Inspect logs from the current boot:
sudo journalctl -bDisplay warnings and more severe messages:
sudo journalctl -b -p warningList recorded boot sessions:
sudo journalctl --list-bootsInspect the previous boot, if its logs are available:
sudo journalctl -b -1Previous boot logs may be unavailable if journal persistence is disabled or older records have been removed.
When to use it: When investigating unexpected restarts, failed services, boot problems, and system errors.
Knowing commands is useful, but developing good administration habits matters just as much.
Here are five practices worth adopting.
Never copy and execute a command simply because you found it in a tutorial.
Understand what it does, which files it affects, and whether it requires elevated privileges.
Before changing important configurations, preserve the original files.
For example:
sudo cp -a /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backupFor production systems, maintain separate, tested backups instead of relying only on copies stored on the same server.
When an application fails, logs often provide useful information about the cause.
Before repeatedly restarting a service, inspect its status and relevant logs.
For example:
systemctl status nginxsudo journalctl -u nginx -n 100Understanding error messages will help you develop troubleshooting skills.
Create a Linux virtual machine and experiment with commands.
Install a web server, configure a database, create user accounts, and practice managing services.
You can also intentionally create simple problems in your lab and learn how to resolve them.
Never introduce these experiments into a production environment without authorization.
Keep a record of important configurations, commands, and troubleshooting procedures.
For example, document how you installed Nginx, configured HTTPS, or recovered a failed application.
These notes can become useful references for future incidents and recurring maintenance tasks.
They can also form the foundation of tutorials that you share with the Linux community.
No.
Focus on understanding what the commands do and where to find their documentation.
You will naturally remember the commands you use frequently.
Most basic commands work across modern Linux distributions.
However, package managers, firewall tools, service management systems, and installed utilities can differ.
Always check the documentation for your distribution.
Many of the inspection commands are read-only and suitable for routine troubleshooting.
However, commands that modify permissions, ownership, files, services, or packages can affect running applications.
Review their effects before executing them on a production system.
A useful next step is to study Bash scripting, Linux networking, systemd, SSH security, file permissions, and server administration.
If your goal is DevOps or cloud engineering, you can continue with Git, Docker, infrastructure automation, monitoring, and cloud platforms.
Linux is a practical skill.
The more you use it, the more familiar you become with its commands, utilities, and system behavior.
Start with the commands that are relevant to your daily tasks. Practice them, understand their output, and gradually introduce more advanced techniques.
If you are a student, a developer, a system administrator, or someone interested in open-source technology, you can continue your learning journey with PinoyLinux.
Explore our tutorials, technical guides, and community resources at PinoyLinux.org.
Have a Linux tip that helped you solve a difficult problem? Share it with the PinoyLinux community. Your experience might help another Filipino IT professional or student solve the same problem.