File name is a name used to identify a file uniquely on given file system.
Questions tagged [filenames]
1203 questions
79
votes
14 answers
Unix file naming convention
I was wondering what is the naming convention for files in Unix? I am not sure about this, but I think there is perhaps a universal naming convention that one should follow?
For example, I want to name a file say: backup with part 2 and random…
user4740
39
votes
5 answers
Is space not allowed in a filename?
It is said that on Unix and Linux in general, you should avoid having spaces in a filename of a file (ordinary file, dir, link, device file, ...).
But I do that all the time. For a filename with a space inside,
In Nautilus, the space character is…

Tim
- 101,790
34
votes
7 answers
Is it considered a best practice to not use capital letters in file naming?
People say you shouldn't use spaces in Unix file naming. Are there good reasons to not use capital letters in file names (i.e., File_Name.txt vs. file_name.txt)? Or is this just a matter of personal preference?

DD343
- 399
17
votes
2 answers
What is the difference between .ini and .conf?
As mentioned, what is the difference? or is there any concern to use them?

A-letubby
- 709
- 2
- 6
- 6
12
votes
4 answers
Files with empty names
I was writing a widget for displaying files in a given directory and I wondered whether I need to cover the case where a file has an empty name.
Testing showed not obvious results, so I was wondering whether someone has definite information
$ touch…
10
votes
2 answers
passing filename with spaces to a shell script
The shellscript is very simple:
retroarch $* -c /tmp/retroarch/Data/retroarch/gambatte.cfg
("retroarch" is another shellscript)
If the filename passed contains spaces it fails:
RetroArch [ERROR] :: Could not read ROM file.

eadmaster
- 1,643
7
votes
2 answers
Use of file names ending with a period
Why does Unix allow files with a period at the end of the name? Is there any use for this?
For example:
filename.
I am asking because I have a simple function that echoes the extension of a file.
ext() {
echo ${1##*.}
}
But knowing it will print…

j--
- 437
6
votes
1 answer
Two dots (..) or two dashes (--) as a delimiter in the names of files and directories
Is it a good idea to use double dots or double minus signs as the delimiters? I'm trying to find a good naming convention for experimental scientific data. For…

andselisk
- 305
6
votes
6 answers
Find files whose basenames are the same, but their ext names are not
In a directory, how can we find all the files whose base names are the same, but their extension names are not? E.g. 0001.jpg and 0001.png and 0001.tiff, and 0002.jpg and 0002.png.

Tim
- 101,790
4
votes
2 answers
What is the file-naming convention for regular text files?
For regular *.txt text files that contain documentation and notes and such, and which are not READMEs, is there a Unix convention for naming them? Namely,
Should the filenames be all lowercase? camelcase? all caps?
Should words separated by…

dan
- 4,077
- 5
- 27
- 34
4
votes
2 answers
List all files with the same name and number of that files
I wonder if there is an easy command to list all files with the same names and number of that files? I would like to do it recursively and I do not mean concrete filename. I can imagine the output would look like this:
FILENAME NUMBER
filename1 …

Al Bundy
- 181
3
votes
1 answer
sort part of the name
I have multiple names that have the same prefix but the prefix is unknown.
I want to sort only by the digits in the name.
i.e
abcd_006-123
abcd_006-232
bbcd_w_006-112
so bbcd_w_006-112 should be the first
thanks

Dvi N
- 133
- 2
2
votes
1 answer
Why is my directory getting quotes around it when created?
I create a directory called bob@example.com/
I wanted to use this email address as the directory name - I know - not a good idea for many reasons - but lets assume this is a very temporary directory that I delete seconds later :)
I give the…

Michael Durrant
- 42,013
2
votes
1 answer
directories or files names separated by a dot
I'm going through the "Unix Programming Environment" book, and I don't get what the dot means in the follwing path :
/user/you/recipes.pie
Thanks in advance
EDIT: I meant "dot" instead of "colon", my bad.

loukios
- 135
2
votes
2 answers
Should all plain text files have some sort of suffix (e.g. *.txt, *.conf)
I create many notes in plain text files, but after a while the .txt suffix I put at the end of them seems to be unnecessary typing and visual noise. Is appending .txt to plain text files a strongly encouraged convention or just a suggestion?

dan
- 4,077
- 5
- 27
- 34