|
|
List of useful Mac OS X terminal commands
|
|
|
|
Dedicated MacNNer
Join Date: Aug 2003
Status:
Offline
|
|
I'd like to start a thread about useful Mac OS X terminal commands:
Installing available software updates:
sudo softwareupdate -ia
Repairing disk permissions:
sudo diskutil repairPermissions /
Toggling airport off and on:
sudo ifconfig en1 down (off)
sudo ifconfig en1 up (on)
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status:
Offline
|
|
Checking battery status:
ioreg -l | grep -i LegacyBatteryInfo
|
•
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
- lsof
- top, ps, kill
- cat, grep, find, awk, more, sort, etc.
- tail -f /path/to/logfile
- ssh, rsync, scp
- screen
- memtest (this is not included with OS X)
- ping, host, dig, traceroute, etc.
- ifconfig
- du
- port (Macports command)
- curl, wget (the latter is not included with OS X)
- ttf2eot, fondu, fontforge (likewise)
- wine (also likewise)
|
|
|
|
|
|
|
|
|
Administrator
Join Date: Jun 2000
Location: California
Status:
Offline
|
|
Place a Trash folder on your desktop. Works for files on same hard drive, but doesn't do the Eject function. No delay on use, no CPU load.
ln -s /Users/yourAccountName/.Trash Desktop/Trash
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Mar 2004
Status:
Offline
|
|
Originally Posted by herbsman
sudo diskutil repairPermissions /
Less popular than most.
No (jest joshing), i only wanted to mention that sudo is not needed for that one.
--
I feel all users should get real comfortable with list ( ls ), and use it for troubleshooting questions. E.g.,
ls -alOe /path/to/the/problem/file/or/folder
A good listing is often better than words (and pictures).
Besson already mentioned find. (Probably 90% of my most shell scripts have a "find" in there somewhere).
Please learn sed and eschew cut (i really dislike cut).
Thanks. (now back i go to the endless task of learning perl. )
EDIT: forgot to add something useful. Maybe,
list all 3rd-party prefPanes... and extensions:
system_profiler SPPrefPaneDataType |
grep -A2 -B3 3rd |sed '/3rd/d;/./!d'
kextstat |grep -v com.apple
(
Last edited by Hal Itosis; Jan 31, 2010 at 05:51 PM.
)
|
-HI-
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Aug 2003
Status:
Offline
|
|
How does one toggle 'remote access /ssh' via the terminal?
If it's possible, I presume the command would usable and quite useful when in single-user mode during times of need
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Networking access is not supported in single-user mode, as single user mode boots you into a lower level run level.
I don't know of a way to toggle SSH access via the Terminal, although you might want to look for a launchd file.
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status:
Offline
|
|
This might come in handy for some. Turning VNC screen sharing on and off via the CLI.
to turn on:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy yes
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvncpw -vncpw PASSWD
where PASSWD is a password you chose for VNC screen sharing.
to turn off:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy no
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate
|
•
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|