Hot answers tagged

12

The ._ files are how OS X bsdtar handles OS X-specific extended attributes and resource forks. To keep them from being added to your tar files, you can pass COPYFILE_DISABLE=1 as an environment variable to tar. COPYFILE_DISABLE=1 tar cf newTar.tar /your/files


5

To my understanding, tar --exclude='._*' -cvf newTar . should work: Finder creates the ._* files but newTar shouldn't contain them. But you can completely bypass those files by invoking tar in passthrough mode. For example, to copy only the files from oldTar that are under some/path, use tar -cf newTar --include='some/path/*' @oldTar


3

You can look at the "/Producer" line: find -name '*.pdf' | xargs grep -al '^/Producer (pdfTeX' or with double quotes find -name '*.pdf' | xargs grep -al "^/Producer (pdfTeX" or with null-separated list of files find -name '*.pdf' -print0 | xargs -0 grep -al '^/Producer (pdfTeX'


3

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 ...


3

MacPorts has dash, which is what Debian uses. For that and other choices, read Is there a minimally POSIX.2 compliant shell?, in which the answers point out that the standard is vague in places.


2

Those files starting with "._*" are apple specific location indicator files according to THIS POST and you obviously can not get rid of them while logged in to your terminal om OSX, again according to the same page. You need to upload the file to a non-apple OS, get rid of those files and tar them up again. This seems to be the only solution.


2

Try this instead: osascript -e 'tell Application "Safari" to activate' osascript -e 'tell application "System Events"' -e 'keystroke "a" using command down' -e 'end tell'


2

You're missing pass proto icmp. It's usually a reasonable measure to have as your first pass rule: pass quick proto icmp Otherwise you're implicitly blocking that traffic. ICMP is its own protocol, remember, and not covered by TCP or UDP. See the OpenBSD page on PF.


2

When you use grep with color options it produces extra escape character sequences which tell the terminal to turn color on or off, these sequences introduce a risk of not being interpreted properly and causing unexpected results. You can view these by capturing grep's output With no color send greps output to output.txt % grep -o --color=none '.\+ middle ...


1

Mac OSX xargs does not support long options like GNU xargs. For using --replace like GNU xargs, use -I: find docs/ -name "*png" | xargs -I F python myscript.py "F" Note that this approach breaks with file name contain newline, you want to use find -print0 with xargs -0: find docs/ -name "*png" -print0 | xargs -0 -I F python myscript.py "F" or standard ...


1

xargs on Mac OS X doesn't support the --replace option; you can use -I instead: find docs/ -name "*png" | xargs -I F python myscript.py "F" The strange error message is produced because this version of xargs interprets characters after a single - as options, so with --replace it's looking for an option named -, which doesn't exist.


1

Based on L.Levrel response, using the tools supplied in OS X (this should also work in Ubuntu). find . -type f -name '*.pdf' -exec grep -alE '/Producer \(pdfTeX|/Producer\(pdfTeX' {} +


1

From http://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities Brew install coreutils your commands will be accessible with g préfix so call gsplit


1

You are receiving that error because the program "update_prebinding" is not in your PATH, possibly because it is not installed on your system.


1

-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 ...


1

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 ...


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

You can use GNU stat on Linux: stat --file-system --format=%T /tmp/subdir/whatever tmpfs



Only top voted, non community-wiki answers of a minimum length are eligible