development

Find a String in Files Excluding Some Files

— tags: ‘shell, linux, command, development, grep,find’ categories: development — I use the following command to find a string in a Go repo. The vendor directory is not needed, so skip it. $ find . -type f |grep -v vendor|cut -d”:” -f2|xargs grep -n my_search_string The command find all files in current directory. Next, it […]

Read more
development

xargs: ls: terminated by signal 13

The following command hits a problem with sig 13. $ find . -type f|xargs ls -altr|head -rw-r–r– 1 root root 254111 Mar 17 2018 ./60/62 -rw-r–r– 1 root root 135111 Mar 17 2018 ./60/66 xargs: ls: terminated by signal 13 Why did it fail? $ strace find . -type f|xargs ls -altr|head newfstatat(AT_FDCWD, “xyxyx”, {st_mode=S_IFREG|0644, […]

Read more