Tag Info

New answers tagged

3

When you run find / -name VISA, the / always refer to the root directory of your Mac and not the external drive because it's an absolute path. It's the same on any UNIX-Based system. What you want, is to specify the folder where OSX has mounted your drive: find /Volumes/ASTUTE -name VISA And since you only want to search for folder you can use the -type ...


0

chmod -R a-wx,u+rwX,go+rX path Above is a modification to bobince's and martinp's answers. I don't have the reputation to comment, so I am posting this as an answer. As pointed out on the comment on martinp's answer, this should work fine.


0

Try the following find usage: find . -type f -not -path '*/\.*' Which would ignore all the hidden files (files and directories starting with a dot).


0

Since you have navigated to the destination folder, you only need to search in current directory. Change the command to find . -name VISA


0

A perl solution perl -le 'use File::Find; find (sub {if(/\.mkv$/) {$d{$File::Find::dir}++}}, "."); END {for (sort keys %d) {print if $d{$_}>1}};' This code is similar to others. The treewalk (of current directory ".") is counting the directory whenever it encounters a .mkv file (stored in the %d hash). After the walk, all directories with more than 2 ...


0

I might try something like this: find dirname -type f -name '*.mkv' -print0 | xargs -0 -L 1 dirname | sort | uniq -c | egrep -v '^ *1 ' | sed 's/^ *[0-9]* //' The find outputs the names of all the .mkv files, then the xargs does a dirname on everything to extract only the directory name, sort all the entires, have uniq provide a count of repeated lines ...


1

I'd suggest instructing find to look for all the files and print out the containing directory of each match, so you won't need to worry about parsing weird strings. Then use uniq to count the duplicates and awk to filter on the first field printing out those occurring more than once. e.g. find . -type f -iname '*.mkv' -printf '%h\n'|sort|uniq -c | awk '$1 ...


0

Kind of a hack but that's what I would do: for dir in $(find . -type d) do if [ $(ls -l "$dir" | grep '\.mkv$' | wc -l) -ge 2 ] then echo "$dir" fi done How this works: Find all subdirectories of the current directory find . -type d and loop over them with every directory being saved in the variable dir If the directory contains more than 2 ...


0

As usual... it takes me reaching out for help to solve the problem myself... alias find='find . ! -path "*/.git/*" ! -path "*/node_modules/*"'


2

Find is used for filenames. Grep is used to search within a file or files. So for this, we'll use grep. From the root directory you wish to search in, run: grep -r 'shareEventHandler.php\|repToolBroker.php\|loginProctor.php\|messageBroker.php\|emailBroker.php' . grep - search app -r recursive search from this directory down Use "\|" between search terms ...



Top 50 recent answers are included