How to view file timestamps?

QuestionsQuestions8 SkillsProDec, 10 2025
076

That's an excellent follow-up question! To view file timestamps, you can use the ls command with specific options.

The most common way to do this is with the -l and -t or -u options:

  1. ls -l (long listing format): This command shows a lot of information about files and directories, including their permissions, ownership, size, and the last modification time.

    ls -l example.txt
  2. ls -lu (last access time): To specifically show the last access time (when the file was last read or opened), you can use the -u option with -l.

    ls -lu example.txt
  3. stat command: For even more detailed information, including all three timestamps (access, modify, and change), the stat command is extremely useful.

    stat example.txt

Try one of these commands on the example.txt file you just created or touched, and you'll see how the timestamps are displayed!

0 Comments

no data
Be the first to share your comment!