Commit d96b6dd8 authored by platyhouse's avatar platyhouse

.

parent eb9d0a92
#!/bin/bash
clear && printf '\e[3J'
# 현재 디렉토리에서 가장 최근에 생성된 파일 찾기
# (디렉토리 제외, 숨김 파일 포함)
latest_file=$(find . -maxdepth 1 -type f -printf '%T@ %p\n' 2>/dev/null | sort -n | tail -1 | cut -d' ' -f2-)
# 파일이 없는 경우
if [ -z "$latest_file" ]; then
echo "현재 폴더에 파일이 없습니다."
exit 1
fi
# 파일명과 내용 출력
echo "파일명: ${latest_file#./}"
echo "내용: "
cat "$latest_file"
#!/bin/bash
clear && printf '\e[3J'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment