Other operating systems use forward slashes for the same reason — it’s the Unix convention. Linux is a Unix-like operating system, so it uses the same type of slash.
Which way should the slash go?
A good way to remember the difference between a backslash and a forward slash is that a backslash leans backwards ( ), while a forward slash leans forward ( / ). In Windows, backslashes are used to separate directories in file paths (ex: C:Program FilesCommon Filesmicrosoft shared).
What is backslash used for in Linux?
A backslash at the end of a line in a shell script makes the shell ignore the newline for the purposes of executing the script. This is normally used to split long lines in a script file into multiple text lines, which will be handeled as a single script line by the shell.