LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to show file extensions (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-show-file-extensions-4175417242/)

mattjjs 07-17-2012 02:03 PM

how to show file extensions
 
Hi ,

sorry if this is a stupid question but is there a way to show the file extensions for files within a certain directory?

Many Thanks,

Matt

pan64 07-17-2012 02:07 PM

sure, there is a way, for example ls will show it to you, also gnome commander can do that. But actually you need to say what program are you using....

mattjjs 07-17-2012 02:09 PM

hey sorry im using centos 6.2,

thanks again.

kbscores 07-17-2012 02:10 PM

File extensions should already show. Like if you are looking for .jar file it will say .jar if you ls the directory. Linux doesn't hide file extensions like Windows does or at least Red Hat doesn't.

You can see what type of file it is by using -F. It will put a symbol or in the case of a plain file it will put nothing.
@ - symbolic link
\ - directory
* - executable

or if you do a long listing on a directory you will see on the permissions whether it is directory or not. ls -l

Lachek 07-17-2012 02:30 PM

What file manager are you using to view the files? Previous answers have focused on viewing directory listings using the 'ls' command in the shell ("Terminal"), but you may be using Metacity or some other file manager. If you're using stock CentOS 6.2 you're probably running the Gnome 2.28 window manager which comes with Metacity as the default file manager. Metacity should show file extensions by default, though. Can you double-check and clarify what file manager you're using?

frankbell 07-17-2012 08:47 PM

Also, if you are looking in a directory containing executable files, such as /usr/bin, note that executable files in Linux normally have no file extensions.

grail 07-18-2012 02:12 AM

Depending on how new to linux you are, the question you are asking may be a little more left of centre if you are only used to Windows. As stated by frankbell above, linux is not driven
by file extensions like Windows is. In fact file extensions are used mainly by humans to know what data is in a file and not by the system. (not sure if that helps at all)


All times are GMT -5. The time now is 07:52 PM.