Skip to content

Instantly share code, notes, and snippets.

@strlcp
Created November 29, 2013 14:13
Show Gist options
  • Select an option

  • Save strlcp/7706261 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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