• 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

swapoff: command not found

by admin

The swapon command is used to activate a swap partition in a specified device. The swapoff command is used to deactivate the swap space on a device.

Some of the frequently used swapon and swapoff command options are given in the following table.

Option Used To
swapon -e Skip non-existent devices.
swapon -a Activate all of swap space.
swapoff -a Deactivate all of swap space.

If you encounter the below error while running the swapoff command:

swapoff: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
OS X brew install util-linux
Debian apt-get install mount
Ubuntu apt-get install mount
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install mount
CentOS yum install util-linux
Fedora dnf install util-linux
Raspbian apt-get install loop-aes-utils

swapoff Command Examples

1. Consult /etc/fstab for devices marked sw. Use those in place of the device argument.

# swapoff -a

2. Print help message and then exit.

# swapoff -h

3. Display version number and then exit.

# swapoff -V

4. Disable swap by label of a device or file:

# swapoff -L swap1

5. Disable a given swap partition:

# swapoff /dev/sdb7

6. Disable a given swap file:

# swapoff path/to/file

Filed Under: Linux

Some more articles you might also be interested in …

  1. Adding Static Routes On Various *NIX (Linux,AIX,HP-UX)
  2. How to show line numbers in Gedit
  3. ark: command not found
  4. kdocker Command Examples in Linux
  5. Linux OS Service ‘xendomains’
  6. hwclock: command not found
  7. renice Command Examples in Linux
  8. kwrite Command Examples in Linux
  9. dig: command not found
  10. How to mount an iso file in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright