Hacker Times
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
johnchristopher
on June 30, 2022
|
parent
|
context
|
favorite
| on:
Ask HN: Can I see your cheatsheet?
> mkdir if not exists
[ -d "${DIR}" ] || (mkdir -p "${DIR}")
No need to check when using "-p".
sandreas
on June 30, 2022
[–]
You are absolutely right :-) I think, that this is a relict, since I personally use an alias for mkdir:
alias mkdir='mkdir -p'
Thank you
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: