Correct filename prefix structure use with openSUSE?

Hi, there is alot of information on the Internet about file naming using Linux.
If ‘blanks’ are used in the name of the file < test file.txt
If ‘blanks’ are not used in the name of the file < test-file.txt
Which is the openSUSE way?
Which way is usable for the most filesystems?
Does always having example < test-file-test-file.txt > type names help anything?
-Thanks

@panorain which ever way you decide… I don’t use blanks generally (underscores and all lowercase), if you do use a space tab completion takes care of adding a \ for the space…

1 Like

There is no specific openSUSE way of giving names to files. It is the general way of Unix/Linux.

In fact all characters (nowadays all UTF-8 encoded Unicode characters) can be used in file names, except / (because that is used for separating levels in the path to the file mentioned) and a strong advice to not use the NULL character (x’00’ or U+0000) (because the null byte is used as a string terminator in some programming languages).

Apart from that, many people try to avoid characters that are special to the shell (at least the most common shells) because it avoids the need to escape them when used in shell commands. Most obvious here are Blank Space, Tab and New Line, but there are more.

BTW I do not know what you mean with “prefix structure”, thus the above is written ignoring that term.

1 Like

Whichever way you decide as long as the filesystem is concerned… BUT:

  • having space in a filename means that you have to escape it when using the CLI
  • some special files must have a type suffix (see *.conf files in a *.conf.d directory)
  • some tools expect a type suffix (see the following), others don’t (e.g. unrar)
bruno@LT-B:~/Downloads> zip -T eurofx

zip error: Nothing to do! (eurofx.zip)
bruno@LT-B:~/Downloads> zip -T eurofx.zip
test of eurofx.zip OK
bruno@LT-B:~/Downloads>
1 Like

Hi, I meaning (possibly/probably) incorrect that prefix structure is all prior to the . which separates, for instance the symbols/name < file > from < . > . Is that .called a placeholder?
My thinking is that < txt > is the suffix of the files name.
Explanation of my thinking when label of post created is that prefix is file.
Is this incorrect?
For some time I have < labeled-file-names-like-this.txt > example, when providing a screenshot or whatnot.

I am not familiar with this use of zipman zip < No manual entry for zip. Possibly man page is not installed, try online at: zip(1) — zip
That may well be a whole separate topic.
-Thanks for the information.

The man page is not installed on your system (possibly neither zip is…) but that was just an example, testing a correct zip archive that does not have the .zip suffix results in an error.
A few applications rely on type suffixes (maybe those were originally developed for Win* and then “translated” to Linux?) but most rely on the “file type” embedded in the first few bytes of the file content rather than on a suffix.

1 Like
1 Like

Notwithstanding the fact that many Linux users talk about “extension” (not you, you used “suffix”), there is in fact nothing like that. It is an MS-DOS term. In MS-DOS file systems there are two fields that specify the complete name of a file: the name and the extension. When shown, or typed the separator between those fields is a . (dot). They are NOT part of either the name or the extension (like the \ character is only to separate the components of the path, but are not in the file system itself.
These extensions are often interpreted by the operating system as denoting the type of the file (but as one can change those extensions rather easy, they can not be trusted upon).

In Unix/Linux you can have as many dots in the file name as you want. They are just normal characters. The operating system (Kernel) does not interpret these as special. But, maybe inspired by the example of the MS-DOS extensions, may people and programs use substrings at the end of a file name that start with a dot as an indication on the contents or MIME-type of the file. They are often called: suffix. But remind that it is only an agreement between people and/or programs (agreement with many or few).

I see here that many people name files that contain shell scripts with a suffix .sh . I see no need for it, except that the creator uses it to remind himself what it is.

And of course there is no guarantee that the contents and the suffix point to the same:

henk@boven:~/test/bestanden> l verf*
-rw-r--r-- 1 henk wij 157943 May 10  2013 verf.gif
-rw-r--r-- 1 henk wij 157943 May 10  2013 verf.jpeg
henk@boven:~/test/bestanden> file verf*
verf.gif:  JPEG image data, JFIF standard 1.01, resolution (DPI), density 150x150, segment length 16, baseline, precision 8, 1275x1753, frames 3
verf.jpeg: JPEG image data, JFIF standard 1.01, resolution (DPI), density 150x150, segment length 16, baseline, precision 8, 1275x1753, frames 3
henk@boven:~/test/bestanden>

BTW, many journalists have no idea when they report about ICT. They call everything after and including a dot an “extension”. I have even seen the top-level-domain of a full qualified domain called an “extension” (as in .org is the extension of forums.opensuse.org . :rofl:

1 Like

The information you provide causing me to reread and capture the content because it is very good. That’s awesome that you have actually witnessed this in the field. < I have even seen the top-level-domain of a full qualified domain called an “extension” (as in .org is the extension of forums.opensuse.org .
Thank you for sharing this. I will now go have coffee and think about it for a while. :grinning:
I feel dumb now.
I fit it in so no additional post from me is needed right now. :cold_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.