ShellSpells
  • 🧙‍♂️Welcome!
    • ShellSpells
    • FAQs
    • License & Disclaimer
  • 🐧Linux
    • System Ops
      • Transcripts
      • Help
      • System Info
        • Date/Time
        • System Details
        • Patches & Updates
        • Init System Identification
        • Hostname / Host ID
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Shares
        • Packages
        • Connected Devices
        • Kernel Modules (Drivers)
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Jobs
        • Enumerate
        • Modify
      • Processes
        • Enumerate
        • Modify
        • Custom Script and Shared Object
        • Process I/O Redirection
      • Services
        • Enumerate
        • Modify
        • Create a Service
      • Startup/Boot Scripts
        • Enumerate
        • Modify
      • Security
        • Antivirus
        • Firewall
        • SSH Keys
      • History & Logs
        • History
        • Logs
    • File Ops
      • Search
        • Filename
        • Content
        • Users (Owners)
        • Time
        • Size
        • Permission
        • Hidden Files
        • Inode
        • Find + Exec
        • Notes
      • Enumerate Metadata
      • Modify Metadata
      • Read Content
      • Modify Content
      • Extract Content
      • Sort / Compare / Count
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
    • Terminal Ops
      • Keyboard Shortcuts
      • Tmux Shortcuts
  • 🪟Windows
    • System Ops
      • Transcripts
      • Help
      • System Info
        • One-liners
        • Date/Time
        • System Details
        • Hotfixes
        • Domain or Workgroup
        • Data Execution Prevention
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Installed Software
        • Drivers
        • Shares
      • Registry
        • Enumerate
        • Modify
        • Forensically Relevant Keys
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Tasks
      • Processes
        • Enumerate
        • Modify
      • Services
        • Enumerate
        • Modify
      • Autorun / Startup
        • Enumerate
        • Modify
      • Security
        • Permissions
          • Enumerate
          • Page
        • Antivirus
        • Firewall
          • Enumerate
          • Modify
        • Audit Policies
        • Remoting
          • Enumerate
          • Modify
          • Registry Locations
        • Stored Credentials
      • Remote Command Execution
      • Active Directory
        • Enumerate
        • Modify
      • History & Logs
        • History
        • Logs
      • PowerShell Config
      • Scripting
      • WMIC Notes
    • File Ops
      • Search
        • Filename
        • Time
        • Size
        • Permissions
        • Attributes
        • Wildcarding
      • Enumerate Metadata
        • One Liners
        • Users (Owners)
        • Timestamps
        • Size
        • Permissions
        • Attributes
      • Modify Metadata
        • Change Owner
        • Timestamps
        • Size
        • Attributes
      • Read Content
      • Modify Content
        • Overwrite
        • Insert
        • Append
        • Replace / Remove
        • Convert Case
        • Alternate Data Streams
      • Extract Content
      • Sort / Compare / Count
        • Sort
        • Count
        • Compare
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
      • Output Formatting / Filtering
      • File Formatting
      • Operators
  • ⛓️Network
    • Traffic Manipulation
      • iptables
        • Option List
        • General Commands
        • Filter Tables
        • NAT
        • Mangle
        • Filter for SSH Traffic (Example)
      • nftables
    • Packet Capture
      • Syntax
      • TCPDump Examples
    • Packet Analysis
      • Wireshark
  • 🚗Maneuver
    • SSH
    • Control Sockets
    • RDP
    • Windows Port Proxy
  • 🛩️Data Transfer
    • SCP
    • FTP
    • Netcat
      • Netcat Relays
    • Server Interactions
    • Alternate Methods
  • 🪄REGEX
    • Examples
Powered by GitBook
On this page
  • All Commands
  • Identify USBs/External Storage
  • File Locations

Was this helpful?

  1. Linux
  2. System Ops
  3. Filesystem

Connected Devices

All Commands

mount

List Mounted Filesystems and Devices.

lsblk

List Block Devices and Their Partitions.

lsusb

List USB Devices and Hubs.

lspci

List PCI Devices (Peripheral Component Interconnect).

lsscsi

List SCSI Devices.

lsdev

List All Devices (AIX).

fdisk -l

List Partitions and Drives.

parted -l

List Partitions and Drives (with more details).

dmesg -H

Display Kernel Ring Buffer (includes device discovery messages).

udevadm info

Display Information about Devices Managed by Udev.

udevadm monitor

Monitor Udev Events for Device Changes.

ls /dev

List Device Files in the /dev Directory.

lshal

List HAL Devices (may need to be installed).

hwinfo --usb

Display USB Device Information (may need to be installed).

cat /proc/scsi/scsi

Display Information about SCSI Devices.

lspcmcia

List PCMCIA Devices (for systems with PCMCIA support).

df -h

Display Disk Usage and Free Space (includes mounted devices).

cat /proc/mounts

List Mounted Filesystems (alternative method).

blkid

Display Block Device Attributes, including UUIDs.

file -s /dev/<device>

Identify the Filesystem on a Device.

cat /proc/partitions

List Disk Partitions.

lsusb -t

Display USB Device Tree.

ls -l /sys/class/block

List Block Devices Using Sysfs.

usb-devices

List USB Devices and Their Details (may need to be installed).

lspcmcia -v

List PCMCIA Devices with Verbose Information.

ls /sys/class/hidraw

List HID (Human Interface Device) Raw Devices.

ls /sys/class/input

List Input Devices.

ls /sys/class/tty/ttyS*

List Serial (TTY) Devices.

lshw -class storage

List Storage Devices Using lshw (requires installation).

smartctl -i /dev/<device>

Display Information about SMART Capable Devices.

lsblk -f

List Block Devices and Their Filesystem Types.

lsblk -o +SIZE

List Block Devices and Their Sizes.

ls -l /dev/input

List Input Devices Using Device Files.

ls -l /dev/serial/*

List Serial Devices (alternative method).

cat /proc/asound/cards

List Sound Cards.

cat /proc/tty/drivers

List TTY (Terminal) Drivers and Devices.

cat /proc/bus/input/devices

List Input Devices and Their Capabilities.

udevadm trigger

Force Udev to Re-Enumerate Devices.

udevadm settle

Wait for Udev to Settle After Device Changes.

udevadm info -q all -n /dev/<device>

Retrieve Detailed Information for a Device.

cat /sys/class/hidraw/hidraw*/device/uevent

List HIDRAW Devices.

find /sys/class/ -name 'sd*'

List SCSI Disk Devices.

Identify USBs/External Storage

mount

List Mounted Filesystems and Devices.

dmesg | grep -i 'usb'

Display USB device-related messages in the kernel ring buffer.

dmesg | grep -i 'sd'

Display messages related to SCSI disks in the kernel ring buffer.

lsblk

List block devices and their partitions.

lsusb

List USB devices and hubs.

lsusb -t

Display USB Device Tree.

ls -l /dev/disk/by-id/

List disk devices by their unique IDs.

fdisk -l

List partitions and drives.

blkid

Display block device attributes, including UUIDs.

udevadm info -q all -n /dev/sdX

Retrieve detailed information about a specific block device.

File Locations

/dev/

Unix systems create device files in the /dev/ directory to represent connected devices.

/sys/

The /sys/ directory is a virtual filesystem that exposes information about connected devices and their attributes.

/proc/mounts

This file contains information about mounted filesystems, including external storage devices.

/proc/scsi/

Information about SCSI devices, including external storage devices, can be found in the /proc/scsi/ directory.

udev Rules

The udev subsystem manages devices and their associated information. Udev rules can be configured to perform actions when devices are connected or disconnected.

/var/log/

System log files, such as those located in /var/log/, may contain information about connected devices.

PreviousPackagesNextKernel Modules (Drivers)

Last updated 1 year ago

Was this helpful?

🐧