Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use a valid email address as a linux directory name

I thought this would have been asked a million times already, but my search didn't turn up anything.

Can I safely use an email address as a linux directory name? In other words is any valid email address also a valid directory name? If not are there any characters in particular that I would have to filter first?

like image 443
themik81 Avatar asked Jun 03 '13 20:06

themik81


People also ask

Which is not a valid file name in Unix?

An empty string is the only truly invalid path name on Linux, which may work for you if you need only one invalid name. You could also use a string like " ///foo ", which would not be a canonical path name, although it could refer to a file (" /foo ").

What is a valid email address?

A valid email address consists of an email prefix and an email domain, both in acceptable formats. The prefix appears to the left of the @ symbol. The domain appears to the right of the @ symbol. For example, in the address [email protected], "example" is the email prefix, and "mail.com" is the email domain.


1 Answers

No, almost.

The '/' character is allowed in emails (http://en.wikipedia.org/wiki/Email_address#Syntax) but not in linux filenames.

See SO Answer here: Are there any invalid linux filenames?

like image 63
waldol1 Avatar answered Sep 21 '22 11:09

waldol1