Skip to content

Instantly share code, notes, and snippets.

@iegik
Last active September 9, 2022 07:04
Show Gist options
  • Select an option

  • Save iegik/47a34e7f604742b3d267 to your computer and use it in GitHub Desktop.

Select an option

Save iegik/47a34e7f604742b3d267 to your computer and use it in GitHub Desktop.
oneliners

echo

echo "Hello, World"
cat <<< "Hello, World"
2>&1 <<< "Hello, World"

loop files

for i in `ls -1`; do ... ; done

Search and Replace

grep -se '' ...

-s shows occurancies

sed -ie '' ...

-i replaces file instantly

Reverse search (have no occurancies)

grep -ve '' ...
#!/bin/sh
for i in `ls -1`; do convert $i ${i%%.jpg}.png ; done
#!/bin/sh
for i in `ls -1`; do cwebp $i -o ${i%%.jpg}.webp ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment