• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

dphys-swapfile Command Examples in Linux

by Deepika

dphys-swapfile is a script in Debian-based distribution that is used to manage the system’s swap space. This script is responsible for creating, configuring, and removing the swap file on the system. The dphys-swapfile command can be used to configure the amount of swap space on the system, and to enable or disable the swap file. The dphys-swapfile command can also be used to check the current status of the swap file, including the size of the swap file, and the amount of swap space currently in use.

For example, the command “sudo dphys-swapfile swapoff” will turn off the swap file and “sudo dphys-swapfile swapon” will turn on the swap file again. “sudo dphys-swapfile status” will give you the current status of the swap file, and “sudo dphys-swapfile uninstall” will remove the swap file entirely.

dphys-swapfile Command Examples

1. Disable the swap file:

# dphys-swapfile swapoff

2. Enable the swap file:

# dphys-swapfile swapon

3. Create a new swap file:

# dphys-swapfile setup

Filed Under: Linux

Some more articles you might also be interested in …

  1. maestral Command Examples
  2. lshw Command Examples in Linux
  3. black – A Python auto code formatter (Command Examples)
  4. net-snmp-create-v3-user: command not found
  5. keyctl: command not found
  6. grep: command not found
  7. vgchange Command Examples in Linux
  8. How to Disable/Enable Numa for Virtual Machine (XEN based)
  9. How to Enable Password Aging in Linux with NIS
  10. macof: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright