デフォルトおよびアクティブなシステム状態ターゲットの表示

デフォルトのシステム状態ターゲットを表示するには、systemctl get-defaultコマンドを使用します。

sudo systemctl get-default
graphical.target

システムでアクティブなターゲットを表示するには、systemctl list-units --type targetコマンドを使用します:

sudo systemctl list-units --type target [--all]
UNIT                   LOAD   ACTIVE SUB    DESCRIPTION                
basic.target           loaded active active Basic System               
cryptsetup.target      loaded active active Local Encrypted Volumes    
getty.target           loaded active active Login Prompts              
graphical.target       loaded active active Graphical Interface        
local-fs-pre.target    loaded active active Local File Systems (Pre)   
local-fs.target        loaded active active Local File Systems         
multi-user.target      loaded active active Multi-User System          
network-online.target  loaded active active Network is Online          
network-pre.target     loaded active active Network (Pre)              
network.target         loaded active active Network                    
nfs-client.target      loaded active active NFS client services        
nss-user-lookup.target loaded active active User and Group Name Lookups
paths.target           loaded active active Paths                      
remote-fs-pre.target   loaded active active Remote File Systems (Pre)  
remote-fs.target       loaded active active Remote File Systems        
rpc_pipefs.target      loaded active active rpc_pipefs.target          
rpcbind.target         loaded active active RPC Port Mapper            
slices.target          loaded active active Slices                     
sockets.target         loaded active active Sockets                    
sound.target           loaded active active Sound Card                 
sshd-keygen.target     loaded active active sshd-keygen.target         
swap.target            loaded active active Swap                       
sysinit.target         loaded active active System Initialization      
timers.target          loaded active active Timers                     

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

24 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

graphicalターゲットがアクティブなシステムの出力は、このターゲットがネットワーキングとサウンドをサポートするために、networkおよびsoundを含むその他のアクティブなターゲットに依存していることを示しています。

リストに非アクティブなターゲットを含めるには、--allオプションを使用します。

詳細は、systemctl(1)およびsystemd.target(5)の各マニュアル・ページを参照してください。