What serve Command - line Commands on Mac OS X?

Per the Windows and also Linux strings, what commands do you locate most valuable in Mac OS X Server (or Client)?

0
2019-05-18 22:59:26
Source Share
Answers: 31
softwareupdate

Update your mac from the CLI.

0
2019-12-05 02:28:16
Source
srm

Command line variation for safe and secure delete.

0
2019-12-05 02:18:11
Source

ipconfig is occasionally valuable :

Getting existing IP address on user interface :

$ ipconfig getifaddr en1
10.110.2.25

Getting the DHCP details that was last obtained :

$ ipconfig getpacket en1
op = BOOTREPLY
htype = 1
flags = 0
hlen = 6
hops = 0
xid = 143857879
secs = 0
ciaddr = 0.0.0.0
yiaddr = 10.110.2.25
siaddr = 0.0.0.0
giaddr = 0.0.0.0
chaddr = 00:aa:bb:cc:dd:ee
sname = 
file = 
options:
Options count is 7
dhcp_message_type (uint8): ACK 0x5
server_identifier (ip): 1.1.1.1
lease_time (uint32): 0xe10
router (ip_mult): {10.110.0.1}
domain_name_server (ip_mult): {1.1.1.1, 1.1.1.2}
subnet_mask (ip): 255.255.252.0
end (none): 
0
2019-12-05 02:17:14
Source
df -h

To examine the amount of disk room I presently carry all the disk.

0
2019-12-04 08:22:57
Source
last

programs that has actually logged right into a system, how much time they utilized it, and also when the system has actually been reactivated.

Below is an example of the result :

clinton   ttys000                   Thu May 28 22:33   still logged in
clinton   console                   Thu May 28 08:05   still logged in
reboot    ~                         Thu May 28 08:05 
shutdown  ~                         Wed May 27 20:15 
clinton   console                   Wed May 27 17:33 - 20:15  (02:42)
...

wtmp begins Thu May 14 09:26 
0
2019-12-04 05:43:34
Source

Truly Mac just : I saw 'open.' above, yet open will certainly open any kind of record or application you pass to it.

Common Unix that I make use of one of the most : sudo is rather convenient for transforming system config documents, etc, which I in fact modify in vi.

eliminate can not be overemphasized when something hangs (or when an additional customer is still logged right into my desktop computer behind-the-scenes and also I intend to log them out, horrible I recognize yet it is my desktop computer)

ssh/scp - I enjoy that in OSX I can simply open a terminal and also connect to any one of our web servers. That alone made me satisfied to go down Windows.

ifconfig/ping/whois/ nmap etc

0
2019-12-04 04:33:34
Source

From the command line, I such as having the capacity to :

Create and also melt a "universal" CD/DVD :

$ mkisofs -allow-multidot -allow-leading-dots -d -hide-rr-moved \
-l -joliet-long -R -T -v \
-V VOLUME_NAME -o output.iso root-cd-dir/
$ hdiutil burn -noverifyburn output.iso

Create an ISO photo from a CD/DVD :

$ diskutil unmountDisk /dev/disk2s0
$ dd if=/dev/disk2s0 of=cdname.iso bs=32m

Being able to neglect the otool command when I'm looking for ldd :

$ alias ldd='printf "Sending command to \'\''otool -L\'\'' --\n" && otool -L'

Mount a disk photo from the command line :

$ hdid diskimage.dmg (or .iso)

Use sneak peek to access a male web page :

$ man -t rsync | open -f -a /Applications/Preview.app
0
2019-12-04 04:26:36
Source
drutil eject

will certainly eject a CD.

0
2019-12-03 05:18:34
Source
mcxquery

this will certainly allow you see what type of MCX (Managed Client) setups are being related to a customer equipment.

[The GUI matching is to head to System Profiler, and also, under the Software area, click "Managed Client". ]

It serves to establish if an equipment is taken care of and also to see if it is obtaining the setups you anticipate.

0
2019-12-03 04:44:55
Source
sudo slapconfig -destroyldapserver

Force Demote an LDAP Replica to Standalone. If your Open Directory Master is misconfigured, occasionally attempting to bench an Open Directory Replica making use of Server Admin will certainly fall short (eg : you could locate your Replica web server rejects to bench). You can make use of slapconfig to compel it to bench on these celebrations.

0
2019-12-02 00:49:32
Source
say "some text"

Famously made use of for getting people back into their apartments, say takes your debates and also reviews them out loud via the audio result tool.

0
2019-12-02 00:47:09
Source
dscacheutil -flushcache

I locate myself making use of that lots to purge the DNS cache, on 10.5 npls.

0
2019-12-02 00:41:14
Source
ifconfig | grep cast

is wonderful for obtaining your IP address, and also

ifconfig en1 | grep eth

functions well for obtaining a MAC address. Making use of en1 will certainly (generally) get the Airport is MAC address, which comes in handy so well-known tools are permitted onto your cordless network. Alternatively, if you make use of en0 - - the constructed - in ethernet port - - you can after that look the equipment up in your Open Directory, thus :

ldapsearch -x -h odm -b "cn=computers,dc=odm,dc=pretendoco,dc=com" "macAddress=00:0d:93:b5:82:88"

(Assuming your web server was 'odm' and also the world is ODM.PRETENDCO.COM).

0
2019-12-02 00:06:28
Source
system_profiler

Give you the very same outcomes as you get when you pick About This Mac - > More Info, just on the command line.

Running

system_profiler -usage

or considering the male web page will certainly offer you pointers on just how to utilize it.

A number of instances :

system_profiler -xml > MySystem.spx
# and later,
open MySystem.spx  # or just double click on it in the Finder

this will certainly unload the system account to a documents which can be considered later a various equipment.

system_profiler SPUSBDataType

Tells you concerning all your USB tools (including their Vendor and also Product IDs, which can assist in locating vehicle drivers).

system_profiler SPUSBDataType | grep "Product ID" -c

will certainly inform you the amount of USB tools are connected in (consisting of inner USB tools), which serves to see if the computer system sees a tool (or, if, claim, Parallel is ordered it or it is dead.) [Do note that in the System Profiler GUI App, you can pick View - > Refresh from the food selection to upgrade the checklist ; that might simply be less complicated. ]

system_profiler SPHardwareDataType

will certainly get you standard equipment details (valuable for property monitoring), and also

system_profiler SPHardwareDataType | grep Serial

will certainly offer you the equipment is identification number.

0
2019-12-02 00:04:13
Source

http://www.commandlinefu.com

While not especially a Mac source, it is making use of the symbol for the Terminal, and also a lot of the checklist of actually valuable commands will certainly function.

0
2019-12-02 00:02:14
Source

The Command - Line Administration overview produced by Apple is very useful.

Googling for "command line administration mac" offers excellent outcomes.

Command - Line Administration for Mac OS X 10.5, 10.4, and also 10.3.

Various other valuable overviews go to http://www.apple.com/server/macosx/resources/.

0
2019-12-01 23:47:55
Source
ifconfig en0 ether 00:00:00:00:00:00

Changes (satires) MAC address till next reboot

0
2019-12-01 20:03:48
Source
locate "foo"

Displays any kind of documents on your system with "foo" in its filename. I have to utilize this virtually as usually as I make use of Spotlight.

0
2019-06-01 05:43:42
Source
sw_vers

Displays the presently mounted variation and also construct of Mac OS X.

0
2019-05-30 07:38:59
Source

pbpaste and also pbcopy to connect with the pasteboard (also known as clipboard).

Instances:

# copies the directory listing
ls -l | pbcopy

# get pasteboard lines containing foo and save them in a_file
pbpaste | grep foo > a_file

I assume they fail to making use of the macroman encoding, so if you desire UTF - 8 (which you do) you need to look into these web links:

0
2019-05-30 06:42:56
Source
ping 224.0.0.1

Ping all tools on your subnet

0
2019-05-22 20:11:51
Source

du - d 1 - h

Displays disk use data for the existing directory site in human legible kind.

male [command ]

One of one of the most previously owned commands. Informs you just how to make use of every little thing else.

0
2019-05-22 13:48:55
Source
networksetup

Configure every little thing you locate in the Network Preference Pane in System Preferences on the command line. Makes creating manuscripts, or doing points from another location a lot less complicated.

0
2019-05-22 13:43:23
Source
osascript -e 'tell application "AppName" to quit'

Lets you give up an application from the covering.

osascript -e 'tell application "Finder" to sleep'

Useful last line of a lengthy covering manuscript, places Mac to rest when manuscript is done. I have it aliased to iSleep.

pbpaste | script.sh |pbcopy

takes materials of pasteboard (modify - > duplicate) and also pipelines it to script.sh. The outcomes are placed onto the pasteboard for you to modify - > paste right into a record.

0
2019-05-22 12:20:43
Source
sqlite3 foo.db

Starts an interactive SQLite session. If foo.db does not exist, it will certainly be developed.

0
2019-05-22 12:19:33
Source
open .

Opens a finder window in the existing functioning directory site.

0
2019-05-22 12:16:56
Source
sudo changeip -checkhostname

Checks that onward and also turn around DNS resolution are healthy and balanced, and also usually reveals you the command you can make use of to deal with the trouble. If it claims "the names match, there is absolutely nothing to transform" you remain in good condition. Essential if you ever before transform your web server is network arrangement. Additionally vital to utilize this prior to you advertise your web server to an Open Directory Master.

0
2019-05-21 09:02:44
Source
fs_usage

Lets you check documents system task. Convenient if you intend to see what submits some application develops. See http://rentzsch.com/macosx/fs_usageIntro for even more description.

0
2019-05-21 08:58:43
Source
ipconfig getpacket en0

Displays network configuration for the key Ethernet user interface (en0).

If you are made use of to Windows and also assume "ipconfig" is damaged - it is not ; -) You simply require to add a pair debates

0
2019-05-21 08:54:51
Source

The 'airport terminal' CLI energy is my favored. See http://osxdaily.com/2007/01/18/airport-the-little-known-command-line-wireless-utility/. It will certainly show you information like the signal degree, sound degree, and also the BSSID of the AP you are linked to.

0
2019-05-21 08:22:24
Source
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent

Starts the Remote Desktop solution (valuable if you just have SSH accessibility yet intend to do something making use of the GUI on your customer Mac). For even more alternatives, see: http://support.apple.com/kb/HT2370

0
2019-05-21 08:20:36
Source