LinuxCommandLibrary

System control

Lock screen

$ dbus-send --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.Lock
copy

Unlock screen

$ dbus-send --type=method_call --dest=org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SetActive boolean:false
copy

Shutdown the system

$ shutdown -h now
copy
$ reboot -p
copy
$ systemctl poweroff
copy

Shutdown the system at a specific time

$ shutdown -h 18:45 "Server is going down for maintenance"
copy

Stop Bluetooth service

$ service bluetooth stop
copy
$ systemctl stop bluetooth
copy

Start Bluetooth service

$ service bluetooth start
copy
$ systemctl start bluetooth
copy

Stop wifi service

$ nmcli nm wifi off
copy

Start wifi service

$ nmcli nm wifi on
copy

Turn off monitor

$ xset dpms force off
copy

List running services

$ systemctl list-units --type=service
copy
$ service --status-all
copy

Start a service

$ systemctl start [serviceName]
copy
$ service [serviceName] start
copy

Stop a service

$ systemctl stop [serviceName]
copy
$ service [serviceName] stop
copy

Enable service at boot

$ systemctl enable [serviceName]
copy

View service logs

$ journalctl -u [serviceName]
copy

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community