What is double dot(..) and single dot(.) in Linux?
They are special name-inode maps which do count as hard-links (they do increase the link-count) though they aren't really hard-links, since, as you said, directories can't have hard-links. Read more here: Hard links and Unix file system nodes (inodes)
In unix, are dot and double dot path or directory?
A directory is logically a table used to map names to filesystem objects such as files or directories. Files can have multiple names and can be in multiple directories. The extra directory entries are links to the same file; the file itself is not duplicated. The same is true for directories. The '.' entry is a name which always maps to the directory that it is in. '..' maps to the parent, but in the case of the root directory it maps to itself.
Are the ‘dot’ and ‘dot dot’ files in Unix and Linux real files?
You are correct in your assumption. These files are merely there as an abstraction layer to navigate to and describe a resources location..
What does two dots before a slash mean? (../)
Each directory has two entries in it at the start, with names .
(a link to itself) and ..
(a link to its parent directory). The exception, of course, is the root directory, where the ..
directory also refers to the root directory.
remove double dots from a string and not the single dot using shell script
You can replace multiple dots with none:
sed -E 's/\.\.+//g'
Regarding the Single and the Double Dot within Directories
It's the same for both platforms (and web based programming)
.
represents the directory you are in and ..
represents the parent directory.
In HTML if you have a file e.g.: http://example.com/blog/index.html and you want to link to the image http://example.com/images/image.jpg you would put it in as such:
<img src="../images/image.jpg" />
As that tells the script to look in the PARENT directory and then images/image.jpg
.
Related Topics
Rename All Files in a Folder With a Prefix in a Single Command
Convert String to Hexadecimal on Command Line
How to Redirect Output to a File and Stdout
What Is the Meaning of "Posix"
Fastest Way to Find Lines of a File from Another Larger File in Bash
Is There Any API For Determining the Physical Address from Virtual Address in Linux
How to Remove ^[, and All of the Escape Sequences in a File Using Linux Shell Scripting
Automating Running Command on Linux from Windows Using Putty
How to Detect Invalid Utf8 Unicode/Binary in a Text File
Linux: Find File Names With 4 or 5 Characters
Iterate Over a List of Files With Spaces
Best Practices When Running Node.Js With Port 80 (Ubuntu/Linode)
Nasm Segmentation Fault on Ret in _Start
How Are the Fs/Gs Registers Used in Linux Amd64