• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lsattr Command Examples in Linux

by admin

The lsattr command is used to list the attributes of a file or directory. The below table describes some of the options of the lsattr command.

Option Used To
-R Recursively list attributes of directories and their contents
-a List all files in a directory
-d List directories like files, instead of their contents
-v List version number of files

Syntax

The syntax of the lsattr command is:

# lsattr [options] {file/ directory names}

Listing the attributes of a file.

lsattr command examples in Linux

lsattr Command Examples

1. To Recursively list attributes of directories and their contents:

# lsattr -R 

2. To display the program version:

# lsattr -V 

3. To list all files in directories, including files that start with “.”:

# lsattr -a 

4. To list directories like other files, rather than listing their contents:

# lsattr -d 

5. To List the files version/generation number:

# lsattr -v 

Filed Under: Linux

Some more articles you might also be interested in …

  1. run-mailcap: command not found
  2. electron-packager: A tool used to build Electron app executables for Windows, Linux and macOS
  3. jcal Command Examples
  4. rpcinfo Command Examples in Linux
  5. How to Set Proxy Settings on Linux command line or Terminal
  6. box: A PHP application for building and managing Phars
  7. entr: Run arbitrary commands when files change
  8. mdadm Command Examples in Linux
  9. gobuster Command Examples
  10. lp Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright