Page 1 of 1
fsql
Posted: Fri May 26, 2017 12:46 pm
by franksinistra
https://github.com/kshvmdn/fsql
Search files under any directory with SQL-like syntax. Useful stuff.
Re: fsql
Posted: Sun May 28, 2017 10:34 pm
by wuxmedia
OMG I might even get good at SQL...
what happens if one types drop tables? and how about... oh it's only search...
how about putting fucking grep into the mysql command line, that'd be good.... i suppose do a mysql command on the bash shell and grep it.
Re: fsql
Posted: Mon May 29, 2017 9:03 am
by franksinistra
how about putting fucking grep into the mysql command line
exactly how i feel......
Re: fsql
Posted: Tue May 30, 2017 12:05 pm
by wuxmedia
^ yes- although I was pleased to see Ctrl -r works as expected (searches previous commands) :D
my solution is to run in tmux (all the servers are) and hit copy mode and do a search from there.
Code: Select all
mysql --user="$user" --password="$password" --database="$user" --execute='select * in wp_posts;'
works piped to grep, but what a mouthful...
this is the other way someone showed me at work:
Code: Select all
rgrep -l "searchterm" /var/lib/mysql/user/*
to find table, then:
Code: Select all
strings wp_options.* | grep <searchterm>
to narrow it down
Re: fsql
Posted: Tue May 30, 2017 5:19 pm
by franksinistra
^ I used to do mysqldump to /tmp and grep from there, works pretty nice until a co-worker made a nice ORM wrapper for it.