News for hackers. Stuff that matters.
Re:Interesting commands for the Linux shell by Exuma on Thursday September 14, 2017 @11:01AM (#15248692)
Here are some that I use in Pet:

Description: Remove executable recursively for all files

    Command: chmod -x $(find . -type f)
Description: List files with permissions number

    Command: ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) *2^(8-i));if(k)printf("%0o ",k);print}'
Description: Output primary terminal colors

    Command: for i in {0..16}; do echo -e "\e[38;05;${i}m\\\e[38;05;${i}m"; done | column -c 80 -s '  '; echo -e "\e[m"
Description: NPM list with top-level only

    Command: npm list --depth=0 2>/dev/null
Description: Show active connections

    Command: netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | sed -e 's/::ffff://' |cut -d: -f1 | sort | uniq -c | sort -rn | head
Re:Interesting commands for the Linux shell by xelxebar on Thursday September 14, 2017 @11:39AM (#15249097)
While we're here sharing random cli-fu, you might like `find`'s native ability to spawn processes. Check out the `-exec` flag:

    find . -type f -exec chmod -x {} \+
Re:Interesting commands for the Linux shell by schoen on Thursday September 14, 2017 @12:23PM (#15249513)
This is more correct than the previous poster's approach, because it will work with files that contain space characters, while the previous poster's version breaks in this situation.

Another approach that works is

  find . type f -print0 | xargs -0 chmod -x
although find's built-in -exec can be easier to use than xargs for constructing some kinds of command lines.
Re:Interesting commands for the Linux shell by majewsky on Friday September 15, 2017 @09:53AM (#15257134)
You probably want a -r with that xargs. -r makes it exit without executing the command line if stdin is empty.
Re:Interesting commands for the Linux shell by schoen on Friday September 15, 2017 @01:11PM (#15258837)
I totally forgot about the case where find gives no output.
Re:Interesting commands for the Linux shell by Exuma on Thursday September 14, 2017 @01:18PM (#15250156)
Nice, thanks for that revision