Tag Info

New answers tagged

0

I'm not sure what version of OSX & the various tools you are using but I have the following setup on my OSX system and ls -G shows the same column alignments as the vanilla ls. Examples     My setup consist of the following environment variables. $ env|grep -Ei "cli|ls|col" TERM=xterm-256color CLICOLOR=1 LSCOLORS=GxFxCxDxBxegedabagaced ...


1

There are a couple potential reasons for this. 1) You told it to delete directories only (-type d), and those directories still have files inside them. 2) Your directories only contain other directories, so the -type d will take care of the contents issue. However you are using OS-X, which is largely based on FreeBSD, and the FreeBSD find by default will ...


2

find's -delete flag works similar to rmdir when deleting directories. If the directory isn't empty when it's reached it can't be deleted. You need to empty the directory first. Since you are specifying -type d, find won't do that for you. You can solve this by doing two passes: first delete everything within dirs named __pycache__, then delete all dirs ...


1

You can do this with ls, sort, tail and cut. Start with renaming bash_history to bash_history 1 so all files have a number. Then run the following to copy the next file: #!/bin/bash D=~/Desktop/Coding/Bash\ Histories num=$(ls "$D" | cut -d ' ' -f 2 | sort -nr | head -1) num=$(( num + 1 )) cp ~/.bash_history "$D/bash_history $num" The ls $D just lists ...


56

From your other questions I take it you're using OS X. The default HFS+ filesystem on OS X is case-insensitive: you can't have two files called "abc" and "ABC" in the same directory, and trying to access either name will get to the same file. The same thing can happen under Cygwin, or with case-insensitive filesystems (like FAT32 or ciopfs) anywhere. ...


0

Actually the link provided by Samantha seems to give the easiest solution: diskutil list and you will see something like: $diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *251.0 GB disk0 1: EFI ...


0

The wchar line (written characters) in /proc/$pid/io can give you precise information about the dd process. As long as it changes, your dd is still working! Here is a neat little php script, which you can save and then execute with php filename.php during the dd to display the written bytes. The nice benefit of watching /proc/$pid/io over kill -USR1 $(pidof ...


1

Just wanted you to know that I found a solution to avoid the now famous "30 seconds wait" ;-) I have a Mid-2012 MacBook Air. I tried all your mentionned solutions to speed up the boot under Yosemite, but the best one to me was to change the refind folder name on the EFI partition, and also rename the refind file. So, it gives : By security, I added all ...


1

As in the first answer you have run various commands with the elevated command, sudo, in your personal space. Now you have directories in your personal space that are owned, not by you, but by root. If you type cd with no parameters you'll be taken to the bottom of your personal space (where it starts) and be able to see it with the pwd command. On many ...


0

This will depend on the permissions of the folders/files you are trying to modify and not on the commands themselves. You probably ran a git command as sudo once and that changed the ownership to root. I could give you a more specific answer if you posted the output of ls -l on your git repository. Assuming the problem is what I described above, you can fix ...


0

The application XMLStarlet appears to be available on OSX via brew, so you should be able to install it like so: $ brew install xmlstarlet Once it's installed, you use it via the command line via the command xmlstarlet. Usage $ xmlstarlet XMLStarlet Toolkit: Command line utilities for XML Usage: xmlstarlet [<options>] <command> ...


0

Try making a symlink, by using this: ln -s /DesktopClient "~/Development/Quote/DesktopClient/src/main/webapp"


2

You can install ImageMagick and use the identify tool with -verbose, for example: for f in *.jpg *.jpeg *.JPG *.JPEG *.mp4 *.MP4; do echo $f identify -verbose "$f"|grep exif:DateTime echo done Kepler22b-artwork.jpg Kepler-62f_with_62e_as_Morning_Star.jpg exif:DateTime: 2013:04:08 10:45:44 logo.jpg P1050030.JPG exif:DateTime: 2013:11:01 ...


0

Recent versions of Mac OS X now include xinetd by default, e.g. see: http://support.apple.com/kb/TA20863?viewlocale=en_US


0

Using the --eas option when running the install.sh worked like a charm for me!


0

Since Finder is built in objective-c it uses nib localizations. Here is an example. /System/Library/CoreServices/Finder.app/Contents/Resources/sv.lproj/ServicesMenu.strings sv.lproj stands for Svenska.localized project Here is the contents of ServicesMenu.strings bplist00”[Finder/Open]Finder/Reveal_Finder/Show InfolFinder/÷ppna_Finder/Visa i ...


1

Use asterisks... E.g.: /Users/frank/Library/Application*Support/Google/Drive/*.log I use newsyslog to clean my Navicat Lite logs in the library/application support folder like so: # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] ...


0

This works on your example input line: sed 's/.* \([0-9].*)\) .*>/(\1: RAW DATA OUT:/ ' <<\DATA 1: (10/17 12:49:31.175) - CONSTANT ID1 - CONSTANT ID2: RAW DATA OUT > [0x00,0xa2,…,0x00] DATA It prints: (12:49:31.175): RAW DATA OUT : [0x00,0xa2,…,0x00]


1

You can also call perl from bash. The -n arg makes it loop for each line. -e means the script is one line. cat in.txt | perl -ne 's{.*(.*\().*? (.*) -.*(:.*?)\s\s+.*(\[.*)}{$1$2$3 : $4};'


0

sed ' s/^[^(]*// s/([^ ]\+ /(/ s/ - CONSTANT ID// s/ \+>/ :/ ' <<DATA 1: (10/17 12:49:31.175) - CONSTANT ID: RAW DATA OUT > [0x00,0xa2,…,0x00] DATA (12:49:31.175): RAW DATA OUT : [0x00,0xa2,…,0x00] The newlines in the sed script can be replaced by semicolons if you prefer In a while-read loop: while read line; do echo ...


2

I fixed the issue by simply adding the --alldrivers when installing refind. Yosemite dual boot works now like before. Fast, and everything is reconized in the refind boot menu. install.sh --alldrivers


-2

I have a MacBook Pro mid-2012 and just upgraded to Yosemite from Mavericks. Could not see the rEFInd and found the solution here.


0

On Yosemite, rEFind needs to be installed to the EFI System Partition (ESP), which reside on /dev/disk0s1. You could either do this manually by using bless (like in Meow's procedure), or you could simply use the --esp option when installing rEFind, like so: ./install --esp. The problem with this, like noted in rEFind's documentation, is that the boot ...


1

I figured out a workaround for using rEFInd in Yosemite, but please note that it is probably not the best solution. I think the reason of rEFInd is no longer working under Yosemite is because the root partition of the system does not reside in a physical partition any more, thus rEFInd will not be able to be recognized at the boot stage. So, I tried install ...


62

It isn't a shebang, it is just a script that gets run by the default shell. The shell executes the first line //usr/bin/env go run $0 $@ ; exit which causes go to be invoked with the name of this file, so the result is that this file is run as a go script and then the shell exits without looking at the rest of the file. But why start with // instead of ...


8

It runs because by default executable file is assumed to be /bin/sh script. I.e. if you didn't specify any particular shell - it is #!/bin/sh. The // is just ignored in paths - you can consider is at as single '/'. So you can consider that you have shell script with first line: /usr/bin/env go run $0 $@ ; exit What does this line do? It runs 'env' with ...


1

As soon as the listening nc (server) gets closed, the client nc quits as well. On Mac OS X you can open -a 'Activity Monitor' to verify that. The reason why the nc & cat example hangs is not nc but cat that continues to keep its stdin and stdout open for reading and writing. However, when cat tries to write to the pipe after the listening nc has been ...


0

One way to do it is to use top to find the pid of the process using the most CPU. I started a bash CPU hog in one terminal: bash -c "while true; do :; done" Then in another terminal I can kill it as follows: kill $( top -l2 | grep bash | sort -nrk3 | awk '{print $1;exit}' ) Note, since this is osx, this is the BSD top and not the GNU version. -l2 ...


2

You should to try to rebuild the catalog file (B-tree) on the specified file system (which is HFS+) by specifying -r option for fsck, for example: $ fsck.hfsplus -fryd /dev/sdd2 This option currently will only work if there is enough contiguous space on the specified file system for a new catalog file and if there is no damage to the leaf nodes in the ...


1

I thought this is what is documented as Known bugs: Conque only supports the extended ASCII character set for input, not utf-8. - VT100 escape sequence support is not complete. Alt/Meta key support in Vim isn't great in general, and conque is no exception. Pressing Esc+Esc+x or Esc+M-x instead of M-x works in most cases. I haven't used Conque, ...


0

I found a script that does exactly what i want on stackoverflow.com. http://stackoverflow.com/a/20703594


0

In OS X 10.9.5 Mavericks you have to add an alias command to your bash profile file in your home folder: ~/.bash_profile which is equivalent to your user path at /Users/YOUR_USER_NAME/.bash_profile To see that file in finder you have to activate the display of hidden files (e.g. using the app InVisible). Otherwise you can simply use your terminal to ...


1

The log file that last uses was probably rotated on the first of the month. I'm not familiar with OS/X, but check the manpage for the file used, and do something like: last -f /var/log/wtmp.1 to tell last to list the logins from the older file.


0

I'm not sure which version of grep you are using, but if I'm reading the man page of grep correctly, then the scanning will be stopped after the first successful match. Is that what you want? What I understood from your question was that you wanted to "open all files". If you don't mind using vim or gvim, then you can use this: $ grep -n mystring *.ext ...


1

-exec takes the exit status of the command you put in it and uses it logicially within find So, just something simple like this should work find . -iname "*.ext" -exec grep -q "mystring" {} \; -exec open {} \;


1

I prefer the following method... cat example.txt ; echo This doesn't doesn't evaluate the contents of example.txt or occasionally add a newline. It just echos a newline once the cat is done, is easy to remember, and no one is thinking about whether they're using strong or weak quoting correctly. The only downside, really, is that you'll get an extra ...


3

If you have spaces in file names then you need to use print0 option for file, later -0 for xargs, and lastly -I {} for second xargs. find . -iname "*.maxpat" -print0 | xargs -0 grep -l "mystring" | xargs -I '{}' open '{}' Tested with emacs as an open command.


-1

Use pwd by find: find `pwd` -iname *.maxpat | xargs grep -l "mystring" | xargs open


1

Sometimes the copy succeeds and sometimes it fails. Probably it fail because some process in the while wrote to the mounted filesystem, guess that's why is a good practice to umount before :-) dd should really be just open and write, I guess the MacOSX version add some control and I think is easy to understand why with their device names, compared to ...


1

Well, I usually use unp (from terminal), it unzip any kind of compressed file (zip, gz, bz2, tar.gz, etc) it's pretty nice: $ unp mysql-connector-java-5.1.26-bin.jar Archive: mysql-connector-java-5.1.26-bin.jar creating: META-INF/ inflating: META-INF/MANIFEST.MF creating: META-INF/services/ inflating: META-INF/services/java.sql.Driver ...


1

You can typically create actions within the file managers, I know Nautilus provides this service, so you could create an action that's either custom to .zip files or could be a custom action on a context menu that would allow for this. Actions are shown how here in this tutorial: How to Easily Add Custom Right-Click Options to Ubuntu’s File Manager. NOTE: ...



Top 50 recent answers are included