The relative path is relative to the directory where the program is currently located, and the current directory continues to change as the program is executed.
#How to write the relative path in Linux?
Relative path:
The way to write the path is not to start with /. For example, when going from /usr/share/doc to the bottom of /usr/share/man, it can be written as: cd ../man This is how to write relative paths!
In the Linux file system, there are two special symbols that can also represent directories:
"." represents the current directory
".." indicates the upper-level directory of the current directory
Note: Although relative paths are flexible, they are not very safe. It is possible to miss or confuse the current directory. , causing an error. Therefore, you can use relative paths for personal operations, but the software installation directory must be correct. Absolute paths are the only wise choice.
The above is the detailed content of How to write relative path in linux?. For more information, please follow other related articles on the PHP Chinese website!

The article explains how to use regular expressions (regex) in Linux for pattern matching, file searching, and text manipulation, detailing syntax, commands, and tools like grep, sed, and awk.

The article discusses using top, htop, and vmstat for monitoring Linux system performance, detailing their unique features and customization options for effective system management.

The article provides a guide on setting up two-factor authentication (2FA) for SSH on Linux using Google Authenticator, detailing installation, configuration, and troubleshooting steps. It highlights the security benefits of 2FA, such as enhanced sec

This article compares SELinux and AppArmor, Linux kernel security modules providing mandatory access control. It details their configuration, highlighting the differences in approach (policy-based vs. profile-based) and potential performance impacts

This article details Linux system backup and restoration methods. It compares full system image backups with incremental backups, discusses optimal backup strategies (regularity, multiple locations, versioning, testing, security, rotation), and da

The article explains how to manage sudo privileges in Linux, including granting, revoking, and best practices for security. Key focus is on editing /etc/sudoers safely and limiting access.Character count: 159

This article compares Linux firewall configuration using firewalld and iptables. Firewalld offers a user-friendly interface for managing zones and services, while iptables provides low-level control via command-line manipulation of the netfilter fra

Article discusses managing software packages in Linux using apt, yum, and dnf, covering installation, updates, and removals. It compares their functionalities and suitability for different distributions.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1
Easy-to-use and free code editor

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
