Skip to content

Instantly share code, notes, and snippets.

@githubfoam
Last active March 31, 2022 08:11
Show Gist options
  • Save githubfoam/5d4656b17831d7c78342792da1ca7cc6 to your computer and use it in GitHub Desktop.
Save githubfoam/5d4656b17831d7c78342792da1ca7cc6 to your computer and use it in GitHub Desktop.
macos_administrator_daily_tasks
--------------------------------------------------------------------------------------------------------------------------------------------------
#zsh shell (Z-Shell),Most versions of macOS ship with zsh pre-installed
zsh --version
chsh -s $(which zsh) #set zsh as the default shell
chsh -s $(which bash) # revert to Bash
chsh -s /usr/local/bin/zsh
chsh -s /bin/zsh
--------------------------------------------------------------------------------------------------------------------------------------------------
#Hosts File
Windows 10 - "C:\Windows\System32\drivers\etc\hosts"
Linux - "/etc/hosts"
Mac OS X - "/private/etc/hosts"
--------------------------------------------------------------------------------------------------------------------------------------------
ps aux | grep log2timeline.py | grep python | awk '{print $2}' | tr '\n' ',' | sed 's/,$//' #determine which Plaso processes are running
--------------------------------------------------------------------------------------------------------------------------------------------
sudo shutdown
su adminUsername
ls -la /Applications
ls -R ~/Desktop/
ls -lahR ~/Desktop/
cd ~/Documents
du -d 1 /Applications #du stands for "disk usage,"
find /Applications -d 1 -name "Google Chrome"
find ~/Desktop/Sample/ -type f
find /Path/To/List -type f > FilesWithPaths.txt
mv /Users/jdoe/Documents/file1 /Users/jdoe/Desktop/file1
mkdir /Users/jdoe/Desktop/cool_stuff
rm -R /Users/jdoe/Desktop/cool_stuff
curl -O [URL of file you want to download
killall SystemUIServer
--------------------------------------------------------------------------------------------------------------------------------------------------
echo $PATH
sudo nano /etc/paths
--------------------------------------------------------------------------------------------------------------------------------------------------
$ cd /Library/Application Support #cd: /Library/Application: No such file or directory
$ cd 'Library/Application Support'
--------------------------------------------------------------------------------------------------------------------------------------------------
sw_vers #OS X System Version
system_profiler | more
uname -a
--------------------------------------------------------------------------------------------------------------------------------------------------
sbt & background job
--------------------------------------------------------------------------------------------------------------------------------------------------
#https://github.com/Homebrew/brew
#https://docs.brew.sh/Formula-Cookbook#homebrew-terminology
Formula The package definition
Keg The installation prefix of a Formula
Cellar All Kegs are installed here
Tap A Git repository of Formulae and/or commands
Cask An extension of Homebrew to install macOS native apps
brew --version
brew upgrade git Upgrade a package
brew upgrade <formula> # Upgrade only the specified brew
brew upgrade # Upgrade all outdated and unpinned brews
brew unlink git Unlink
brew link git Link
brew info git List versions, caveats, etc
brew cleanup git # Remove older versions of specified formula.
brew cleanup # Remove older versions of installed formulae.
brew cleanup -n # Display all formula that will be removed (dry run)
brew update Update brew and cask
brew list List installed
brew list --versions
brew outdated # Show formulae with an updated version available
brew doctor Diagnose brew issues
brew pin <formula> # Prevent the specified formulae from being upgraded
brew unpin <formula>
brew switch git VERSION
brew edit git Edit this formula
brew cat git Print this formula
brew home git Open homepage
brew doctor #Check system for potential problems
-------------------------------------------------------------------------------------------------------------------------------------------------
#https://github.com/Homebrew/homebrew-cask
brew tap homebrew/cask # Tap the Cask repository from Github.
brew tap caskroom/cask #need Homebrew to use Cask, andyou make Cask available by adding it as a tap
brew tap # List all the current tapped repositories (taps)
brew tap <user/repo> # Tap a formula repository from Github using https for tap https://github.com/user/homebrew-repo
brew tap <user/repo> <URL> # Tap a formula repository from the specified URL
brew untap <user/repo> # Remove the given tap from the repository
#cask is no longer a brew command
brew install --cask #brew cask install
brew cask list #lists all the casks
brew cask info caffeine
brew search google-chrome ## Search all known casks based on the substring text.
brew cask install google-chrome
brew cask uninstall google-chrome
brew cask uninstall --force google-chrome #uninstall all versions of a Cask
brew cask upgrade #updates all outdated Casks
-------------------------------------------------------------------------------------------------------------------------------------------------
# Software updates should be run at minimum every 30 days
sudo defaults read /Library/Preferences/com.apple.SoftwareUpdate | grep -e LastFullSuccessfulDate.
# Run the following command to verify there are no software updates
sudo softwareupdate -l
# Run the following command to verify what packages need to be installed:
sudo softwareupdate -l
# Run the following command to install all the packages that need to be updated
sudo softwareupdate -i -a
# run the following command to install individual packages
# sudo softwareupdate -i '<package name>'
-------------------------------------------------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment