Useful Linux Listing Commands 98% of you might not know about.🧵↓
[1] lsd
The next gen ls command.
[2] exa
exa is a modern replacement for the venerable file-listing command-line program ls that comes with Unix and Linux operating systems, adding features and improving defaults.
[3] lsmem
The lsmem command displays the available memory ranges as well as their online status. The memory blocks listed correspond to the sysfs memory block representation.
The command also displays the memory block size as well as the amount of memory in both the online and offline states.
[4] lsusb
lsusb is a utility for displaying information about USB buses in the system and the devices connected to them. It uses udev's hardware database to associate a full human-readable name to the vendor ID and the product ID.
[5] lsb_release
provides certain LSB (Linux Standard Base) and distribution-specific information.
[6] lsfd
list the file descriptors On Linux systems, lsfd is intended to be a modern replacement for lsof. Unlike lsof, lsfd is tailored to the Linux kernel; it supports Linux-specific features such as namespaces while using less code.
lsfd is not a drop-in replacement for lsof; their command line interface and output formats differ.
[7] lsof
The command lsof stands for List Of Open Files. This command displays a list of files that have been opened. Essentially, it provides information to determine which files are opened by which process.
It can list a directory, a block special file, a shared library, a character special file, a regular pipe, a named pipe, an internet socket, a UNIX domain socket, and many other things. Here is an example listing LISTENING sockets.
[8] lscpu
gathers CPU architecture information from sysfs, /proc/cpuinfo, and any architecture-specific libraries that are applicable (e.g. librtas on Powerpc). The command output can be optimized for parsing or human readability.
The data includes the number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access (NUMA) nodes, among other things. There is also information about CPU caches and cache sharing, as well as the family, model, bogoMIPS, byte order, and stepping.
[9] lslogins
Displays information about known users in the system. It examines the wtmp and btmp logs, /etc/shadow (if necessary), and /passwd and outputs the desired data.
[10] lspci
A utility for displaying information about PCI buses in the system and devices connected to them. By default, it shows a brief list of devices. But you can use different options to request either a more verbose output or output intended for parsing by other programs.
[11] lsipc
shows the information on the System V inter-process communication facilities for which the calling process has read access.
[12] lslocks
lists information about all the currently held file locks in a Linux system.
It is worth noting that lslocks also list OFD (Open File Description) locks, which are not associated with any process (PID is -1). OFD locks are linked to the open file description from which they were obtained.
[13] lsmod
Show the status of modules in the Linux Kernel. lsmod is a simple program that nicely formats the contents of the /proc/modules directory, displaying which kernel modules are currently loaded.
[14] lsirq
Utility to display kernel interrupt information.
[15] lsns
The lsns command lists information about all currently accessible namespaces or a given namespace. A namespace identifier is an inode number.
[16] lstopo
lstopo command is used to show the topology of the system. It gives information about the NUMA memory nodes, shared caches, CPU packages, processor cores and threads, and much more.
[17] lsattr
lists the file attributes on a second extended file system.
[18] lsblk
Lsblk is used to display information about block devices, which are basically files that represent devices connected to the computer (except ram disk). Hard disks, flash drives, optical media, and other block devices are examples of block devices.
[19] lsinitramfs
lists the content of given initramfs images. It allows one to quickly check the content of one (or multiple) specified initramfs files.
Incase you don't know:
initramfs is a root filesystem embedded in the kernel and loaded early in the boot process. It is the heir to initrd. It provides early userspace, which can perform tasks that the kernel cannot easily perform during the boot process.
EXAMPLE
List initramfs content of current running kernel:
lsinitramfs /boot/initrd.img-$(uname -r)
That's it!
Thank you for making it this far. Hopefully, you will find this thread useful.
Additions are welcomed.
If you found this thread valuable:
1. Toss us a follow for more daily threads on Linux, sysadmin and DevOps → @linuxopsys
2. Like and RT the first tweet so other Linux folks can find it too.