As I don't think it is possible to do a one-liner with cut
, let's propose a grep
solution:
$ grep -oE '[^/]+$' file
halt
killall
watchdog
iptables
network
evlogrmt
evlog
rdisc
syslog-ng
portmap
Of course, with awk
it is pretty simple: awk -F/ '{print $NF}' file
.