One-liners: Difference between revisions
No edit summary |
add a find example |
||
| (One intermediate revision by the same user not shown) | |||
| Line 36: | Line 36: | ||
The wiki farm detection has changed (@fixme) on this site making it slightly different from mediawiki.org. Still, the one-liner should work but is failing silently whereas a manually executed substitution of <code>meld <(curl --silent -L "https://wiki.freephile.org/wiki/api.php?action=query&meta=siteinfo&siprop=general%7Cextensions%7Cskins&format=json" | jq '.') <(curl --silent -L "https://www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=general%7Cextensions%7Cskins&format=json" | jq '.')</code> does launch meld with the proper content. | The wiki farm detection has changed (@fixme) on this site making it slightly different from mediawiki.org. Still, the one-liner should work but is failing silently whereas a manually executed substitution of <code>meld <(curl --silent -L "https://wiki.freephile.org/wiki/api.php?action=query&meta=siteinfo&siprop=general%7Cextensions%7Cskins&format=json" | jq '.') <(curl --silent -L "https://www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=general%7Cextensions%7Cskins&format=json" | jq '.')</code> does launch meld with the proper content. | ||
Using more than a single line of code, you can do things with PHP's <code>yaml_parse</code> such as [https://github.com/freephile/meza/blob/37b9be51289b16868730cbc1070a188159323ee7/src/scripts/findDupesInLocalExtensions.php src/scripts/findDupesInLocalExtensions.php] | |||
==Perl edit== | ==Perl edit== | ||
| Line 97: | Line 99: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Find with exclusions == | |||
Trying to fix [[permissions]], I wanted to see if there were any executable files in the 'data' directory. It turned out that every file in the elasticsearch and uploads directories were +x somehow. So, I wanted to exclude those dirs and see if there was anything else. | |||
<syntaxhighlight lang="bash"> | |||
sudo find /opt/data-meza/ \( -name uploads -o -name elasticsearch \) -prune -o -type f -perm -ugo=x -ls | |||
</syntaxhighlight> | |||
{{References}} | {{References}} | ||