Rename the latest created file in a directory in linux

Try the following:

ls -ltr | awk '{ field = $NF }; END{ print field }' | xargs -I '{}' mv '{}' newfile.txt

Use find to identify recently modified files instead of parsing ls

find /path/to/search -type f -printf ‘%TY-%Tm-%Td %TT %p\n’ | sort -r | head -n1 | xargs -I '{}' mv '{}' newfile.txt