Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about the Terminal application or its terminal emulation should use this tag. Use **command-line** for questions about shells or command-line programs that do not specifically involve Terminal.
10
votes
Can a Terminal window be resized with a Terminal command?
You could always use AppleScript:
setwidth() { osascript -e "tell app \"Terminal\" to tell window 1
set b to bounds
set item 3 of b to (item 1 of b) + $1
set bounds to b
end"; } …
2
votes
How can I bind only Left-Option to Meta/ESC in Terminal?
>
<root>
<appdef>
<appname>APPLETERMINAL</appname>
<equal>com.apple.Terminal</equal>
</appdef>
<item>
<name>Terminal meta</name>
<identifier>private.terminal-meta</identifier>
<only>APPLETERMINAL</only …
0
votes
terminal search files by text that the file names contain
I use glob-complete-word a lot:
open */*deh # press \eg to complete paths
Also add set show-all-if-ambiguous on to ~/.inputrc if you haven't already. If there are multiple completions, it makes the …
4
votes
Accepted
How to keep PS1 changed in terminal?
If both .bash_profile and .profile exist, bash reads only .bash_profile when opening a login shell. So try adding the line to .bash_profile instead.
1
vote
Print All Files in Folder and SubFolders
POSIX requires specifying the path argument for find (like find . instead of find) and -printf is a GNU extension.
List regular files sorted by modification date:
find . -type f -exec stat -f'%m %N' …
3
votes
Accepted
Show package contents from command line
Using open -R for the first file in the bundle would work even if the bundle doesn't have a Contents directory:
reveal() (
shopt -s nullglob
for f; do
a=("$f"/*)
[[ -d $f && ${#a} != 0 ]] …
5
votes
Accepted
Access Saved Searches Command Line
Use the RawQuery key as an argument for mdfind:
mdfind "$(/usr/libexec/PlistBuddy -c 'Print RawQuery' test.savedSearch)"
2
votes
Any way to make Cmd-D "delete next word" rather than "split-pane" in Terminal
I don't know how to bind ⌘D to M-d, but this would remove the shortcut of the Split Pane menu bar item:
defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add "Split Pane" nul
9
votes
Accepted
Is there a way to auto-complete the open command in Terminal?
_complete_open() {
COMPREPLY=()
local cur="${COMP_WORDS[$COMP_CWORD]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"
[[ "$cur" == -* || "$prev" != '-a' ]] && return
…
5
votes
Can I adjust the time delay for when the dock re-appears?
defaults write com.apple.dock autohide-time-modifier -float 0.6 reduces the delay and makes the animation for showing and hiding the Dock faster.
defaults write com.apple.Dock autohide-delay -float 0 …
0
votes
How do I fix Terminal.app when my shell has been set to an illegal value?
I wasn't able to open Terminal, and nothing happened when I tried to show the advanced options sheet in the Users & Groups preference pane. I was able to run chsh -s /bin/bash in iTerm 2 though. …
0
votes
Always open a file in a specific program
You could try editing ~/Library/Preferences/com.apple.LaunchServices.plist:
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentTag=indd;LSHandlerContentTagClass=public.fi …
0
votes
how to tab text blocks in terminal input line
If you check Preferences > Settings > Keyboard > Use option as meta key, you can also use ⌥B and ⌥F (and ⌥⌫ will delete a word backward).
Terminal's default settings also affect programs like vim an …
0
votes
How do i autorun .command files from a USB drive when I plug it in?
I couldn't get this to work reliably, but you could try saving a property list like this as ~/Library/LaunchAgents/showall_external.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLI …
6
votes
Disable line wrapping for output in the Terminal
You might just use less or cut though:
less /var/log/system.log
expand /var/log/system.log | cut -c 1-$COLUMNS
less -s <<< "$(osascript -e 'tell app "Terminal" to contents of window 1')" …