New answers tagged terminal
1
I solved this by writing a python script. When you run it you can specify an application to dump the list of windows IDs for, or if you don't specify any application it'll dump all the windows.
The windows are dumped presentation order, so whatever is at the top of the list is the 'highest' window (ostensibly the currently active one if it's visible)
...
2
This is no longer working in the latest build, you'll have to go back to
https://code.google.com/p/iterm2/downloads/detail?name=iTerm2-1_0_0_20120726.zip
as mentioned in the original ticket that got the feature added:
https://code.google.com/p/iterm2/issues/detail?id=789
0
chflags can set various options on a file that affect its display in Finder. See man chflags, which mentions that the existing flags on a file can be seen by using ls -lO.
Extended Attributes are also a possibility (although I think less likely for this issue): try ls -l@, or xattr -l filename to see those.
2
I would suggest
find . | xargs open
0
According to an answer here, a folder can be excluded from Spotlight indexing (achieving the same effect as adding it to the Privacy tab, although the folder won't actually be listed there) by either
adding .noindex to the end of the folder's name, or
creating an empty file .metadata_never_index inside the folder (eg with touch ...
0
See if the permissions of the file /etc/passwd are set up like this:
-rwxr--r--
because it reads the user name from the passwd file.
4
You can use the following Terminal command:
defaults write com.apple.Dock showhidden -bool YES && killall Dock
This can be undone with…
defaults delete com.apple.Dock showhidden && killall Dock
0
The shortcuts for all applications are stored in ~/Library/Preferences/.GlobalPreferences.plist, and application-specific shortcuts are stored in ~/Library/{,Containers/*/Data/Library/}Preferences/*.plist.
defaults write -g NSUserKeyEquivalents '{
"Show in Finder" = "$@r";
"Reveal" = "$@r";
"Minimize" = "\0";
"Minimize All" = "\0";
}'
defaults write ...
0
You could use the defaults command on ~/Library/Preferences/com.apple.symbolichotkeys.plist.
The file's structor seems a bit overly complex, but:*
131072: Shift
262144: Control
524288: Option
1048576: Command
Add modifier values together in the 3rd parameter to combine them.
{ AppleSymbolicHotKeys = {
# Move focus to the ...
1
Solved by myself. XQuartz installation added a custom configuration for ssh in etc/ssh_config. I have just removed ForwardX11 yes and ssh won't open XQuartz anymore.
1
I don't think it'll be possible - terminal-based applications (as those running in terminal emulators like Terminal.app, iTerm.app, etc are) don't support multiple concurrent fonts. This is because a terminal application is written to run on a traditional dumb terminal which wouldn't have the concept of multiple fonts. Within a terminal emulator, all text is ...
0
In OS X it's launchd that sets the initial path for everything, not your terminal files.
Now, on an unrelated note, I just found out that in OS X
ps -E
will show the environment that the process has been given. I'm sure everybody knew this except for me,but I'm very excited! Why?
Because now I can provide a partial answer.
ps -EA
Will show you the ...
2
The .bash_profile.macports-saved... are not actually executed, they're just backups. You can remove them if you don't need them.
.bash_history contains the last commands you executed on the shell. There's no point in deleting it, but you can remove it if you want.
If you uninstalled MacPorts (and deleted /opt), you can remove from your PATH all the ...
0
You can edit the plist in a text editor after converting it to XML:
plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist
Then add entries like this to the LSHandlers array:
<dict>
<key>LSHandlerContentType</key>
<string>com.adobe.pdf</string>
<key>LSHandlerRoleAll</key>
...
1
Check out duti:
duti is a command-line tool written by Andrew Mortensen, designed to set default applications for document types and URL schemes on Mac OS X.
Document types on Mac OS X are defined by what Apple calls Uniform Type Identifiers, or UTIs. HTML files, for example, have a UTI of public.html. Microsoft Word documents are described by the ...
0
This question is answered very thoroughly here: http://superuser.com/questions/259248/mac-osx-change-file-association-per-file-on-the-command-line
Short answer: a file's application association is stored in the file's resource fork, and Apple provides two utilities (Rez and DeRez) which allow manipulation of resource forks... but this is not for the faint ...
1
unset it
unset DYLD_LIBRARY_PATH
The bash reference manual says
Once a variable is set, it may be unset only by using the unset builtin command.
4
There are 2 answers ☺:
Don't do it!
The wkhtmltopdf wasn't installed in /usr/bin. It shouldn't.
This directory is reserved to standard user Unix commands.
Check carefully where brew installed the last rc version.
The following command will tell you the truth:
type wkhtmltopdf
Most probably this installation directory is:
/local/bin
/usr/local/bin
...
0
Same way you would in any unix command line:
http://en.wikipedia.org/wiki/Mv
4
Goto your HomeFolder -> Library -> Preferences and delete the file : com.apple.terminal.plist
That should reset the settings on your Terminal
3
You should be able to turn your script into an application with Automator - Applications -> Utilities -> Automator.app. Look for an option called "Run Shell Script" and once you're done, it should behave like other apps in that anything that is dragged and dropped on it will be run with it. Good luck!
0
Try something like:
find ~/Pictures -iname *.jpg -exec cp {} ~/Documents \;
-2
Bash commands "free like" for Mac OSX.
This is the second reissue of this post. At first, I got two "-1". One because I was not describing in English, it is corrected. The other because I used "gawk" (which is not part of a standard OS X installation), it is also corrected, I now use "awk". The "-2" are still there ;-). The best is perhaps now to test and ...
1
Simple Automator Application :
Create a new Application
Add a Ask for text action
Add a Run a sheel script action
Select Pass input as Arguments
Copy the following script (Assuming ~/Desktop/Test exists)
=>
cd ~/Desktop/Test
say -o "$@.m4a" $@
Save your application. It's ready to use.
0
i would use python for this... since it is included in the vanilla OSX distibution.
Check wxPython together with pyApp
assuming you mean a gui-based app..
Using python you can use subprocess in order to call any terminal command from python eg:
import subprocess
subprocess.call("date")
2
Get homebrew and have it install the core utilities. You can then see if the GNU version of cp supports the flags you desire. Here is a good answer on a partner site and I'll excerpt the exact steps you'll need to have cp be replaced by the GNU version if you wish:
Here's homebrew - http://mxcl.github.com/homebrew/
Here's the long story - ...
2
The reason is that OSX uses BSD command line tools and the Unix tool tip users are probably using Linux which uses GNU command line tools.
You can install GNU tools on OSX (and BSD on Linux).
The easiest way is to use a package manager like Macports, Homebrew or Fink
1
This is a bit vague... what sequences are NOT implemented? One simple solution would be to see if iTerm2 is a better fit to your needs. Incidentally, have you tried:
~$ cat .bashrc
export TERM=xterm-256color
(I am setting my TERM to xterm-256color in my bashrc, so that I get a number of xterm-256color behaviour by default).
Having said that, a few ...
-1
I'm not really sure that this is what you want, but...
Terminal -> Preferences... -> Settings -> (select your default theme) -> Keyboard.
Here you can see – and edit – a list of shortcuts. See also the "advanced" tab of the same panel.
0
You can tell if it's enabled by running launchctl list | grep '^\d.*RemoteDesktop.*'. That will output a line if there's an active process for the RemoteDesktop agent, and will output nothing if not. There's an active process for the agent whenever Remote Management is enabled, even if there's no active connection (unlike something like Screen Sharing, where ...
0
I solved the problem by using iterm=>preferences=>URL_handler and connecting whoami to my username .. after restart on iterm, problem was no more
1
That issue is related to your $PS1, you're probably missing some escape character.
This one should work:
PS1="\[\e[1;31m\]\u[\w]$\[\e[0m\] "
1
With the \033]0;TEXT\007 escape sequence.
Example of use in bash echo -ne "\033]0;$PWD\007"
Which you could add to your $PROMPT_COMMAND if you use bash, or otherwise attach to you PS1 so it gets re-evaluated often
example: `export PROMPT_COMMAND='echo -ne "\033]0;$PWD\007"'
-3
brew is only for macs. oh!. i see you are using a mac. ok thn, open your terminal window. oh, its open. ok, then. i can help you no more. keep up the good work.
1
This Applescript should work for you, just replace the values on the first two lines to your liking. It opens a new window with the number of tabs specified (on line 2), and runs a given command in each of them (set on line 1).
Use AppleScript Editor or Automator to turn it into an application you can run like any other app, or you can use something like ...
2
You could try creating a profile for each tab (changing Shell > Run command), opening tabs for each profile in some window, and then saving the window as a window group. See this answer.
Or use an AppleScript like this:
tell application "Terminal"
activate
do script "echo 1" -- this always opens a new window
tell application "System Events"
...
2
shasum is working fine but echo "" doesn't produce an empty string:
pse@Fourecks:~$ echo "" | od
0000000 000012
0000001
This works better:
pse@Fourecks:~$ echo -n "" | shasum
da39a3ee5e6b4b0d3255bfef95601890afd80709
0
OS X and iOS all save known networks, so just forget that network and tell your computer to not ask to join networks.
The steps vary, but you should be able to open help from the Finder and search for "Choose preferred Wi-Fi networks" and it will guide you to the advanced settings for networking so you can delete any networks you don't want to join again. ...
2
In the Solarized themes the bright green, yellow, blue, and cyan foreground colors seem to be almost the same as the default foreground color.
Or if you were expecting it to add color to new places, it doesn't. Terminal setting files only change the settings that can also be changed from Terminal's preferences, like the values of ANSI colors.
2
iTerm 2 doesn't seem to support disabling line wrap either. 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')"
0
Fastest way is to setup it in System Preferences -> Sharing (unlock screen by clicking padlock on bottom) and then change name and Apply.
1
Setting the hostname via the Terminal is not permanent.
From the hostname manpage:
DESCRIPTION
The hostname utility prints the name of the current host. The super-user can set the hostname by supplying an argument. To keep the hostname between reboots, run `scutil --set HostName name-of-host'.
Alternatively, set the hostname in your System ...
1
Yes, it's certainly possible, but you'll need a bit of scripting knowledge to do it entirely. I wish I had a more elegant solution to edit things in place, but here's ham-fisted option if no one has a more surgical option.
I typically use slapcat to dump the current user details to a text file and then process is using perl or whatever other tool you want. ...
2
Using the Python Objective-C bindings, you could create just a small python script to get it from the built in OS X Dictionary. Here's a post that details this script"
#!/usr/bin/python
import sys
from DictionaryServices import *
def main():
try:
searchword = sys.argv[1].decode('utf-8')
except IndexError:
errmsg = 'You did not ...
2
I was also going to suggest open dict://word, but Google's dictionary API also uses the New Oxford American Dictionary:
#!/usr/bin/env ruby
require "open-uri"
require "json"
require "cgi"
ARGV.each { |word|
response = ...
6
You can use...
open dict://my_word
...which will open the Dictionary application and lookup the string my_word. If you want to use multiple words use something like open dict://"Big Bang Theory".
There's no output in the Terminal though.
1
The open command exits after it opens Finder. Even if it didn't, closing a shell would close background processes. You could try using disown:
/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder & disown $!
Or launchctl submit:
launchctl submit -l my.finder /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
launchctl remove ...
0
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 PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
...
2
A launchd service supports the WatchPaths option, which launches a program when the contents of a folder are changed:
WatchPaths <array of strings>
This optional key causes the job to be started if any one of the listed paths are modified.
By watching /Volumes, a shell script can be created which would check whether your external disk is ...
2
You can install XQuartz as a binary from http://xquartz.macosforge.org. It's the de facto standard X11 for OS X. It comes with luit and all the normal X11 stuff.
Homebrew does not have an X11 installer; it expects you tu use XQuartz, and will compile against it when it is present.
You could also use AppleScript to programmatically change your Terminal ...
Top 50 recent answers are included


