Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. /homes/work/abc.txt
  2. --> abc.txt
  3.  
  4. awk -F "/" '{print $NF}' input.txt
  5.  
  6. abc1.txt
  7. abc2.txt
  8. abc3.txt
  9.  
  10. $>cat input.txt
  11. text path/to/file/abc1.txt
  12. path/to/file/abc2.txt
  13. path/to/file/abc3.txt
  14.  
  15. sed 's:.*/::' file
  16.  
  17. grep -oP '(.*/)?K.*' file
  18.  
  19. rev file | cut -d/ -f1 | rev
  20.  
  21. while IFS= read -r line; do
  22. basename "$line"
  23. done < file
  24.  
  25. echo "/homes/work/abc.txt" | awk '{sub(/.*//,x)}1'
  26. abc.txt
  27.  
  28. echo "/homes/work/abc.txt" | awk -F/ '$0=$NF'
  29. abc.txt
  30.  
  31. echo "/homes/work/abc.txt" | awk -F/ '{$0=$NF}1'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement