• 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

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. How to disable Ctrl+Alt+Del causing system reboot in CentOS/RHEL 6
  2. Beginners Guide to Linux Software Management with RPM
  3. pactl: command not found
  4. showmount Command Examples in Linux
  5. passwd: gkr-pam: couldn’t update the login keyring password: no old password was entered
  6. Linux Network File System (NFS) interview questions
  7. “WARNING: Duplicate VG name [vgname]” – error while running LVM commands
  8. Beginners guide to Device Mapper (DM) multipathing
  9. Audit Rule Configuration not Reflected – How to troubleshoot
  10. lolcat: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright