Created
November 29, 2013 14:13
-
-
Save strlcp/7706261 to your computer and use it in GitHub Desktop.
find files in actual dir or some else dir and do something with them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set +x | |
| unset list count file | |
| MAX=12 | |
| while IFS= read -r -d '' F; do | |
| let ++count; | |
| FH=$(printf "$F" | awk '{print $2}') | |
| if [[ count -gt $MAX ]]; | |
| then unset count; | |
| break; | |
| fi; | |
| ## copy here like | |
| ## scp quelle -> ziel | |
| ls -al $FH | |
| # | |
| done < <(find . -type f -printf "%C@ %p\n" -print0 | sort -rn ) | |
| ### | |
| # this one seems more handy: | |
| for I in $(find . -printf "%C@ %p\n" | sort -rn | awk '{print $2}' | head -21);do ls -al $I ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment