Skip to content

Latest commit

 

History

History
28 lines (25 loc) · 987 Bytes

commands.md

File metadata and controls

28 lines (25 loc) · 987 Bytes

Related to Swap Memory:

  • To view swappiness level: cat /proc/sys/vm/swappiness
  • To set swappiness level: sudo sysctl vm.swappiness=60
    • Default is 60.
    • Set to 0 to not have any.
  • Switch on swap mem: sudo swapon -a
  • Switch off swap mem: sudo swapoff -a

To check imported library and version:

  • Only library installation check: python2 -c 'import numpy as np;'
    • No output, no error msg
  • With version: Example: python2 -c 'import numpy as np; print np.__version__;'
    • 1.16.4

Run and view background process:

  • Run in background: nohup <CMD> &
    • To save output in a different file nohup <CMD> > <filename> &
  • View above process's output once: cat nohup.out
  • View above process's output periodically: watch -n2 tail nohup.out
  • NOTE: To view Python's print statements add sys.stdout.flush() after every print statement.
    import sys
    print("Hello World")
    sys.stdout.flush()

View Memory usage:

  • htop