List of my most used commands and shortcuts in the terminal for Mac
terminal-mac-cheatsheet's Introduction
Terminal Cheatsheet for Mac (Basics)
This cheatsheet is available in many languages. Since the translation rely on volunteers, the content between the available languages may vary. Choose one below:
I accidentally typed ⌘Cmd + L in my Mac-Terminal and it seemed to delete the output of the previous command. I'm not sure how this shortcut is defined or where I can look it up. Does anybody have an idea?
I think this command is essential for finding new terminal commands. It really opens the user up to new options. It's especially useful with either -h or man [command] to look around for something that can fulfill a specific task
Search for all lines that do not contain the pattern
[string]
grep [search_pattern]
Examples
Contents of filename.txt
a/b/c
a/b/c.zip
Search File Contents
# find all lines that contain "a/b/c"
grep "a/b/c" filename.txt
# find all lines that contain "a/b/c" or print if none are found.
grep "a/b/c" filename.txt ||printf"\nNo Matches Found.\n"# find all lines that contain "a/b/c" and do not include ".zip"
grep "a/b/c" filename.txt | grep -v ".zip"
Search Command History
# find all lines in bash history that contain the search_patternhistory| grep search_pattern
While it is true that Ctrl + D will exit the current shell when no process is running, it is useful to know that you can send EOF to a the running process with Ctrl + D as well.
Thank you for your work I appreciate been looking for a quick refresher on the key commands. And to all of those whose key commands were having issues. If a CMD'let is not working properly or to your specific requirements then altering the command individually is always an option and updating the profile with the custom cmdlets. Or you could begin to understand the light shinning behind the darkness and begin researching Darwin Series in MAC and why it was discontinued. Then maybe you can understand why things in our lives have stopped be so reliant on our personal control and we now have assistance wether we ask for it or not. ::Only after one opens their mind to the realm of possibilities;; then one can begin to open their mouth and say::: MOO!!!!!!!
#!/bin/bash
count=99
if [ $count-eq 100 ]
thenecho"Count is 100"elif [ $count-gt 100 ]
thenecho"Count is greater than 100"elseecho"Count is less than 100"fi
# OR exampleif [[ "$repl_IO"!="Yes"-o"$repl_SQL"!="Yes" ]] ;then
I have some .bashrc & .bash_prfile commands, but none that affect bindings if that's even possible. And my Terminal preferences aren't doing anything crazy. So why won't several of these commands work for me?