The goal is for this post to be a one stop shop for some of my commonly used/helpful command-line commands. It’s for personal reference, though perhaps you could benefit. List will be updated.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# Quickly switch back to previous directory $ cd - # Repeat previous command with sudo #(!! is shorthand for the last command) $ sudo !! # Copy foobar.txt from remote.com to local/directory $ scp username@remote.com:foobar.txt /local/directory # Change file permissions of all directories in [DIR_ROOT] to 775. $ find [DIR_ROOT] -type d -exec chmod 775 {} +; # Change file permissions of all files in [DIR_ROOT] to 664. $ find [DIR_ROOT] -type f -exec chmod 664 {} +; # squash the last [x] number of commits # (used to maintain a cleaner git history) $ git rebase -i HEAD~[x] |



