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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. xz Command Examples in Linux
  2. How To Create A SSH Banner in CentOS/RHEL Server
  3. Unix file basics : Inode, Soft Vs Hard link, Device files, Named pipes
  4. How to use sudo to allow a non-root user run a particular command
  5. How to Configure Proxy in CentOS/RHEL/Fedora
  6. crontab Command Examples in Linux
  7. CentOS / RHEL : Move a Physical Volume from an existing Volume Group to another Volume Group
  8. CentOS / RHEL 6 : How do I find my current runlevel?
  9. CentOS / RHEL 7 : Beginners guide to systemd
  10. top: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright