file information

Posted on 2014-02-26
Last Modified: 2014-10-15
what is the command to find the information about a file in linux

like last executed all info
Question by:thomasliju
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 77

Accepted Solution

slightwv (䄆 Netminder) earned 500 total points
ID: 39889681
>>find the information about a file

Other than when it was last executed, what are you looking for?

ls -al /path/file_name
will tell you permissions, owner, group, size, mod date.

>>like last executed all info

I don't believe there is anything out of the box that tells you that.

You would likely have to turn on auditing.

How you do that likely depends on what flavor of Linux you are using.
LVL 21

Expert Comment

ID: 39890036
You can use 'file' to determine file type or architecture. (32bit or x86_64).
LVL 84

Expert Comment

ID: 39890517
ls -ld file
stat file

on some systems
lsattr file
mdls file
LVL 13

Expert Comment

ID: 39892147
Use below command

#file <file>

#ls -laiZ<file>


Author Closing Comment

ID: 40383651
ls -al /path/file_name


Thank you.

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question