顯示具有 Mac 標籤的文章。 顯示所有文章
顯示具有 Mac 標籤的文章。 顯示所有文章

2023年8月26日 星期六

What I Learned Today (08/26/2023): Guide to Mastering Command Line and Shortcuts on Mac

Guide to Mastering Command Line and Shortcuts on Mac

Unlock the true potential of your Mac by mastering its command line interface and various keyboard shortcuts. Here's how.

Table of Contents

Check Mac Version

To check your Mac version, open the Terminal and type:

sw_vers -productVersion

Change Hostname

Change your Mac's HostName with the following commands:

  • Change HostName: sudo scutil --set HostName [nameyouwant]
  • Change temporary hostname: sudo hostname [mbpr]

Managing Applications

  • Start an application (e.g., TeamViewer): open -g -a /Applications/TeamViewer.app
  • Gracefully quit an application: osascript -e 'quit app "TeamViewer.app"'
  • Open multiple instances of VLC: /Applications/VLC.app/Contents/MacOS/VLC

User Management

For details on hiding, refer to Apple Support.

  • Disable a user: pwpolicy -u username disableuser
  • Enable a user: pwpolicy -u username enableuser
  • Hide a user from login screen: sudo dscl . create /Users/username IsHidden 1
  • Show a hidden user: sudo dscl . create /Users/username IsHidden 0

Browser Tricks

  • Add 'www' and '.com' to a URL: Press Control + Enter.
  • Reopen closed tab: ⌘ + Shift + T
  • Highlight URL bar: ⌘ + L
  • Open Incognito Mode: ⌘ + Shift + N
  • Clear cache and refresh: ⌘ + SHIFT + R

VLC Tips

  • Sync audio forward or backward: Press J or K.
  • Sync subtitles: Press H or G.

Miscellaneous Shortcuts

  • Lock screen: CMD+Ctrl+Q
  • Show dock: CMD+option+D
  • Maximize keyboard shortcut: Follow the guide in System Preferences > Keyboard settings.

Uninstalling Apps

  • 1. Go to LaunchPad.
  • 2. Drag the icon into your dock.
  • 3. Right-click on the icon and select Options > Show in Finder.
  • 4. Delete file.
  • 5. Right-click on the icon in the dock again and select Options > Remove from Dock.

Update Mac Using Terminal

  • Check for updates: softwareupdate -l
  • Install specific update: sudo softwareupdate -i 'macOS Catalina 10.15.4 Update- ' (note the space at the end)

2023年8月20日 星期日

What I Learned Today (08/20/2023): Mac Keyboard Shortcuts Guide 🍎

 

  • Command Key: 蘋果鍵 🍏
  • Option Key: alt鍵
  • Control Key: ctrl鍵
  • Eject Key: 光碟退出鍵 ⏏️
  • Down Arrow Key: 上下左右的下鍵 ⬇️

Switching Between Programs & Windows 🔄

  • Command + Tab: Switch between different programs (forward) ➡️
  • Command + Shift + Tab: Switch between different programs (backward) ⬅️
  • Command + ` : Switch between different windows of the same program (forward) ➡️
  • Command + ~ : Switch between different windows of the same program (backward) ⬅️

Editing & File Management ✏️

  • Command + C: Copy 📋
  • Command + V: Paste 📄
  • Command + X: Cut ✂️
  • Command + N: Open new window 🖼️
  • Command + W: Close tab ❌
  • Command + Option + W: Close all tabs, but don't close the program ❌❌
  • Command + Q: Close entire program ❌🗑️
  • Command + A: Select all 📑
  • Command + F: Find 🔍
  • Command + O: Open file 📂
  • Command + S: Save file 💾
  • Command + M: Minimize 🗕
  • Command + H: Hide current program (switch back with Command + Tab) 🔍
  • Command + Option + H: Hide all windows except the current program 🔍🔍
  • Command + E: Eject on external device ⏏️
  • Command + D: Make a backup 🔄
  • Command + ↓ : Execute/run ⚙️
  • Command + Shift + A: Open applications folder in Finder 🗂️
  • Control + Eject Key: Shutdown inquiry window 🚫💻
  • Command + Option + Esc: Force quit program 🚫❌
  • Command + Option + Eject Key: Sleep 💤
  • Command + Option + Ctrl + Eject Key: Shutdown 🚫💻
  • Command + Ctrl + Power Key: Force restart ⚡
  • Command + Shift + 3: Full-screen screenshot 📷
  • Command + Shift + 4: Screenshot (select range) 📸
  • Command + Shift + 4 + Space Key: Screenshot (select application) 📸🖼️

During Boot-Up 🥾

  • Option: Choose boot disk 🎛️
  • T: Turn your Mac into an external hard drive (use Firewire to connect to another computer) 💿
  • C: Boot from CD 📀
  • Shift: Safe mode boot 🛑
  • Command + S: Single-user mode 👤

Mouse Controls 🖱️

  • Right Click: ctrl + Left Click = Right Click 🖱️
  • Two-finger touch on touch panel + Left Click: Right Click 🖱️🖱️

Happy computing! 🎉 Feel free to bookmark this page for future reference. Please let me know if there is anything that need update!

2020年7月30日 星期四

Visual Studio Code tips for Mac

  • Search files: Command+P
  • File explorer: Command+Shift+E and arrow keys
  • Switch tabs: Ctrl + 1 or 2 or 3
  • Switch tabs: Command+Shift+ [ or ]
  • Toggle side bar: Command + b
  • Jump line: Ctrl + g
  • Find: Command+Shift+H


2019年12月2日 星期一

Create quick action


  1. Start automator
  2. Click new Document
  3. Select Quick Action -> Choose
  4. E.g. Create a HEIC image convert
    1. Drag "Copy Finder Items" to the right
    2. Drag "Change Type of Images" to the right
    3. Select File and Save
    4. Name the quick action -> Save
  5. Use it by clicking the right click

2018年6月11日 星期一

Solve the "Allow" button in System Preferences does not work issue

If it doesn't work using the mouse, then use the keyboard to enter the "Allow" button. Change to "All controls", see below pic.


Then, use Tab to navigate to "Allow" button, press "Space". Done.