Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "/your/directory/here/bla" | awk -F"/" '{ print "/"$(NF-1)"/"$NF }'
- find /yourfolder/structure -type d | awk -F"/" '{ print "/"$(NF-1)"/"$NF }'
- $ echo /home/someone/foo/bar | awk -F / -v OFS=/ '{ print $(NF-1), $NF }'
- foo/bar
Add Comment
Please, Sign In to add comment