Short for Portable Operating System Interface (the X apparently has no meaning), POSIX is a set of standards for tools to work across operating systems, like how Bash works nearly the same in Windows and Linux distributions.
POSIX also defines the Shell Command Language and many utilities like cd. Bash aims to be compliant with POSIX.
- POSIX - Wikipedia
- Current official names:
- POSIX.1-2024
- IEEE Std 1003.1™-2024
- The Open Group Standard Base Specifications, Issue 8
- Current official names:
- Shell and Utilities section of POSIX (official)
grep -- search a file for a pattern
# Search this monorepo for "auth.md", succeeding even if nothing is found
grep -RIn --exclude-dir=node_modules -- "auth.md" ./path/to/hello-hello || truemv -- move files
Doesn't seem to take fancy args on its own, need to learn more about piping and xargs to get good use out of this.
sed -- stream editor
MY_FILE="./src/pages/blog/content/__todo__"sed -i "s/’/'/g" $MY_FILE
sed -i 's/[“”]/"/g' $MY_FILE
sed -i 's/…/.../g' $MY_FILELinks are to official sources unless otherwise specified. Citations in code use the same numbering and name as in official sources.
Full name: Volume: XCU, Chapter 2: Shell Command Language
# Print stdout to a file
# 2.7.2 Redirecting output
echo Hello > out.log# Print stdout and stderr to the same file
# 2.7.6 Duplicating an Output File Descriptor
echo Hello > out.log 2>&1echo "Hello
world" | grep Hellofor name [ in [word ... ]]
do
compound-list
donefor i in {1..3}; do echo Hello; done