Removes a file
rm app.js
Copies a file
cp app.js js/app.js
Creates a new folder
mkdir assets
Runs to commands simultaneously
lessc main.less main.css & browserify main.js -o bundle.js
Runs the second command only if the first ended up successfully
cp app.js js/app.js && rm app.js
.
Runs the second command only if the first failed
uglify app.js app.min.js || echo "Error!"
This one is one of my favorites, it pipes the output of the first command as the input of the second command, for example after you create a bundled file with browserify you can minify it using uglify.
browserify app.js | uglify app.min.js
Inputting the contents (stdin) of a file to a command
Redirecting output (stdout) of a command and dumping it to a file