What is the significance of the forward slash(/) while specifying a directory?
cp -av /dir/ /opt/
and
cp -av /dir /opt
Does effectively the same job it seems?
What is the significance of the forward slash(/) while specifying a directory?
cp -av /dir/ /opt/
and
cp -av /dir /opt
Does effectively the same job it seems?
directories are also treated as files in unix.
filenames are unique whether its a file or dir.
i dont think you need to provide "/" at all.
A forward slash seems to just be a default delimiter when it comes to the shell interpreting paths, something to be aware of when inserting variables into paths. For example: -
poweredge:/home/brad>cd /home//brad/bin
poweredge:/home/brad/bin>
So be mindful that if the variable is a null string the path will not cause an error if it still evaluates to a valid path.
poweredge:/home/brad>DIR=""
poweredge:/home/brad>cd /home/$DIR/brad/bin
poweredge:/home/brad/bin>