If you’re using ext4, then the filename length is capped at 255bytes by default. Assuming you use only ASCII characters in the filename, each character takes 1byte. So, 255 characters max. If you use Unicode characters (eg. characters with diacritics, non-english languages, emojis etc) then single character will take more bytes.
The same goes for btrfs afaik.
Edit:
$ cat /usr/src/linux-lts/include/uapi/linux/limits.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_LIMITS_H
#define _UAPI_LINUX_LIMITS_H
#define NR_OPEN 1024
#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
#define LINK_MAX 127 /* # links a file may have */
#define MAX_CANON 255 /* size of the canonical input queue */
#define MAX_INPUT 255 /* size of the type-ahead buffer */
#define NAME_MAX 255 /* # chars in a file name */
#define PATH_MAX 4096 /* # chars in a path name including nul */
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
#define RTSIG_MAX 32
#endif
There’s also a maximum path length limit of 4096 characters.
I’m trying to make a “database” of files, manually, on EOS with EXT4, and some files seemed to have quite a long name, but they don’t reach 255, so that won’t be a problem.
I also have another question, what letters, signs or symbols are not allowed or recommended to name folders and files in EOS?
I mean, when I used Windows, there were many signs that I couldn’t put them in the names of files/folders/paths.
So I have seen on EOS that there are some hidden folders that have “.” in front of the name, so I guess if I rename a folder with “.” in front of the name, it will be hidden. So there must be some characters that I shouldn’t use in EOS for files/folders.
I have searched for info and Google says that in Linux you can use “all” characters unlike Windows, but I am not sure about this.
The folders/files I want to rename could have some strange characters and inside another folder with a name similar to this:
You cannot use a “/” in the file name because that is used as a directory delimiter in Linux. Technically you can use a “\”, but you would have to escape it first (so you would write it as “\\”). I would suggest just not using any slashes in your file name.
You can use spaces, but when you refer to them on the command line or in scripts you must escape the spaces with a “\” like this:
file\ name\ with\ spaces
Or quote the file name:
'file name with spaces'
You can use a period in a file name, but be aware the period also has specific meanings of its own–for example, to mark a hidden file like you mentioned, or to mark a file’s extension.
If “asd.qwe_123” and “25ce6c32-ca95-4e6a-b315-29a662a31e21” are directories, and “file.zip” is a file inside, then this is fine (except the “padding” spaces should not be in the path).
If that is meant to be all one long file name, it will cause issues unless you remove the slashes from it and use dashes (“-”) or something else instead.
Yes exactly, there are 2 folders, in this case, the first folder is the name of the music band or the creator of the file.
Inside is the second folder, which is named with that long number (knowing now the digit limit, I know that number is not too long and it is ok).
And inside the second folder, there is this zip file
Anyway, I’m going to remove any spaces or weird symbols in the name, since it seems that in general operating systems and many programs like Blender prefer names without spaces but with hyphens.