Monday, June 19, 2017

Terminal : Commands of Daily Use

Hey folks,

Please have a look at some cool terminal commands


1. Show / hide Hidden Files : Do relaunch finder after you hit this command
$ defaults write com.apple.finder AppleShowAllFiles true / false


2. Copy Contents of folder to another
$ ditto <path of Source Folder> <Path of Destination Folder>
ditto /Users/admin/Documents/test /Users/admin/Documents/Swati/try


3. Zip a Folder
Zip -r <path of resultant zipped file> <Folder to be zipped>
$ zip -r test.zip  test 
Zip -r <path of resultant zipped file> <Folder to be zipped> -x <file not to be included in zip>
$ zip   -r  test.zip test  -x "*.DS_Store” 


4. Unzip archive
Unzip  <path of zipped file>
$ Unzip test.zip


5. Custom message on Login Window
Sudo defaults write  <path of login window> LoginwindowText "custom text"
$ sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "This is Swati's Mac.. "





6. Show AnyWhere option in GateKeeper of MAC OSX Sierra or Disable GateKeeper
Sudo spctl <prefixes>
$ sudo spctl --master-disable


7. Enable GateKeeper
Sudo spctl <prefixes>
$ sudo spctl --master-enable


8. Download content from any url
Curl -0 <url>
$ curl -0 http://file-to-be-downloaded.flv


9. To know the network connectivity
Ping <host>
$ ping google.com


10. Lets talk
say "your text"
$ say "Hello Swati"



Hope its useful :)



No comments:

Post a Comment