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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lsattr: command not found

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}

If you encounter below error while running the lsattr command:

lsattr: command not found

you may install below package as per your choice of distribution:

Distribution Command
OS X brew install e2fsprogs
Debian apt-get install e2fsprogs
Ubuntu apt-get install e2fsprogs
Alpine apk add e2fsprogs
Arch Linux pacman -S e2fsprogs
Kali Linux apt-get install e2fsprogs
CentOS yum install e2fsprogs
Fedora dnf install e2fsprogs
Raspbian apt-get install e2fsprogs

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. Active FTP vs. Passive FTP
  2. duc: command not found
  3. lvresize command examples in Linux
  4. CentOS / RHEL 5 : How to disable device mapper multipath (dm-multipath)
  5. lftp: command not found
  6. How to Access VNC Server Through A Web Browser in CentOS/RHEL
  7. gdebi Command Examples in Linux
  8. kpartx: command not found
  9. How to Configure a Fiber-Channel Over Ethernet (FCoE) Interface in CentOS/RHEL
  10. Understanding Linux SCSI Reservation

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright