sftp
clientDownload Software/Developer Tools
on the Apple Developer Connection).networksetup -listallnetworkservices
to see the list of network services Ethernet
and Wi-Fi
sudo networksetup -setv6off Ethernet
and/or sudo networksetup -setv6off Wi-Fi
sudo networksetup -setv6automatic Ethernet
and/or sudo networksetup -setv6automatic Wi-Fi
# Mac OS X 10.9.4 xcode-select --install
Some files may have extended attributes, for example:
chkuo@mesquite[~]$ ls -l -rwxr-xr-x@ 1 chkuo staff 3454 Jan 22 11:11 file1* -rwxr-xr-x 1 chkuo staff 2628 Nov 2 2006 file2*
The @
symbol after the permission info of file1
indicates that there are extended attributes. To find out more details:
chkuo@mesquite[~]$ ls -@l * -rwxr-xr-x@ 1 chkuo staff 3454 Jan 22 11:11 file1* com.apple.FinderInfo 32 com.apple.TextEncoding 15 -rwxr-xr-x 1 chkuo staff 2628 Nov 2 2006 file2*
To get rid of these extended attributes:
chkuo@mesquite[~]$ xattr -d com.apple.FinderInfo file1 chkuo@mesquite[~]$ xattr -d com.apple.TextEncoding file1
Mac OS X and Unix uses different characters to denote newline break. This can cause problem when you need to manipulate files in Finder and Terminal. To convert between the two, use:
#!/bin/sh # change linefeed from unix to mac for x do echo "$x" tr '\012' '\015' < "$x" > "tmp.$x" mv "tmp.$x" "$x" done
Or:
#!/bin/sh # change linefeed from mac to unix for x do echo "$x" tr '\015' '\012' < "$x" > "tmp.$x" mv "tmp.$x" "$x" done
In addition to the use of crontab
for reoccurring jobs, you can also use the at
utility to schedule a job to run at a pre-determined time. By default, this utility is disabled due to power management issue (need to read hard drive every minute). This is more of a problem for laptops, but not so for servers (or desktops that are being used as servers). To turn it on, use the command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist
To turn it off again, use:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.atrun.plist
To check if the at
utility is disabled or not, check preference file to see if Disabled
is specified:
cat /System/Library/LaunchDaemons/com.apple.atrun.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.apple.atrun</string> <key>ProgramArguments</key> <array> <string>/usr/libexec/atrun</string> </array> <key>StartInterval</key> <integer>30</integer> <key>Disabled</key> <true/> </dict> </plist>
For more details, read http://www.macosxhints.com/article.php?story=20050921214411382
Check when the maintenance scripts were run:
ls -al /var/log/*.out
Output should look like this:
chkuo@mesquite[~]$ ls -al /var/log/*.out -rw-r--r-- 1 root wheel 91407 Jun 18 10:39 /var/log/daily.out -rw-r--r-- 1 root wheel 84 Jun 18 10:58 /var/log/monthly.out -rw-r--r-- 1 root wheel 3625 Jun 18 10:57 /var/log/weekly.out
In case the computer was shut down when the scripts were scheduled to run.
sudo periodic daily sudo periodic weekly sudo periodic monthly
Or, to run all three at once:
sudo periodic daily weekly monthly