How to Find a File Extension in Unix

All operating systems use file extensions to categorize files based on the types of programs they are used for. For example, in Windows, ".txt" files are opened with Notepad and ".doc" with Word. The same rule holds for operating systems derived from UNIX like Mac OS X and Linux. File extensions help you decide how to access the data in any file.

Instructions

    • 1

      Open a terminal if you are using a graphical desktop in Unix; otherwise, you will already be at a command line.

    • 2

      Navigate to a directory where you need to see file extensions.

    • 3

      Run the command "ls". This will list all the files in that directory. The file extensions are marked in the file name by the "." symbol, as in "list.txt" for a text file.

Tips & Warnings

  • You can use the "ls" command to list files with a certain extension as well. Using the format "ls *.<file extension>", you can list only files of a certain type. For example, to list all the ".txt" files in a directory, run the command "ls *.txt".

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured