Guest User

Untitled

a guest
Oct 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. echo "/your/directory/here/bla" | awk -F"/" '{ print "/"$(NF-1)"/"$NF }'
  2.  
  3. find /yourfolder/structure -type d | awk -F"/" '{ print "/"$(NF-1)"/"$NF }'
  4.  
  5. $ echo /home/someone/foo/bar | awk -F / -v OFS=/ '{ print $(NF-1), $NF }'
  6. foo/bar
Add Comment
Please, Sign In to add comment