CentOS Linux Server Guide

Centos Linux Files and Directories

File Naming Convention

 

File naming convention simple rules:

  • avoid special characters "$" "%" "#" etc.

  • avoid long file name is supported.

  • avoid empty space can be used.

To create file name with empty spacem you must issue \ backslash before space or enclose your filename in a quotation mark.
echo "I like Linux" > My\ Work\ Linux
 

ls -l
total 20
-rw-r--r-- 1 root root 0 Nov 28 10:01 A.txt
-rw-r--r-- 1 root root 16 Nov 28 11:17 My Work
-rw-r--r-- 1 root root 13 Nov 28 11:19 My Work Linux


echo "I like CentOS" > "My Work of Centos"
 

ls -l
total 28
-rw-r--r-- 1 root root 0 Nov 28 10:01 A.txt
-rw-r--r-- 1 root root 16 Nov 28 11:17 My Work
-rw-r--r-- 1 root root 13 Nov 28 11:19 My Work Linux
-rw-r--r-- 1 root root 14 Nov 28 11:21 My Work of Centos
 

 

To deal with empty space file, you must issue \ backslash before space or quoation mark too.
cat My\ Work\ Linux
I like Linux
 

cat "My Work of Centos"
I like CentOS
 

 

 

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