following are my finding while switching from ubuntu to macOS, first I describe the issue and what is the alternative in the mac OS before moving forward, let's know the version name by their number denoated as OS X
version number | version name |
---|---|
10.10 | "Yosemite" |
10.11 | "EI Captian" |
10.12 | "Sierra" |
10.13 | "High Sierra" |
10.14 | "Mojave" |
10.15 | "Catalina" |
11 | "Big Sur" |
so whenever you search specific in google for your mac, prepend query with os x
Keybaord symbol list
can be visible here --> apple icon > System Preferences > Keyboard > Modifier Keys
⌘ = Command
⇧ = Shift
⌥ = Option (a.k.a. Alt)
⌃ = Ctrl
⎋ = Esc
↩︎ = Return
⌫ = Delete (a.k.a. Backspace)
command cmd key means the ⌘
key
⌘ + ⌥ + i => chrome developer tools
⌘ + ⌥ + J => chrome developer tools console
⌘ + ⇧ + h => Home
⌘ + ⇧ + d => Desktop
⌘ + ⇧ + a => Application
⌘ + ⇧ + u => Utilities
⌘ + ⇧ + . => Toggle hidden files
⌘ + , => Open Settings of any item/ panel
⌘ + ⌃ + t => Add folder to sidebar (bookmark)
⌘ + ⌃ + f => Maximize current active window
-
You can not create new file from context menu but can create new folder only
alternative: use
touch filename
from terminal -
No utility to lock the screen
alternative:
- Navigate to icon --> System Prefrences --> Security & Privacy --> General --> Check Require Password immediately after sleep or screen saver starts
- hit shift + ctrl + power hold them down for two seconds, revoke by Spacebar
Note: in the latest mac OS (10.13 or later) the keyboard shortcut is cmd + shift + q
-
No way to see hidden files in a folder
alternative: open terminal and run
defaults write com.apple.Finder AppleShowAllFiles true
and thankillall Finder
keyboard shortcut: ⌘ + shift + . -
No way to see file systems
alternative:
-
go to finder ( which is equivalent to explorer in windows and nautilus in Ubuntu)
-
hit ⌘ + shift + h ==> opens Home folder ( in Finder )
-
hit ⌘ + shift + g ==> write location name
-
Open in Terminal directly within folder utility in context menu is missing alternative: icon --> System Preferences --> Keyboard --> Shortcuts --> Services --> Enable "New Terminal at Folder"
to check this, suppose we have to open /opt/alpha/beta folder in terminal then go back to the parent folder (alpha), select the relevant folder (beta), right click (context menu) --> Services --> there you see Open Folder in Terminal
-
brew
instead ofapt-get
install brew using below command in terminal
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Reference: http://brew.sh -
Unable to keep project open in sublime text while we close all the files.
alternative: use shift + q to close sublime completely.
-
No shortcut to open terminal
alternative: ⌘ + spacebar and write Terminal ( minimize and right click on icon from dock and check Options > Keep in Dock)
now you will have terminal in dock always ( just like taskbar in windows and favorite in ubuntu)
-
Title of tab in terminal ( shortcut ⌘ + i ) and write tab title ; but no way to close that panel using keyboard
-
no window maximize, if you click on maximize, it will span over the screen and hide the menu and double tab on window will adjust according to screen width
-
window top bar can not be adjusted within open window
-
git installed but no autocomplete feature in terminal
alternative:
- install curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
- add below content in __~/.bash_profile__ file
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
note: in latest mac OS (catalina or later) default shell is zsh which have inbuild auto complete feature
-
mouse scroll is reverse in mac OS, which cause trouble for the ubuntu and windows user
- Navigate to (Apple icon) -> System Prefrences > Mouse > Uncheck Scoll Direction : Natural
-
set function keys ( F1 F2 ) as normal
- Navigate to Apple icon > System Prefrences > Keyboards > (last option) check F1.F2, etc.. keys as standard keys
-
remove siri ( not useful on office laptop )
- Navigate to System Prefrences ( Apple icon) > Siri > Uncheck Enable Siri on right side panel
-
backspace is fn + delete
-
remove Notification of stocks -Navigate to Apple icon > System Prefrences > Extensions > Today > uncheck Stock
-
rename any file --> select File and Press Enter (return)
-
To open settings of an application, ess ⌘ + , on the open window of that application
-
make link for sublime so that it can be opened from terminal by hit
subl
, for that run below command
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
now write subl .
in terminal from the location of peoject folder to open project in sublime.
- Remove entry from context menu
icon --> System Preferences --> Keyboard --> Shortcuts --> Services > text > uncheck the un necesray item from context menu such as "Add to iTunes as a Spken Track"
-
install XtraFinder for adding copy move and other feature in folder/file context menu
-
brew install coreutils
so that you can use linux command such asshuf
,date
but with prefixg
; sodate
isgdate
andshuf
-isgshuf
-
colorful terminal and git branch name in terminal
write following content in ~/.bashrc
file
# Git branch in prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
export PS1="${GREEN}\u@${LIGHT_GRAY}\h:${LIGHT_RED}\w${LIGHT_GREEN}\$(parse_git_branch)${BLUE} $ "
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
- when you click on a zip file and select Open; it will extract the zip into same folder.
download and install ; it will set default password which will be displayed after succesfull installtion completion; note down now first make symbolic link for mysql to run from terminal
echo 'export PATH="$PATH:/usr/local/mysql/bin"' >> ~/.profile
source ~/.profile
$: mysql -u root -p
change default password
mysql>
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');
Query OK, 0 rows affected, 1 warning
exit;
now you can access with your password
. mysql start stop restart
sudo /usr/local/mysql/support-files/mysql.server start/stop/restart
Or you can set alias to mysql
alias mysql=/usr/local/mysql/bin/mysql
and then run below query
$: mysql -u root -p
Enter Password: