To clear the terminal manually:
⌘+K
Command+K for newer keyboards
To clear the terminal from within a shell script;
/usr/bin/osascript -e 'tell application "System Events" to tell process "Terminal" to keystroke "k" using command down'
More Related Contents:
- grep -P no longer works. How can I rewrite my searches?
- How to run a shell script in OS X by double-clicking?
- OS X / Linux: pipe into two processes?
- calling conda source activate from bash script
- How to run mvim (MacVim) from Terminal?
- How do I create a Bash alias?
- Where to place $PATH variable assertions in zsh?
- Why isn’t DYLD_LIBRARY_PATH being propagated here?
- Is there any graphical “sudo” for Mac OS X?
- How do I set a task to run every so often?
- How to get the PID of a process by giving the process name in Mac OS X ?
- OSX: check if the screen is locked
- Run a script only at shutdown (not log off or restart) on Mac OS X
- How do you reset the stored credentials in ‘git credential-osxkeychain’?
- Where can I find a list of Mac virtual key codes?
- Replace comma with newline in sed on MacOS?
- MATLAB: how to display UTF-8-encoded text read from file?
- Where is /var/lib/docker on Mac/OS X
- gdb doesn’t work on macos High Sierra 10.13.3
- Variables overwriting text problem with “echo” in Bash
- sed -i command for in-place editing to work with both GNU sed and BSD/OSX
- NSWindow contentView not cover full window size – macOS & SwiftUI
- check internet connection in cocoa application
- bash command not found when setting a variable
- How to map a custom protocol to an application on the Mac?
- How to set keyboard shortcuts to jump to beginning/end of line? [closed]
- How to install gdb (debugger) in Mac OSX El Capitan?
- Using IOHIDManager to Get Modifier Key Events
- How to install gnu ld on mac os x 10.6?
- Could not find conda environment