New answers tagged

0

find dir -name just supports shell file name glob characters as documented by man fnmatch. Some find implementations support non-standard extensions for regular expressions. Check your find man page.


0

-name takes wildcard patterns, not regexps and matches on the file name, not its full path. Use -regex (or -iregex) for regexp matching but beware it matches against the full path. Here, you could do: LC_ALL=C find -E . -iregex '.*s[0-9]{1,2}\.?e[0-9]{1,2}[^/]*\.mkv' Here, we're replacing the second .* with [^/]*, that is a sequence of non-/ characters to ...


2

When you use tab in bash (which is the shell used by default on OSX), it first tries to complete what you have typed up to now, then show non-ambiguous completion, then (third tab) all completions. You can change this behavior by creating a file named .inputrc in your home directory, and put in it: set show-all-if-ambiguous on This will remove the ...


-1

If you want it to apply in all accounts, you can also put alias ll='ls -lG' in /etc/profile.


1

My El Capitan has no setattr or setxattr (the latter is the name of a C runtime function: you could make your own utility using that). OSX provides xattr, which (noting comments such as Mac OS X Extended Attributes and Xattr) seems fairly recent. A comment in Manually set extended attributes on arbitrary files from 2011 gives a hint about OSX 10.5 You can ...


0

It's called xattr on OS X . You can use setxattr to set attributes.


0

The filesystem in /Volumes that you mention is the installation virtual disk (dmg). Hence why it is read only. Umount/Eject it and it will be gone. You can do it via the graphical interface or via: sudo diskutil umount '/Volumes/Grammarian PRO2 X' Be also careful what you do with the /Volumes directory, because it is the root of all your mounted ...


0

I had the same problem but I had it while running brew upgrade it, but I hope it will help you What helped in my case I cleaned up with brew cleanup boost Then I brew unlink boost Then brew uninstall boost Further brew cleanup ncmpcpp And brew unlink ncmpcpp - probably not needed for you Then brew uninstall ncmpcpp After in /Libraries/Caches/Homebrew I ...


0

Also, if you just want to exclude some lines ahead of a given marker, you could use: awk -v nlines=2 '/Exception/ {for (i=0; i<nlines; i++) {getline}; next} 1' (glenn jackman at http://stackoverflow.com/a/1492538 ) By piping some commands you can get the before/after behaivour: awk -v nlines_after=5 '/EXCEPTION/ {for (i=0; i<nlines_after; i++) ...


1

You can reach a good-enough result by using temporary files: my_file=file.txt #or =$1 if in a script #create a file with all the lines to discard, numbered grep -n -B1 -A5 TBD "$my_file" |cut -d\ -f1|tr -d ':-'|sort > /tmp/___"$my_file"_unpair #number all the lines nl -nln "$my_file"|cut -d\ -f1|tr -d ':-'|sort > /tmp/___"$my_file"_all #join the ...


1

pictures for review in video... ffmpeg can be used to assemble a set of images into a movie for review. The frame rate can be set to an interval of your choosing. Also, the video can be scrubbed, stepped through, or be played at various rates with program such as VLC media player. #!/bin/bash cd "/path/to/png/files" echo "DIRECTORY:" `pwd` > ...


1

The output of man is not pure text. Try to use man perl | col -b instead.


0

I've found a solution on my own by deep reading man lsof. (Yes, RT*M still helps.) Thanks @Gilles for aiming. Here is the solution: lsof -aPi -p 555 (555 is the PID). Explanation: -p to specify the PID number; -i to display only network devices; -a to AND two conditions above (otherwise they will be ORed); -P to display port numbers (instead port names ...


1

lsof provides information about files opened by processes, including network ports. It's available on pretty much all unix systems, including OSX. The Rosetta Stone for Unix doesn't list any other tool for “match process to file or port” on OSX. To list processes listening on a TCP port, you can use lsof -iTCP -sTCP:LISTEN lsof -iUDP lists processes ...


0

On FreeBSD, you can use sockstat for this information. I am not sure whether OS X has sockstat, as I don't have a Mac. For instance, to see all of the TCPv4 connections: sockstat -4


-1

if you want to know which port is listening you can use netstat's -p option.you need to be the superuser: $ sudo netstat -nlp | grep 80 tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 125004/nginx if you want to know more about it try this link


2

There is PureDarwin: http://www.puredarwin.org/ PureDarwin is the successor of OpenDarwin, and is a free, open source, community supported project to make Darwin more usable and compatible with non-Apple hardware. In reference to this question, PureDarwin is binary compatible as long as you do not rely on a library or other feature that is only available ...


-1

If you have a -blablaFile in your current folder it gives this error. To fix, change the file name, eg. remove - from the beginning. Then it will not give error. Example: blablaFile


1

Apple doesn't install it (afaik), so you'll need Fink or MacPorts or homebrew or a manual install. Assuming a properly configured PKG_CONFIG_PATH for Fink or MacPorts or homebrew or the manual install, in this case MacPorts, pkg-config might indicate the presence of gsl (and, bonus, the various compiler flags to use). % echo $PKG_CONFIG_PATH ...


4

That is because you are trying to use the GNU find, which is default in Linux, but Mac OS X comes with BSD find which has many differences. To install GNU find you will need Homebrew, pretty easy to install, just follow http://brew.sh/ After that you can install findutils: brew install findutils More info and other tools to mimic a Linux environment on ...


1

The pdfinfo command line tool is part of the xpdf package: brew install homebrew/x11/xpdf This package installs many things, including pdfinfo.


1

Another suggestion: You can also just buy a second hand brand name workstation (or build a custom one but I think it's not worth it) with 32/64gigs of ram and 2 x 8 core Xeon E5-2670s for instance (+hyperthreading, thus having 32 CPU threads), with 3 drives in RAID5 and install an OS as a hypervisor and have your 3 OS's in virtual machines. This way you can ...


1

I of course can't give you the answer to your situation, but I wan't to try and give you some ideas on it. First of all: use SSDs! I understood that you can't affort them yet, but you will definitely love them once you have them. And I assume it is a better idea to do this whole setup once and for all, not now and in a few month you have to do it all over ...


0

On Linux I use: sudo useradd -r -p \* -s /sbin/nologin -c "Comment My Daemon,,," -d "/var/uuu" myuser The next alternative must be more cross platform (if -r option is not available): sudo useradd -K UID_MIN=100 -K UID_MAX=499 -K GID_MIN=100 -K GID_MAX=499 -p \* -s /sbin/nologin -c "Comment My Daemon,,," -d "/var/uuu" myuser Here: password in ...


2

You specify the section first: man 2 chmod See man man for tons of information (although not so much in the Mac OS X version), including the meaning of the section numbers; 2 is for system calls, so the chmod(2) manpage describes the chmod system call provided by the kernel. On Mac OS X the system call manpages are provided in Xcode Tools, which need to ...


0

This will use the find command to retrieve dot files and files with the "hidden" flag set. The matching files are fed as an argument list into ls via sed (to remove the "." result as well as leading "./" prefixes) and xargs. This allows for the specification of additional ls parameters (e.g. -l). alias l.="find . \( -flags +hidden -or -name '.*' \) ...


2

This is potentially related to El Capitan and its System Integrity Protection (csrutil status) which can affect the dtrace behaviour. The potential fix includes rebooting Mac into recovery mode (⌘-R at boot time), then in Terminal run: csrutil enable --without dtrace to keep SIP enabled, but disable DTrace restrictions (note: this is undocumented ...


0

in the menus of Terminal.app use Window->Merge all windows.


0

This was a requested feature in the original iTerm six years ago, but the only activity on it was to set the priority to low. From poking around in itermocil, I think you should be able to do it to either Terminal.app or iTerm(2) by using AppleScript. However, I know very little about AppleScript and can't find any real documentation on it.


0

OS-X is a little tricky as I found out the hard way. The function keys are hidden behind the Fn (but I'm guessing you already found that since you said they work unmodified) Most of the function keys with the Fn applied are already assigned to other functions. Visit the Keyboard Shortcuts in System Prefs to fix these. What I have done is: Reverted to ...


0

There's CocoTron under an MIT license, but I can't tell if it is still alive or not. https://github.com/cjwl/cocotron . Has code checked in from 6 months ago but don't see much on the net about it.


1

Use find's -exec command: find ~/target_dir/ -iname '*some*' -depth 1 -exec mdls {} \; This will run mdls on every matching filename found by find. It will work with any filename, even those containing spaces or newlines etc. if mdls can work with multiple filenames on the command line, you could terminate the -exec command with + instead of \;. e.g. ...


2

If you run ps ax without the grep, you'll see the column headers: PID TT STAT TIME COMMAND ?? is in the TT column -- that's the controlling terminal for the process. The ?? indicates that the process isn't associated with a terminal. The U in the STAT column indicates that the process is in the uninterruptible sleep state. That explains why you ...



Top 50 recent answers are included