CentOS Linux Server Guide

CentOS Linux Files and Directories

CentOS Linux Path

 

Path refers to the way/where which files and folders are stored. The are 2 kinds of path

 

Absolute Path

-specify entire the path/location of the file in detail.

 

As you can see from example below, we are specifying the entire path of the file location.
cat /demo/myDir/a.txt
testing 1 2 3
 

 

Relative Path

- only specify the location of the current directory

 

As you can see the example below, since we are /demo directory, we only need to specify the file path myDire/a.txt (which myDir is in /demo directory)

 

Another example below we show the content of filename:network by using ../etc/sysconfig/network.

 
pwd
/demo
cat myDir/a.txt
testing 1 2 3

cat ../etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=srv1.example.local

 

Back to Files and Directories



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy