Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
System administration on Apple macOS involves managing and maintaining the computer systems, including user accounts, software updates, system configurations, and more. This article will guide you through some essential system administration tasks using macOS Terminal commands and graphical user interface (GUI) tools.
Creating a New User Account via Terminal:
You can create a new user account using the sysadminctl
command in Terminal. Here’s how:
sudo sysadminctl -addUser newusername -fullName "New User" -password "password123"
Deleting a User Account via Terminal:
To delete a user account, use the following command:
sudo sysadminctl -deleteUser oldusername
Updating macOS via Terminal:
You can update macOS and installed applications using the softwareupdate
command:
sudo softwareupdate -i -a
This command installs all available updates.
Starting and Stopping Services:
macOS uses launchctl
to manage system services. Here’s how you can start and stop services:
Start a Service:
sudo launchctl load /Library/LaunchDaemons/com.example.service.plist
Stop a Service:
sudo launchctl unload /Library/LaunchDaemons/com.example.service.plist
Checking Disk Usage:
To check disk usage, the df
command can be used:
df -h
This command displays disk usage in a human-readable format.
Repairing Disk Permissions:
You can repair disk permissions using the diskutil
command:
sudo diskutil repairPermissions /
Checking Network Configuration:
To check the current network configuration, use the ifconfig
command:
ifconfig
Renewing DHCP Lease:
To renew the DHCP lease, use the following command:
sudo ipconfig set en0 DHCP
Replace en0
with the appropriate network interface identifier.
Monitoring System Performance:
The top
command provides a real-time view of system performance:
top
Viewing System Logs:
To view system logs, use the log
command:
log show --predicate 'eventMessage contains "error"' --info
This command filters logs to show only entries containing the word "error".
These examples cover some of the fundamental tasks involved in system administration on macOS. By using these commands and tools, you can effectively manage user accounts, update software, control system services, manage disks, configure networks, and monitor system performance.