简体   繁体   中英

“ls” with regex multiple times

I am trying to do next two commands on one line:

ls -lh  /etc/pki/tls/certs/dom*
ls -lh  /etc/pki/tls/certs/cen*

I tried something like next but it does not work:

ls -lh  /etc/pki/tls/certs/cen*|dom*
ls -lh  /etc/pki/tls/certs/[cen*|dom*]
ls -lh  /etc/pki/tls/certs/{cen*|dom*}

Is next the only way?:

ls -lh  /etc/pki/tls/certs/cen*  &&  ls -lh  /etc/pki/tls/certs/dom*

试试这个,这很简单

ls -lh dom* cen*

These two are equivalent:

ls -lh /etc/pki/tls/certs/dom* /etc/pki/tls/certs/cen*

ls -lh /etc/pki/tls/certs/{dom,cen}*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM