Useful shell shortcuts

Here are some useful shell shortcuts that you can use to make your life easier:

CTRL+A - move to beginning of line
CTRL+E - move to the end of the line
CTRL+B - move backward
CTRL+F - move forward
CTRL+D - delete character under cursor
CTRL+K - deletes text from cursor to the end of line
CTRL+X+BACKSPACE - delete text from cursor to the beginning of the line
CTRL+T - exchange character under cursor with previous character
ESC+T - exchange two words before and under cursor
ESC+U - converts text from cursor to the end of the word to UPPERCASE
ESC+L - converts text from cursor to the end of the word to LOWERCASE
CTRL+X+CTRL+E - launch default editor
CTRL+L - Clears screen above current line
CTRL+W - Delete word from cursor position to the left
CTRL+R - Search through command history

Bash zip all files in directory one by one in individual zips

If you like me have for example folder filled with NES rom files that end with .nes extension and you would like to zip them all up in individual files to save some space.

I use this one-liner to zip all my NES collection so that it will take less space on my USB stick when I transfer it to my bartop arcade running RetroPie:

for file in *.nes ; do zip "$file.zip" "$file"; done

Continue reading “Bash zip all files in directory one by one in individual zips”