![]() ![]() You can use the option -b and the output will show only the file type omitting the filename. Let’s see some other ways you can use it with its options. Here’s an example: :~/$ file cpluplus.cpp In its simplest form, you can use the file command with filename or path to file and it will show the type of the file. Now that you know the syntax let’s see how to use the file command. It has a simple syntax with only a few options: file filename The file command in Linux determines the actual type of a file, no matter what its extension is. The file command comes handy in such situations. You can choose to not use any extension at all. You can make sure of that by viewing the file content.īut the file extensions in Linux and Unix have no real meaning. How do you recognize the type of a file? Let me guess, by its extension, right? I mean if you see a file named MyData.csv, you guess that the file is in CSV format. What is the file command in Linux and Unix? Let’s talk about the file command in this article. You have also seen the command to delete file in Linux. You have seen commands to create file in Linux. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |