How to see how much you have swap by Matlab prompt in your system?
조회 수: 1 (최근 30일)
이전 댓글 표시
I would like to verify how much users have swap on their system by one-liner. Is there anything about the thing in Matlab prompt?
OS: Debian 8.5 64 bit Linux kernel: 4.6 of backports Hardware: Asus Zenbook UX303UA
댓글 수: 0
답변 (1개)
Walter Roberson
2016년 10월 14일
No, this cannot be done in one line. Figuring out how much swap you have available requires detecting which OS-X version you are running. Current versions of OS-X would require asking the system for sysctl vm.swapfileprefix , removing the filename portion, resolving that directory to a device, and asking for the amount of free space on the device, together with totaling the size of all existing files that match the pattern starting with sysctl vm.swapfileprefix . Remember when you ask for the amount of free space on the partition to multiply by the blocksize to get bytes, because the file sizes will be in bytes.
댓글 수: 2
Walter Roberson
2016년 10월 15일
http://www.cyberciti.biz/faq/linux-check-swap-usage-command/ and some different phrasing at http://www.tecmint.com/commands-to-monitor-swap-space-usage-in-linux/
So perhaps
!free -h | awk '/Swap:/ {print $4}'
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!