• 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

halt Command Examples in Linux

by admin

The process of shutting down the system involves the orderly termination of all the processes on the system, as well as performing some vital housekeeping chores (such as syncing all of the mounted file systems) before the system powers off. Four commands can perform this function:

  • halt
  • poweroff
  • reboot
  • shutdown

halt command turns off the computer. Insert anote in the file /var/log/wtmp; if the system is in runlevel 0 or 6, stop all processes; otherwise, call shutdown -h.

halt Command Examples

1. To stop the machine:

# halt 

2. To not to sync before poweroff:

# halt --no-sync 

3. To force stop the machine:

# halt -f
# halt --force 

4. To poweroff the machine:

# halt -p
# halt --poweroff 

5. Don’t reboot but write the wtmp record:

# halt -w
# halt --wtmp-only 

6. To set the verbose mode:

# halt --verbose 

7. To show the errors only in output:

# halt -q
# halt --quiet 

8. Suppress writing to /var/log/wtmp.

# halt -d

9. No sync before reboot or halt:

# halt -n

10. Shut down network interfaces before halt.

# shutdown -i

11. Place hard drives in standby mode before halt or power off.

# shutdown -h

9. To display the help:

# halt --help 

Configuration Files

/var/run/utmp: Reads current runlevel from.
/var/log/wtmp: A new runlevel record for the shutdown time will be appended to this file.

Filed Under: Linux

Some more articles you might also be interested in …

  1. bmon Command Examples in Linux
  2. idle3: command not found
  3. pkcon Command Examples in Linux
  4. locale Command Examples in Linux
  5. CentOS / RHEL : How to move a Volume Group from one system to another
  6. trace-cmd: command not found
  7. a2enconf Command Examples in Linux
  8. fluxctl: Command-line tool for Flux v1
  9. How to Enable Disk Quotas on an XFS File System
  10. lrunzip: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright