When I use a forward slash before a directory, it still works as when I omit it, does the forward slash matter at the end of a directory?

Does the forward slash matter at the end of a folder? According to this lesson?

For example,

cd 2014/jan/

as against

cd 2014/jan

No, doesn’t matter as far as I know

I generally include the forward slash, given I the tab key for auto-complete, which will include the forward slash

there are cases where it does matter though, lets say i have a directory:

mkdir my_dir

and then i make a symbolic link:

ln -s my_dir my_link

even though the link points to a directory, to remove the link, you can not include the slash:

rm my_link/ # error
rm my_link # works
4 Likes