Which Slash Is Used in Linux?

Which Slash Is Used in Linux?
Contents

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.

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.