Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- cd ~/Desktop;
- thefile= ls -t -U | grep -m 1 "Screen Shot";
- echo "Most recent screenshot is: "$thefile;
- Screen Shot 2011-07-03 at 1.55.43 PM.png
- Most recent screenshot is:
- thefile=$(ls -t -U | grep -m 1 "Screen Shot")
- thefile=$(ls -t *"Screen Shot"* | head -n 1)
- echo "Most recent screenshot is: $thefile"
- thefile=$(find -maxdepth 1 -type f -name "*Screen Shot*" -printf "%T@ %p" |
- sort -k 1n | tail -n 1)
- #!/bin/zsh
- set -e
- cd ~/Desktop
- thefile=(*"Screen Shot"*(om[1]))
- echo "Most recent screenshot is: $thefile"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement