<aside> 💡 별다른 설치과정 없이 쉘 스크립트 커맨드만으로 파일 전송하기
</aside>
파일을 전송하고자 하는 컴퓨터에서 아래 명령어를 통해 upload
curl --upload-file {업로드할 파일 경로} <https://transfer.sh/{파일명}
>
a.txt
라는 파일을 업로드하는 명령어이다curl --upload-file ./a.txt <https://transfer.sh/a.txt
>다운로드 받고자 하는 컴퓨터에서 아래 명령어를 통해 다운로드
curl {다운로드용 url} -o {다운로드할 파일 경로}
curl [<https://transfer.sh/Vtgfmt/a.txt>](<https://transfer.sh/Vtgfmt/a.txt>) -o a.txt
transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\\nUsage:\\n transfer <file|directory>\\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "<https://transfer.sh/$file_name>"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "<https://transfer.sh/$file_name>"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "<https://transfer.sh/$file_name>"|tee /dev/null;fi;}
transfer 명령어 한 줄로 업로드를 간편하게 할 수 있게 됨