Skip to content

Instantly share code, notes, and snippets.

@vegarsti
Last active August 13, 2018 06:21
Show Gist options
  • Save vegarsti/be61b64bc433542614fa023bb15365cd to your computer and use it in GitHub Desktop.
Save vegarsti/be61b64bc433542614fa023bb15365cd to your computer and use it in GitHub Desktop.
Useful Unix commands
  • scp usage
    • scp *.png server:~ Copies all png files from current folder to home directory on server (which is a key specified in config)  - scp server:~*.png ~/pics the other way around
  • printing at ifi (w/ pullprint)
    • pullprint [file] or lpr [file] -P pullprint_ricoh
    • Pullprint
  • Bash shell shortcuts (from here)
    • Ctrl + a: Start of line
    • Ctrl + e: End of line
    • Ctrl + w: Erase word
    • Ctrl + k: Erase from cursor until end of line
    • :p -- add this to print command to be run instead of executing it
  • ln -s old-dir new-dir Creates a symbolic link from old-dir to new-dir (make sure new-dir doesn't exist yet)
  • In iterm: Cmd+Shift+D splits!
  • column -t -s [SEP] file.csv prints file.csv, which is separated by [SEP], nicely formatted
  • grep -lR "•" . | xargs sed -i "" 's/•/■/g' replace dot with square, in all files in current folder and subfolders
  • wget -r -np -nH --cut-dirs=3 -R index.html http://hostname/aaa/bbb/ccc/ddd/ download all links
  • find . -name '*.pl' find all perl files
  • cron: https://ole.michelsen.dk/blog/schedule-jobs-with-crontab-on-mac-osx.html
  • crontab -l list running jobs
  • kill process: https://stackoverflow.com/a/37214138/3600147
@vegarsti
Copy link
Author

vegarsti commented Apr 7, 2017

Bash : set -eux

@vegarsti
Copy link
Author

vegarsti commented Apr 7, 2017

Shellcheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment