Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /homes/work/abc.txt
- --> abc.txt
- awk -F "/" '{print $NF}' input.txt
- abc1.txt
- abc2.txt
- abc3.txt
- $>cat input.txt
- text path/to/file/abc1.txt
- path/to/file/abc2.txt
- path/to/file/abc3.txt
- sed 's:.*/::' file
- grep -oP '(.*/)?K.*' file
- rev file | cut -d/ -f1 | rev
- while IFS= read -r line; do
- basename "$line"
- done < file
- echo "/homes/work/abc.txt" | awk '{sub(/.*//,x)}1'
- abc.txt
- echo "/homes/work/abc.txt" | awk -F/ '$0=$NF'
- abc.txt
- echo "/homes/work/abc.txt" | awk -F/ '{$0=$NF}1'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement