BM Balmiki Mandal 04 May 2023 3 views 0 comments Linux

Using the Stat Command in Linux

Linux Stat Command

The Linux stat command allows you to view detailed information about files and directories. This can be useful if you want to quickly check the size, ownership, permissions, or modification times of a file or directory. The output from the stat command can also be used as input for other commands.

Syntax

The following is the basic syntax for the Linux stat command:

stat [options] [filename]

Options

  • -f: displays the output in a format suitable for use in shell scripts
  • -c: displays the output in raw csv format
  • -l: displays the output in long format, showing more detailed information
  • -t: displays the output in a terse format, only showing the most important info
  • -s: displays only the size of the file or directory

Examples

To view detailed information about a file named "test.txt", you could run the following command:

stat test.txt

To view the size of the file in bytes, you could use the following command:

stat -s test.txt

0 Comments

No comments yet, Be the first to comment.

Post a Comment

Please sign in to post a comment.

Related Posts

How to Create an Embedded Linux Development Environment on Windows Using WSL2

 Creating an Embedded Linux Development Environment on Windows Using WSL2If you are learning Embedded Linux, y...

AG Anvesh G 05 Sep 2026
Installing Ubuntu OS in Window Using VirtualBox

Installing Ubuntu on Windows Using VirtualBoxSteps:-1. Download and Install VirtualBox Download VirtualBox fr...

BM Balmiki Mandal 18 Jan 2025
Kali Linux 2021.4, Apple M1 support, armhf, arm64, Electro4u

Kali Linux 2021.4 Brings Improved Apple M1 Support Kali Linux, the world’s premier open-source penetration te...

BM Balmiki Mandal 06 Jun 2023