• chflags
– to set flags, such as uchg (lock) or hidden, which are often set on the Windows platforms and do not correspond to file modes (chmod) on UNIX/Linux platforms.
• ls -lOe
– to get a listing of the flags for each file
• sudo port select
- - set python python 27 (to set a specific version of software like python or perl, which have multiple versions installed)
• port note <module>
– get note contents for the specified module (not all modules have notes)
• listening ports with process:
sudo lsof -i -n -P | grep TCP
netstat -tulpn
• SCP: secure file copy http://www.hypexr.org/linux_scp_help.php
• Listing all users on Linux: awk -F':' '{ print $1}' /etc/passwd
• scutil
– manages system configuration parameters on Mac OS or BDS
• mdfind
– Spotlight find
• dscacheutil
– manages dns cache from the command-line
• lsof -i | grep LISTEN
–> to see socket activity per proces, equivalent to netstat -ab on Windows
• sudo lsof -i grep LISTEN
—> to see all processes on the system
• sips to resize images as in
○ sips -Z 500 screenshot.png
• sudo lsof | grep OneNote | grep -v Applications
○ To snoop on a running program's open ports and files
• To fix VmWare Fusion slowness with Yosemite from this blog post: https://communities.vmware.com/thread/493294
○ sudo nvram boot-args=debug=0x10
○ Re-start the Mac
○ Reverse with the following, although you should check whether there are other boot arguments there, which you may not want to remove.
§ sudo nvram -d boot-args
○ To check if the variable is already there
§ sudo nvram boot-args
• git config --global core.excludesfile ~/.gitignore_global
• git ls-files --others --exclude-standard --directory
• git add `git ls-files -m`
• git difftool -d one_branch other_branch
git rm --cached `git ls-files -i -X .gitignore`
.gitignore
without deleting them form the local file system.• Shutdown the system. If you have problems shutting it down, just hold the startup key down for a few seconds until it completely goes down. • Before re-starting, hold down the Command, Shift, and “V" keys together, and while you keep these down press the startup key. The system will start up with a black screen listing all the steps of the booting process. This might take longer than usual, and if it is blocked at some point you may be albe to see an error message providing some information about the problem. Let me know what it is if that happens. • If the system starts correctly eventually. Shut it down again and re-start it normally to see if everything works.
• Press the Command and “S” keys together while you press the startup key.
• You’ll eventually get a full-screen command line.
You’ll have to enter your username and password, the
same username and password you use normally to login
the system.
• Once you’re logged in, type the fsck command as follows:
○ fsck -fy
○ And press the Return key.
○ If that doesn’t work, try /sbin/fsck -fy
• Don’t forget the starting slash character.
• This will take a while, but it will try to fix all the
corrupted sectors and links on your hard drive.
• When that completes, type reboot and press the Return key to restart the system.
If that doesn’t work also, you should try resetting the
NVRAM/PRAM
. Follow this link to get the steps. If this
doesn’t work, you may have a problem with the battery on
your logic board, which you should be able to get
replaced easily at a Mac store.