BTRFS can have crazy file names having :, \,

I renamed a folder to Avengers: Infinity War (2018)
I also created a folder Experiment:\
:smile:

CAUTION:
Don't do this if you are going to backup on NTFS or FAT drives!
If you try, do at your own risk!

2 Likes

You need to study up on what is a permissible file name. The standards are different for Linux and Windows. You are violating the naming rules of the file system you are writing to.

The same applies to file sizes for fat formatted drives, you will corrupt the drive if you try to copy a file larger than the file system supports. This isn't stuff you need to learn for Linux this is Windows rules you are breaking. As a Windows user you should know the rules for Windows file systems.
Better yet, just ditch the antiquated Windows file systems and you won't have to worry about the rules for Windows file names anymore.

3 Likes

This has nothing to do with Windows as I did this in Garuda which is in BTRFS partition.

I don’t have a Windows partition at all in my PC, it’s been around a year I ditched Windows from my computer. I just have a hard drive of NTFS format by default and it has so many stuff that I’m too lazy to copy them to other, reformat and then put them back.

2 Likes

For the most part, Linux filesystems allow you to use any naming. I don't know off the top of my head what is illegal, but it's not much.

1 Like

NTFS=Windows.

NTFS uses Windows naming conventions. You can write files on Linux with strange names, but if you try to transfer those illegal Windows file names to an NTFS drive then you will have real problems unless you mount the drive with the Windows file name flag.

You can find the info in man fstab or on the Archwiki.

3 Likes

Can I make an invisible file name w/ Unicode 1364

1 Like

Ya you’re right, that’s why I added this:

1 Like

Unicode 1364 is “” right? What is invisible here?

“⠀” is U+2800, I tried this too, so you can.

Again, at your own risk.

2 Likes

Oh and for the OP, you CAN do those commands in the terminal, you just need to understand escape character to do it (I tested to make sure).
mkdir "Experiment:\\"

2 Likes

Sorry I meant Unicode u + 1364, got very popular in among us because you could use it for blank names :slight_smile:

1 Like

Oh :hushed: ya, why didn’t it come to my brain :brain:
Edited my post.

1 Like

cool time to make a folder called

晪袃A沧gӁ񝆘Y|ᣥÜAƅԽ؋Гa݌괺ն勓QIݝ1򖡬モBٶ唚$﹩
#غ𑒑򑨼?먥(򑡬ﲀI谗Ѻ֖+խ:uėͼu򄵉统쩼ͅ򰣌򾲶Ѳ󯏖j܊b˒
ΰ𻓀򏝽CT򴤱󨍪4w񵢔򦴜&壘󮴽"؋囖🕣%M殑╭y󔸞օ֙ƝˮQ]
Ԡ䈾Ļ֑1QƔ󚁄Հ锶>덈޵唾fחH񡷱|ĕ*󩛽𜐬ݢޯ 󇆁牛ݰ啭󠩏󕓼
􋕿hԹ򭈋.򜍾ף߬چ񩄀򒖗⚇O^ Y񯨗󭽇ήʚ򲉏߀頧#ٕ畁󑆛𮚄຋ͭݙ
3 Likes

TL;DR: any character except / and null is allowed in filenames.

4 Likes

It’s been rather a pain for me at Forward Solidus Invalid In Filesystem Paths · Issue #46 · json5/json5-spec · GitHub. However, that’s not all the kernel disallows — . and .. are also, to my knowledge. It’s always seemed strange to me that we can’t just escape these characters to allow ourselves to be able to use them.

These are valid characters for file or directory names in Linux, and in fact are very commonly used. “.” is used for differentiating file extensions or marking hidden files, for example.

You can. You can escape characters with a backslash (\), or enclose the filename in quotation marks if it has invalid characters.

1 Like

@BluishHumility,

I meant as file names, not as characters.

I can’t escape the forward solidus with a backward one on BTRFS, and considering that we’re using BTRFS, there’s nothing except null and / to escape (unless using GIMP). All command line tools ignore it, and Dolphin converts it into another character, even when supposedly escaped.

Yes, these are valid characters for file names.

❯ touch "file.name..1.2.3.."
❯ ls "file.name..1.2.3.."
.rw-r--r-- 0 jeremy 13 Dec 10:31 file.name..1.2.3..

If you mean you are trying to name a file exactly.” or “..”, the reason that is not succeeding is because every directory is already using those names for something else.

You can escape characters with a backslash so they are not interpreted by the shell as an argument. This is commonly done with spaces, for example.

mkdir /path/to/directory\ with\ spaces

You cannot use a forward slash the way you are thinking, because the “/” character is reserved as a directory separator. That is to say, naming your file “file/with/slash.txt” is interpreted like this:

file/
  └── with/
      └── slash.txt

The forward slash should not be used in a file name with any filesystem–even if it is allowed–because most of the computers in the world will not interpret the file name as intended. That is why it is a disallowed character in pretty much any filesystem, even on Windows where directories are separated with another character.

By the way, there is nothing wrong with the word “null”; it is perfectly fine to use it in file names or directories.

❯ touch null
❯ ls null
.rw-r--r-- 0 jeremy 13 Dec 10:51 null

It is the null character which is not allowed.

5 Likes

Thank you for that, but I’m not looking for assistance. I was sharing with the thread exactly what you just more verbosely explained. You explained it all better than I did, though.

Well, aren’t you just the cat’s meow!

1 Like