Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah pretty much just that:

    rm @{g *.bak}
`g` returns a JSON array of file names and the @{} tells the shell to expand the array into parameters.

This way you don't need to worry about spaces in file names or other problems with escaping.



What if I wanted to delete the two files "@{g" and "*.bak}"?


You'd just put them in quotes as you already had done. In that regard the shell is designed to behave very similarly to Bash.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: