Filename

Share

What's a File Name?

A filename (or file name) is the name a file has inside its folder, which is the last part of the filepath. For example, in the filepath C:\photos\tree.jpg, the filename would be tree.jpg. May also refer to the name of a folder has inside its parent folder, e.g. photos inside C:\. Sometimes, filename is used to refer to the entire filepath instead of only the last part.

A filename typically contains a file extension. For example, in the filename tree.jpg, the file extension is .jpg.

On Linux, there's a command called basename that displays the filename of a filepath, and can also remove the extension but only if you already know what's the extension of the file, e.g.:1

> basename /u/dee/desktop/cns.boo .boo
cns

References

  1. https://www.ibm.com/docs/en/aix/7.3?topic=b-basename-command (accessed 2024-05-21) ↩︎
Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments