This oneliner solve the following task. Say we know the list of methods which usages was modified in code.
OldLib.packageFoo.bar.methodBuz(); or AnotherLib.foo.methodBar(); was replaced to new call NEW.static.methodBuz() and NEW.static.methodBar(). We have a long list of methods in targets.sorted.txt and we would like to check if there are no old calls left on our large codebase.
$ cat /tmp/targets.sorted.txt
methodBuz
methodBar
$ cat /tmp/targets.sorted.txt | xargs -I {} sh -c "grep --include=\*.js -Ri -E 'NEW[a-zA-Z0-9.]+[^c]\.{}\(' ./"$ for file in `find ./src/my/dir -type f | grep -E "\.ts|js"`; do if [ "$(grep -c "class " "${file}")" -gt 1 ]; then echo "${file}"; fi; done$ nc -zvw3 192.168.1.5 8080$ ssh myuser@192.168.0.10 "tar --exclude='cache*' --exclude='temp*' -cz ~/some/folder" > folder.tar.gzin case of you don't want to have /home/myuser as part of path in unpacked folder, consider use this one:
$ ssh myuser@192.168.0.10 "cd ~/some/ && tar --exclude='cache*' --exclude='temp*' -cz ./folder" > folder.tar.gzincluding # character
#! /usr/bin/env python
$ mkdir my-project
$ cd my-project
$ virtualenv py3 -p $(which python3)
$ source ./py3/bin/activate
$ python --version
$ deactivate
$ python --version$ find ./src -type f | grep .js | xargs -I {} sh -c "./node_modules/.bin/prettier-eslint --no-bracket-spacing --print-width=120 --tab-width=4 --single-quote --write {}"$ cat myfile.txt | xclip -selection clipboard
$ xclip -o$ for i in {1..10} ; do sleep 5; echo -ne "`date`\t: "; { time wget -U "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36" -O /dev/null google.com;} 2>&1 | grep real ; done$ cat /var/log/mysql/mysql.log | grep -o "`tail /var/log/mysql/mysql.log -n 1 | grep -oP "\d+"` " | wc -l$ find . -type f -name *.es6 | grep -o -P ".+(?=.es6)" | xargs -I {} sh -c "rm {}\.js*"$ ssh dk@hostname "sh" < ./task.sh$ ssh dk@hostname "sh -s 'hey, this is first argument for task.sh' 'second arg'" < ./task.sh$ source ~/.bashrc$ for i in $(seq 100); do printf "+1 800 1%07d\r\n" $i ;done > /tmp/numbers-100.txt$ ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub# contains binary
$ dd if=/dev/zero of=file-19mb.dat bs=19M count=1
# contains random numbers
$ tr -c "[:digit:]" " " < /dev/urandom |head -c 10m > test.10m.txt$ ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=90 output.mp4$ HandBrakeCLI -i rotated.mp4 -o re-rotated.mp4 --rotate="angle=90:hflip=0"