Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

of

Using the command line on macOS Slide 1 Using the command line on macOS Slide 2 Using the command line on macOS Slide 3 Using the command line on macOS Slide 4 Using the command line on macOS Slide 5 Using the command line on macOS Slide 6 Using the command line on macOS Slide 7 Using the command line on macOS Slide 8 Using the command line on macOS Slide 9 Using the command line on macOS Slide 10 Using the command line on macOS Slide 11 Using the command line on macOS Slide 12 Using the command line on macOS Slide 13 Using the command line on macOS Slide 14 Using the command line on macOS Slide 15 Using the command line on macOS Slide 16 Using the command line on macOS Slide 17
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

Using the command line on macOS

Download to read offline

Slides from a talk I gave in work about using the command line. Geared towards iOS developer using macOS

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Using the command line on macOS

  1. 1. Command Line From zero to hero.
  2. 2. What is a shell? Look, a shell! —> * Unix pioneered shells. * Shells are computer programs [Bash, ZSH, Fish, etc] * You can talk to your OS by issuing commands to the shell, in a command line interface / terminal. * You can change your default shell using chsh
  3. 3. Which shell does macOS use? Did you just say GPL? * macOS used to use a very old version of bash, the most popular and well known shell. * Newest versions of Bash use GPL3 License. Shipping this with macOS would mean Apple would need to publish source code for their programs, which sounds like it would empower the user. * macOS now uses zsh
  4. 4. So what programs can you run? Anything that is in PATH If you run echo $PATH you can see places where programs are loaded from for your current shell session . Traditionally: /usr/bi n Modern: /usr/local/bin (<— This is where home-brew puts its programs ) You can run apropos and a search term to find programs that match your term, i.e apropos text editing
  5. 5. How to use a program Conventions help discovery ProgramName -f flagValue input ProgramName --flag flagValue input
  6. 6. Unix + File Systems Everything is a fi le
  7. 7. Files, Files & More Files Things you can do with fi les * ls <- List files * ls -la <- List files including hidden files (start with a .) * file my_file.txt <- Describe file * pwd <- Where am I in the filesystem? * cd aDirectory/ <- change directory to aDirectory * cd ~ <- change directory to home * rm aFile ~ <- Remove a file * rm -rf aDirectory/ ~ <- Remove a directory
  8. 8. History Re-running commands * Press up on D-Pad to get last command * Ctrl + R <- search over history of previous commands . * sudo !! <- Rerun last command as Sudo
  9. 9. Pipes Take output from one command, use it in another cat file.txt | grep “a string I think is in this file” cat file.txt | wc -l
  10. 10. Copy & Paste pbcopy < file.txt pbpaste > file.txt pbpaste >> file.txt Overwrite Append
  11. 11. Symlinks * ln ~/some_folder/some_file <- hard link a file * ln -s ~/some_folder/some_file <- soft link a file
  12. 12. Backgrounding Processes * Ctrl+Z <- background current process. * fg <- re-focus process.
  13. 13. De fi ne an alias Run alias to see all aliases currently load in the shell
  14. 14. Profiles + Custom Configuration ~/.zshrc Change this, and source it (or restart your terminal)
  15. 15. Cool stuff I use * fzf <- Fuzzy finder * oh-my-zsh <- Lots of additions to zsh + plugin support (I use git + fzf plugins) * jenv, pyenv, rvm, nvm <- Language managers * tmux <- Terminal multiplexer * rg <- Ripgrep, much faster that grep

Slides from a talk I gave in work about using the command line. Geared towards iOS developer using macOS

Views

Total views

193

On Slideshare

0

From embeds

0

Number of embeds

19

Actions

Downloads

0

Shares

0

Comments

0

Likes

0

×