After the adding the new HDD through settings in VMWARE workstation, the sdx are discovered through scanning the SCSI_Host. My question is that, in the following command how I can include globbing. Sometimes it happens that under the /sys/class/scsi_host/ folder there are almost 32 hosts. I need to scan through host0 to host31 sometimes.

echo "- - -" > /sys/class/scsi_host/host0/scan

I tried the following, but it doesn't work.

echo "- - -" > /sys/class/scsi_host/host*/scan

Any suggestions how I can use globbing here to scan the scsi_host in a single go. Environment: VMWARE Workstation 10 OS: RHEL 7

1 Answer 1


You can just repeat the echo for each file with a simple shell command, for example:

for file in /sys/class/scsi_host/host*/scan
do  echo "- - -" >$file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .