It doesn't match. The substition in sed
will only run on matching lines, and sed
by default prints all lines. Try
echo "abcd" | sed -n 's|[^/]*/\(.*\)|\1|p'
The -n
flag means "No output by default" and the p
modifier at the end will print whenever it does a substitution.