October 2016
Intermediate to advanced
392 pages
9h 2m
English

A typical Unix or Linux system includes hundreds of commands by default, which, when you factor in flags and the possible ways to combine commands with pipes, produces millions of different ways to work on the command line.
Before we go any further, Listing 2-1 shows a bonus script that will tell you how many commands are in your PATH.
#!/bin/bash # How many commands: a simple script to count how many executable # commands are in your current PATH IFS=":" count=0 ; nonex=0 for directory in $PATH ; do if [ -d "$directory" ] ; then for command in "$directory"/* ; do if [ -x "$command" ] ; then count="$(( $count + 1 ))" ...
Read now
Unlock full access