instruction stringlengths 8 358 | output stringlengths 2 532 |
|---|---|
ํ์ฌ ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ ์๋์ ๋ชจ๋ ํ์ผ/๋๋ ํ ๋ฆฌ์ ๋ํด '.andnav' ํ์ฅ์๋ฅผ '.tile'๋ก ์ด๋ฆ ๋ณ๊ฒฝํ๋ ๋๋ผ์ด ๋ฐ์ ์ํํฉ๋๋ค. | find . -name "*.andnav" | rename -vn "s/\.andnav$/.tile/" |
ํ ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ์ ๋ชจ๋ ๋๋ ํ ๋ฆฌ์ "์คํ" ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | find ~ -type d -exec chmod +x {} \; |
"original.filename"์ ์ด๋ฆ ์์ "new."๋ฅผ ์ถ๊ฐํ์ฌ "new.original.filename"์ผ๋ก ์ด๋ฆ์ ๋ณ๊ฒฝํฉ๋๋ค. | rename 's/(.*)$/new.$1/' original.filename |
"original.filename"์ ์ด๋ฆ ์์ "new."๋ฅผ ์ถ๊ฐํ์ฌ "new.original.filename"์ผ๋ก ์ด๋ฆ์ ๋ณ๊ฒฝํฉ๋๋ค. | rename 's/^/new./' original.filename |
"file.txt"์ ๋ชจ๋ ๋น์ด ์์ง ์์ ์ค ์์ "prefix"๋ฅผ ์ถ๊ฐํฉ๋๋ค. | nl -s prefix file.txt | cut -c7- |
'/volume1/uploads' ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ ์๋์ '.mkv' ํ์ฅ์๋ฅผ ๊ฐ์ง ๋ชจ๋ ํ์ผ/๋๋ ํ ๋ฆฌ์ '.avi' ํ์ฅ์๋ฅผ ์ถ๊ฐํฉ๋๋ค. | find /volume1/uploads -name "*.mkv" -exec mv \{\} \{\}.avi \; |
๊ธฐ์กด ๋ชฉ๋ก์ cron ์์
์ ์ถ๊ฐํ๋, ๊ธฐ์กด ์์
์ ์ ๊ฑฐํ์ง ์๊ณ , 4์ 3์ผ(4๋ฒ์งธ ๋ฌ) ์๋ฒฝ 2์ 1๋ถ์ "scripty.sh"๋ฅผ ์คํํ๋๋ก ํฉ๋๋ค. ์ด ๋ ์ด ์ผ์์ผ์ ์์์ผ๋ก ํ ์ฃผ ์ค 5๋ฒ์งธ ๋ ์ธ ๊ธ์์ผ์ด๋ผ๋ฉด ์คํ๋ฉ๋๋ค. | cat <(crontab -l) <(echo "1 2 3 4 5 scripty.sh") | crontab - |
"ping google.com"์ ๋ชจ๋ ์ถ๋ ฅ ์ค์ ๋ ์ง ์๊ฐ ์คํฌํ๋ฅผ ์ถ๊ฐํฉ๋๋ค. | ping google.com | xargs -L 1 -I '{}' date '+%c: {}' |
"infile"์ ๋ชจ๋ ์ค์ ์ค ๋ฒํธ๋ฅผ ์ถ๊ฐํฉ๋๋ค. | nl -ba infile |
"long-file"์ ๋ชจ๋ ์ค์ ์ค ๋ฒํธ๋ฅผ ์ถ๊ฐํฉ๋๋ค. | nl -ba long-file \ |
"$string"์ ๊ฐ ์ค ์์ ์ซ์ ์ ๋์ฌ์ ')'๋ฅผ ์ถ๊ฐํฉ๋๋ค. | echo "$string" | nl -ba -s') ' |
๊ธฐ์กด cron ์์
์ ์ ๊ฑฐํ์ง ์๊ณ "filename"์ ๋ด์ฉ์ ์ฌ์ฉ์ "user"์ ๊ธฐ์กด cron ์์
์ ์ถ๊ฐํฉ๋๋ค. | crontab -l -u user | cat - filename | crontab -u user - |
"file1"๊ณผ "file2"์์ cron ๋ชฉ๋ก์ ๊ฐ์ ธ์ cron ์์
๋ชฉ๋ก์ ์ถ๊ฐํ๋ฉฐ, crontab์์ ํ์ฑํ ์ ์๋ ์ค์ ๋ํด ์ค๋ฅ๋ฅผ ์ ๊ณตํฉ๋๋ค. | cat file1 file2 | crontab |
dir_data ๋๋ ํ ๋ฆฌ์ ๊ทธ ํ์ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ์ฌ์ฉ์์๊ฒ ์คํ ๋ฐ ์ฝ๊ธฐ ๊ถํ์ ์ถ๊ฐํ๊ณ , ์ฌ์ฉ์์๊ฒ ์ฐ๊ธฐ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | find ~/dir_data -type d -exec chmod a+xr,u+w {} \; |
๋ชจ๋ ์ฌ์ฉ์์๊ฒ "ComputeDate", "col", "printdirections"์ ์คํ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | chmod a+x ComputeDate col printdirections |
"java_ee_sdk-6u2-jdk-linux-x64.sh"์ ์คํ ๊ฐ๋ฅ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | sudo chmod +x java_ee_sdk-6u2-jdk-linux-x64.sh |
".sh"๋ก ๋๋๋ ๋ชจ๋ ํ์ผ์ ์คํ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | chmod +x *.sh |
ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ํ์ผ ๋ฐ ๋๋ ํ ๋ฆฌ์ ๋ํด ์จ๊ฒจ์ง ํ์ผ์ ํฌํจํ๊ณ ".."์ ์ ์ธํ๊ณ ๊ทธ๋ฃน ์ฐ๊ธฐ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | chmod g+w $(ls -1a | grep -v '^..$') |
ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ํ์ผ ๋ฐ ๋๋ ํ ๋ฆฌ์ ๋ํด ์จ๊ฒจ์ง ํ์ผ์ ํฌํจํ๊ณ ".."์ ์ ์ธํ๊ณ ๊ทธ๋ฃน ์ฐ๊ธฐ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | chmod g+w .[^.]* ..?* |
ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ํ์ผ์ ๊ทธ๋ฃน ์ฐ๊ธฐ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | find . -maxdepth 0 -type f -exec chmod g+w {} ';' |
"*" ๋๋ "...*"์ ์ผ์นํ๋ ๋ชจ๋ ํ์ผ์ ๊ทธ๋ฃน ์ฐ๊ธฐ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | chmod g+w * ...* |
"file"์ ๊ฐ ๋น์ด ์์ง ์์ ์ค์ ๋ฒํธ 1000001๋ถํฐ ์ค ๋ฒํธ๋ฅผ ์ถ๊ฐํฉ๋๋ค. | nl -v1000001 file |
ํ์ค ์
๋ ฅ์์ ๋ฐ์ ๋ชจ๋ ๋น์ด ์์ง ์์ ์ค ์์ ์ซ์์ "^M${LOGFILE}> "์ ๊ฐ์ ์ ๋์ฌ๋ฅผ ์ถ๊ฐํฉ๋๋ค. | nl -s"^M${LOGFILE}> " |
"node" ๋ช
๋ น์ ์ฝ๊ธฐ ๋ฐ ์คํ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | sudo chmod +rx $(which node) |
ํ์ฌ ๋๋ ํ ๋ฆฌ ์๋์ ๋ชจ๋ ๋๋ ํ ๋ฆฌ์ ์ฝ๊ธฐ ๋ฐ ์คํ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | find . -type d -exec chmod +rx {} \; |
ํ์ฌ ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ ์๋์ 'rc.conf'๋ผ๋ ์ด๋ฆ์ ๋ชจ๋ ํ์ผ/๋๋ ํ ๋ฆฌ์ ๋ํด 'other'์ ์ฝ๊ธฐ ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | find . -name "rc.conf" -exec chmod o+r '{}' \; |
ํ์ฌ ํด๋์ ์๋ "rc.conf"๋ผ๋ ์ด๋ฆ์ ๊ฐ์ง ํ์ผ์ ๋ํด ๋ค๋ฅธ ์ฌ๋๋ค์ด ์ฝ์ ์ ์๋๋ก ๊ถํ์ ์ถ๊ฐํฉ๋๋ค. | find . -name "*rc.conf" -exec chmod o+r '{}' \; |
์์ ํ๊ฒฝ์ ๊ฐ "bbb"๋ฅผ ๊ฐ์ง TESTVAR ๋ณ์๋ฅผ ์ถ๊ฐํ๊ณ , ๊ฒฐ๊ณผ ํ๊ฒฝ์์ ๋ชจ๋ ๋ณ์์ ๊ทธ ๊ฐ์์ TESTVAR๋ฅผ ๊ฒ์ํฉ๋๋ค. | TESTVAR=bbb env | fgrep TESTVAR |
'filename'์ ํ์์คํฌํ๋ฅผ 2์๊ฐ ๋นผ์ ์กฐ์ ํฉ๋๋ค. | touch -d "$(date -r filename) - 2 hours" filename |
ํ์ผ $filename์ ํ์์คํฌํ๋ฅผ 2์๊ฐ ๋นผ์ ์กฐ์ ํฉ๋๋ค. | touch -d "$(date -r "$filename") - 2 hours" "$filename" |
์ง๋ ์ฃผ์ ์์ ๋ ๋ชจ๋ .jpg ๋๋ .png ์ด๋ฏธ์ง | find . -mtime -7 \( '*.jpg' -o -name '*.png' \) |
.mp3๋ก ๋๋๊ณ .jpg๋ก ๋๋๋ ๋ชจ๋ ํ์ผ | find . -name '*.mp3' -name '*.jpg' -print |
๋ชจ๋ ์ฌ์ฉ์๊ฐ "myscript.sh"๋ฅผ ์คํํ ์ ์๋๋ก ํ์ฉํฉ๋๋ค. | chmod a+x myscript.sh |
๋ชจ๋ ์ฌ์ฉ์๊ฐ '$pathToShell"myShell.sh"'๋ฅผ ์คํํ ์ ์๋๋ก ํ์ฉํฉ๋๋ค. | chmod a+x $pathToShell"myShell.sh" |
"Xvfb"์ ์์ ์๋ก์ "Xvfb" ๋ช
๋ น์ ์คํํ ์ ์๋๋ก ๋ชจ๋ ์ฌ๋์๊ฒ ํ์ฉํฉ๋๋ค. | sudo chmod u+s `which Xvfb` |
"rm -rf foo"์ ๋ชจ๋ ํ๋กฌํํธ์ "y"๋ฅผ ๋ตํฉ๋๋ค. | yes | rm -ri foo |
"dir1", "dir2", "dir3"์ ๋ํ์ ์ฌ๊ท์ ์ ๊ฑฐ ์ค์ ๋ํ๋๋ ๋ชจ๋ ํ๋กฌํํธ์ "y"๋ฅผ ๋ตํฉ๋๋ค. | yes y | rm -ir dir1 dir2 dir3 |
ํ์ฌ ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ์ ๋ชจ๋ ํ์ผ ์ด๋ฆ์ ".txt"๋ฅผ ์ถ๊ฐํฉ๋๋ค. | find -type f | xargs -I {} mv {} {}.txt |
ํ์ฌ ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ์ *.java ํ์ผ์ tar ์์นด์ด๋ธ `myfile.tar'์ ์ถ๊ฐํฉ๋๋ค. | find . -type f -name "*.java" | xargs tar rvf myfile.tar |
์ง๋ 180์ผ ๋์ ์์ ๋ ๋ชจ๋ *.mp3 ํ์ผ์ tar ์์นด์ด๋ธ `music.tar'์ ์ถ๊ฐํฉ๋๋ค. | find . -name -type f '*.mp3' -mtime -180 -print0 | xargs -0 tar rvf music.tar |
๋ชจ๋ PNG ๋ฐ JPG ํ์ผ์ tar ์์นด์ด๋ธ 'images.tar'์ ์ถ๊ฐํฉ๋๋ค. | find . \( -iname "*.png" -o -iname "*.jpg" \) -print -exec tar -rf images.tar {} \; |
์ง๋ 24์๊ฐ ๋์ ์์ ๋ ๋ชจ๋ ์ผ๋ฐ ํ์ผ์ "$archive.tar" tar ์์นด์ด๋ธ์ ์ถ๊ฐํฉ๋๋ค. | find . -mtime -1 -type f -exec tar rvf "$archive.tar" '{}' \; |
์ง๋ 24์๊ฐ ๋์ ์์ ๋ ๋ชจ๋ ์ผ๋ฐ ํ์ผ์ "$archive.tar" tar ์์นด์ด๋ธ์ ์ถ๊ฐํฉ๋๋ค. | find . -mtime -1 -type f -print0 | xargs -0 tar rvf "$archive.tar" |
".cwdhist" ํ์ผ์ ๋ด์ฉ์ ํ์ฌ ๋ฉ๋ชจ๋ฆฌ ๋ด ํ์คํ ๋ฆฌ ๋ชฉ๋ก์ ์ถ๊ฐํฉ๋๋ค. | history -r .cwdhist |
"file.txt"์ ๋ด์ฉ์ ํ์ฌ ๋ฉ๋ชจ๋ฆฌ ๋ด ํ์คํ ๋ฆฌ ๋ชฉ๋ก์ ์ถ๊ฐํฉ๋๋ค. | history -r file.txt |
ํ์ฌ ๋ ์ง๋ฅผ '%Y%m%d_%H%M' ํ์์ผ๋ก $0์ ๊ธฐ๋ณธ ์ด๋ฆ์ ์ถ๊ฐํ๊ณ 'LOGNAME' ๋ณ์์ ์ ์ฅํฉ๋๋ค. | LOGNAME="`basename "$0"`_`date "+%Y%m%d_%H%M"`" |
ํ์ฌ ๋ ์ง๋ฅผ '%d%m%Y-%H-%M' ํ์์ผ๋ก, '_'์ ํ์ฌ ์ฌ์ฉ์ ์ด๋ฆ์ ์ถ๊ฐํ ํ 'name' ๋ณ์์ ์ ์ฅํฉ๋๋ค. | name="$(date +'%d%m%Y-%H-%M')_$(whoami)" |
๋ชจ๋ ๋ช
๋ น ํ์ ๋ ์ง์ ์คํํ ๋ช
๋ น์ "/tmp/trace"์ ์ถ๊ฐํฉ๋๋ค. | PROMPT_COMMAND='echo "$(date +"%Y/%m/%d (%H:%M)") $(history 1 |cut -c 7-)" >> /tmp/trace' |
์ด ์ธ์
์ ํ์คํ ๋ฆฌ ์ค์ ํ์คํ ๋ฆฌ ๋ชฉ๋ก์ ์ถ๊ฐํฉ๋๋ค. | history -a |
"./dir"์ ssh๋ฅผ ํตํด "user@host:/path"๋ก ์์นด์ด๋ธํ๊ณ ์งํ ์ํฉ์ ํ์ํฉ๋๋ค. | rsync -rvz -e 'ssh -p 2222' --progress ./dir user@host:/path |
"./htmlguide"๋ฅผ "~/src/"๋ก ์์นด์ด๋ธํ๊ณ ์ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ํด๊ฒฐํ๊ณ , "./htmlguide"์์ ์ฐพ์ง ๋ชปํ "~/src/"์ ๋ชจ๋ ๋ถํ์ํ ํ์ผ์ ์ญ์ ํฉ๋๋ค. | rsync -av --copy-dirlinks --delete ../htmlguide ~/src/ |
"/home/abc/*"๋ฅผ "/mnt/windowsabc"๋ก ์์นด์ด๋ธํ๊ณ ์ฌ๋์ด ์ฝ์ ์ ์๋ ์ถ๋ ฅ์ ์ ๊ณตํฉ๋๋ค. | rsync -avh /home/abc/* /mnt/windowsabc |
"/home/path"๋ฅผ "server" ํธ์คํธ์ "path"๋ก ์์นด์ด๋ธํ๊ณ ์งํ ์ํฉ๊ณผ ํต๊ณ๋ฅผ ๋ณด์ฌ์ฃผ๋ฉฐ, ์์ค์์ ์ฐพ์ง ๋ชปํ ๋ชฉ์ ์ง์ ํ์ผ์ ์ ๊ฑฐํฉ๋๋ค. | rsync -a --stats --progress --delete /home/path server:path |
"/home/user1"์ "wobgalaxy02:/home/user1"๋ก ์์นด์ด๋ธํ๊ณ ์จ๊ฒจ์ง ํ์ผ์ ์ ์ธํฉ๋๋ค. | rsync -av /home/user1 wobgalaxy02:/home/user1 |
"/local/path/some_file"์ "server.com" ํธ์คํธ์ "/some/path"๋ก ์์นด์ด๋ธํ๊ณ "usr" ์ฌ์ฉ์๋ก ์ธ์ฆํ๋ฉฐ, ์ ์ก ์ค์ ๋ฐ์ดํฐ๋ฅผ ์์ถํ๊ณ ์งํ ์ํฉ์ ๋ณด์ฌ์ค๋๋ค. | rsync -avz --progress local/path/some_file usr@server.com:"/some/path/" |
"/media/10001/music/"์ "server" ํธ์คํธ์์ ๋ก์ปฌ ๋๋ ํ ๋ฆฌ "/media/incoming/music/"๋ก ์์นด์ด๋ธํ๊ณ , ๋ชฉ์ ์ง์์ ๋ ์๋ก์ด ํ์ผ์ ๊ฑด๋๋ฐ๊ณ , ์์ค์ ์๋ ๋ชฉ์ ์ง์ ํ์ผ์ ์ญ์ ํ๋ฉฐ, ์ ์ก ์ค์ ๋ฐ์ดํฐ๋ฅผ ์์ถํฉ๋๋ค. | rsync -avzru --delete-excluded server:/media/10001/music/ /media/Incoming/music/ |
"server" ํธ์คํธ์ "/my/dir"์ ".svn"์ผ๋ก ๋๋๋ ํ์ผ์ ์ ์ธํ๊ณ ํ์ฌ ๋ก์ปฌ ๋๋ ํ ๋ฆฌ๋ก ์์นด์ด๋ธํฉ๋๋ค. | rsync -av --exclude '*.svn' user@server:/my/dir . |
"source_host"์์ "/path/to/application.ini"๋ฅผ ํ์ฌ ๋๋ ํ ๋ฆฌ๋ก ์์นด์ด๋ธํฉ๋๋ค. | rsync -avv source_host:path/to/application.ini ./application.ini |
"host.remoted.from" ํธ์คํธ์ "path/to/copy"๋ฅผ "path/to/local/storage"๋ก ์์นด์ด๋ธํ๊ณ , ์ฒดํฌ์ฌ์ด ๋ค๋ฅธ ํ์ผ์ ์
๋ฐ์ดํธํ๊ณ , ์ฌ๋์ด ์ฝ์ ์ ์๋ ์งํ ์ํฉ๊ณผ ํต๊ณ๋ฅผ ๋ณด์ฌ์ฃผ๋ฉฐ, ์ ์ก ์ค์ ๋ฐ์ดํฐ๋ฅผ ์์ถํฉ๋๋ค. | rsync -chavzP --stats /path/to/copy user@host.remoted.from:/path/to/local/storage |
"/path/to/files"๋ฅผ "user@targethost:/path"๋ก ์์นด์ด๋ธํ๊ณ ์๊ฒฉ ํธ์คํธ์์ ๊ถํ์ ๋์
๋๋ค. | rsync -av --rsync-path="sudo rsync" /path/to/files user@targethost:/path |
"/path/to/files"๋ฅผ "user@targethost:/path"๋ก ์์นด์ด๋ธํฉ๋๋ค. | rsync -av /path/to/files user@targethost:/path |
"/path/to/files/source"๋ฅผ "user@remoteip:/path/to/files/destination"๋ก ์์นด์ด๋ธํ๊ณ ssh๋ฅผ ํตํด ํฌํธ 2121์ ์ฌ์ฉํฉ๋๋ค. | rsync -azP -e "ssh -p 2121" /path/to/files/source user@remoteip:/path/to/files/destination |
"/path/to/sfolder"๋ฅผ "name@remote.server:/path/to/remote/dfolder"๋ก ์์นด์ด๋ธํ๊ณ ํ๋ ๋งํฌ๋ฅผ ๋ณด์กดํ๋ฉฐ ์ ์ก ์ค์ ๋ฐ์ดํฐ๋ฅผ ์์ถํฉ๋๋ค. | rsync -aHvz /path/to/sfolder name@remote.server:/path/to/remote/dfolder |
"/path/to/sfolder/"๋ฅผ "name@remote.server:/path/to/remote/dfolder"๋ก ์์นด์ด๋ธํ๊ณ ํ๋ ๋งํฌ๋ฅผ ๋ณด์กดํ๋ฉฐ ์ ์ก ์ค์ ๋ฐ์ดํฐ๋ฅผ ์์ถํฉ๋๋ค. | rsync -aHvz /path/to/sfolder/ name@remote.server:/path/to/remote/dfolder |
"/source"์ "folder/" ์๋์ ๋ชจ๋ ํ์ผ์ "remoteserver" ํธ์คํธ์ "/dstfolder/"๋ก ์์นด์ด๋ธํ๊ณ "user" ์ฌ์ฉ์๋ก์ ์ด๋ฏธ ์กด์ฌํ๋ ํ์ผ์ ๋ณต์ฌํ์ง ์์ต๋๋ค. | rsync -avz --ignore-existing /source folder/* user@remoteserver:/dstfolder/ |
"/source/backup"์ "/destination"์ผ๋ก ์์นด์ด๋ธํ๊ณ ์ ์ก ์ค์ ์์ถํฉ๋๋ค. | rsync -ravz /source/backup /destination |
"/top/a/b/c/d"๋ฅผ "remote" ํธ์คํธ๋ก ์์นด์ด๋ธํ๊ณ ์๋ ๊ฒฝ๋ก ์ด๋ฆ์ ์ฌ์ฉํฉ๋๋ค. | rsync -a --relative /top/a/b/c/d remote:/ |
"/usr/local/"์ "XXX.XXX.XXX.XXX" ํธ์คํธ์ "/BackUp/usr/local/"๋ก ์์นด์ด๋ธํ๊ณ ssh๋ฅผ ํตํด ์งํ ์ํฉ์ ๋ณด์ฌ์ค๋๋ค. | rsync --progress -avhe ssh /usr/local/ XXX.XXX.XXX.XXX:/BackUp/usr/local/ |
"/var/www/test/"๋ฅผ "231.210.24.48" ํธ์คํธ์ "/var/www/test"๋ก ์์นด์ด๋ธํ๊ณ "ubuntu" ์ฌ์ฉ์๋ก ssh๋ฅผ ์ฌ์ฉํ๋ฉฐ ์ ์ ํ์ผ "/home/test/pkey_new.pem"์ ์ฌ์ฉํฉ๋๋ค. | rsync -rave "ssh -i /home/test/pkey_new.pem" /var/www/test/ ubuntu@231.210.24.48:/var/www/test |
"_vim/"์ "~/.vim"์ผ๋ก ์์นด์ด๋ธํ๊ณ ๋น์ค๋ฅ ๋ฉ์์ง๋ฅผ ์ต์ ํ๋ฉฐ ์ ์ก ์ค์ ๋ฐ์ดํฐ๋ฅผ ์์ถํฉ๋๋ค. | rsync -aqz _vim/ ~/.vim |
"blanktest/"๋ฅผ "test/"๋ก ์์นด์ด๋ธํ๊ณ ์์ค์์ ์ฐพ์ง ๋ชปํ ๋ชฉ์ ์ง์ ํ์ผ์ ์ญ์ ํฉ๋๋ค. | rsync -a --delete blanktest/ test/ |
"directory"๋ฅผ ํ์ฌ ๋ก์ปฌ ๋๋ ํ ๋ฆฌ๋ก ์์นด์ด๋ธํ๊ณ ํ๋ ๋งํฌ๋ฅผ ๋ณด์กดํ๋ฉฐ "remote" ํธ์คํธ์์ ๋ถ๋ถ ํ์ผ์ ์ ์งํ๊ณ , ํฌ์ ํ์ผ์ ํจ์จ์ ์ผ๋ก ์ฒ๋ฆฌํ๋ฉฐ, ๋ณ๊ฒฝ๋ ํญ๋ชฉ์ ํญ๋ชฉํํฉ๋๋ค. | rsync -aPSHiv remote:directory . |
"fileToCopy"๋ฅผ "ssh.myhost.net" ํธ์คํธ์ "/some/nonExisting/dirToCopyTO"๋ก ์์นด์ด๋ธํ๊ณ ssh๋ฅผ ์ฌ์ฉํฉ๋๋ค. | rsync -ave ssh fileToCopy ssh.myhost.net:/some/nonExisting/dirToCopyTO |
"path/subfolder"๋ฅผ "path"๋ก ์์นด์ด๋ธํ๊ณ , ๋ชฉ์ ์ง์์ ๋ ์๋ก์ด ํ์ผ์ ๊ฑด๋๋๋๋ค. | rsync -vuar --delete-after path/subfolder/ path/ |
"path/to/working/copy"๋ฅผ "path/to/export"๋ก ์์นด์ด๋ธํ๊ณ ".svn"์ด๋ผ๋ ์ด๋ฆ์ ํ์ผ์ด๋ ๋๋ ํ ๋ฆฌ๋ฅผ ์ ์ธํฉ๋๋ค. | rsync -a --exclude .svn path/to/working/copy path/to/export |
"somedir/./foo/bar/baz.c"๋ฅผ "remote:/tmp/"๋ก ์์นด์ด๋ธํ๊ณ "foo/bar/baz.c"์ ์๋ ๊ฒฝ๋ก๋ฅผ ๋ณด์กดํฉ๋๋ค. | rsync -avR somedir/./foo/bar/baz.c remote:/tmp/ |
"source"๋ฅผ "PORT_NUMBER" ํฌํธ๋ฅผ ํตํด "destination"์ผ๋ก ์์นด์ด๋ธํฉ๋๋ค. | rsync -azP -e "ssh -p PORT_NUMBER" source destination |
"src"๋ฅผ "dst"๋ก ์์นด์ด๋ธํ๊ณ "dst"์ ์กด์ฌํ๋ ํ์ผ์ ์
๋ฐ์ดํธํฉ๋๋ค. | rsync -a -v src dst |
"src"๋ฅผ "dst"๋ก ์์นด์ด๋ธํ๊ณ "dst"์ ์๋ ๊ธฐ์กด ํ์ผ์ ๋ฎ์ด์ฐ์ง ์์ต๋๋ค. | rsync -a -v --ignore-existing src dst |
"src-dir"๋ฅผ "remote-user@remote-host"์ "dest-dir"๋ก ์์นด์ด๋ธํ๊ณ "src-dir"์์ ์ฐพ์ง ๋ชปํ "dest-dir"์ ํ์ผ์ ์ญ์ ํฉ๋๋ค. | rsync -av --delete src-dir remote-user@remote-host:dest-dir |
ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ".txt" ํ์ผ์ "/path/to/dest"๋ก ์์นด์ด๋ธํ๊ณ ๋ถ๋ถ์ ์ผ๋ก ์ ์ก๋ ํ์ผ์ ์ ์งํฉ๋๋ค. | rsync -aP --include=*/ --include=*.txt --exclude=* . /path/to/dest |
ํ์ฌ ๋๋ ํ ๋ฆฌ ํธ๋ฆฌ ์๋์ ๋ชจ๋ *.xml ํ์ผ์ xml.tar๋ก ์์นด์ด๋ธํ๊ณ , ๊ฒฝ๋ก์ '/workspace/'๊ฐ ์ผ์นํ๋ ํ์ผ์ ์ ์ธํฉ๋๋ค. | find . -name \*.xml | grep -v /workspace/ | tr '\n' '\0' | xargs -0 tar -cf xml.tar |
๋ชจ๋ *html ํ์ผ์ tar๋ฅผ ์ฌ์ฉํ์ฌ ์์นด์ด๋ธํฉ๋๋ค. | find . -type f -name "*html" | xargs tar cvf htmlfiles.tar - |
/path/to/directory/*์ ๋ชจ๋ ๋๋ ํ ๋ฆฌ๋ฅผ .tar.gz ํ์ฅ์๋ฅผ ๊ฐ์ง ํ์ผ๋ก ์์นด์ด๋ธํฉ๋๋ค(๋ช
๋ น ์ค ์ธ์๋ง, ํ์ ๋๋ ํ ๋ฆฌ๋ ์ ์ธ). | find /path/to/directory/* -maxdepth 0 -type d -printf "%P\n" -exec sudo tar -zcpvf {}.tar.gz {} \; |
/path/to/directory/*์ ๋ชจ๋ ๋๋ ํ ๋ฆฌ๋ฅผ .tar.gz ํ์ฅ์๋ฅผ ๊ฐ์ง ํ์ผ๋ก ์์นด์ด๋ธํฉ๋๋ค(๋ช
๋ น ์ค ์ธ์๋ง, ํ์ ๋๋ ํ ๋ฆฌ๋ ์ ์ธ). ์ ์ฒด ๊ฒฝ๋ก๋ฅผ ์๋ ๊ฒฝ๋ก๋ก ๋ณํํฉ๋๋ค. | find /path/* -maxdepth 0 -type d -exec sudo tar -zcpvf {}.tar.gz {} \; |
์ง๋ 30์ผ ๋์ ์์ ๋ ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ํ์ผ์ ์์นด์ด๋ธํฉ๋๋ค. | tar czvf mytarfile.tgz `find . -mtime -30` |
data/ ์๋์ filepattern-*2009* ํ์ผ/๋๋ ํ ๋ฆฌ๋ฅผ ๋ชจ๋ 2009.tar๋ก ์์นด์ด๋ธํฉ๋๋ค. | find data/ -name 'filepattern-*2009*' -exec tar uf 2009.tar '{}' + |
data/ ์๋์ filepattern-*2009* ํ์ผ/๋๋ ํ ๋ฆฌ๋ฅผ ๋ชจ๋ 2009.tar๋ก ์์นด์ด๋ธํฉ๋๋ค. | find data/ -name filepattern-*2009* -exec tar uf 2009.tar {} ; |
data/ ์๋์ filepattern-*2009* ํ์ผ/๋๋ ํ ๋ฆฌ๋ฅผ ๋ชจ๋ 2009.tar๋ก ์์นด์ด๋ธํฉ๋๋ค. | find data/ -name filepattern-*2009* -print0 | xargs -0 tar uf 2009.tar |
์ง๋ 24์๊ฐ ๋์ ์์ ๋ ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ์ผ๋ฐ/์ ๊ท ํ์ผ์ ์์นด์ด๋ธํฉ๋๋ค. | find . -mtime -1 -type f -exec tar rvf "$archive.tar" '{}' \; |
"remote_host"์์ "local_dir"๋ก ์ง๋ ๋ ์ ๋ณ๊ฒฝ๋ ํ์ผ์ ์์นด์ด๋ธํฉ๋๋ค. | rsync -av remote_host:'$(find logs -type f -ctime -1)' local_dir |
ํ์ฌ ๋๋ ํ ๋ฆฌ๋ฅผ localhost์ "/some/path"๋ก ์์นด์ด๋ธํ๊ณ "me" ์ฌ์ฉ์๋ก ssh๋ฅผ ์ฌ์ฉํ์ฌ ์ธ์ฆํ๋ฉฐ, ์์ค ๋๋ ํ ๋ฆฌ์์ ๋ ์๋ก์ด ํ์ผ๋ง ์
๋ฐ์ดํธํฉ๋๋ค. | rsync -auve "ssh -p 2222" . me@localhost:/some/path |
๋๋ ํ ๋ฆฌ "."๋ฅผ "server2::sharename/B"๋ก ์์นด์ด๋ธํฉ๋๋ค. | rsync -av . server2::sharename/B |
๋๋ ํ ๋ฆฌ "/mnt/data"๋ฅผ "/media/WD_Disk_1/current_working_data/"๋ก ์์นด์ด๋ธํ๊ณ ๋ชฉ์ ์ง์์ ๋ถํ์ํ ํ์ผ์ ์ญ์ ํ๋ฉฐ, ๋ณต์ฌ ์ค์ ๋ฐ์ดํฐ๋ฅผ ์์ถํฉ๋๋ค. | rsync -az --delete /mnt/data/ /media/WD_Disk_1/current_working_data/; |
๋๋ ํ ๋ฆฌ "symdir"๋ฅผ "symdir_output"์ผ๋ก ์์นด์ด๋ธํ๊ณ ์ฌ๋ณผ๋ฆญ ๋งํฌ๋ฅผ ๋ณด์กดํฉ๋๋ค. | rsync symdir/ symdir_output/ -a --copy-links -v |
์ ์ฒด ํ์ผ ์์คํ
์ tarfile.tar.bz2๋ก ์์นด์ด๋ธํฉ๋๋ค. | find / -print0 | xargs -0 tar cjf tarfile.tar.bz2 |
'file' ํ์ผ์ bzip2 ๋๊ตฌ๋ก ์์นด์ด๋ธํ๊ณ , ์์ถ๋ ๋ฐ์ดํฐ๋ฅผ 'logfile' ํ์ผ์ ์ ์ฅํ๊ณ ํ๋ฉด์๋ ์ถ๋ ฅํฉ๋๋ค. | bzip2 -c file | tee -a logfile |
"/mnt/source-tmp"์ ํ์ผ์ "/media/destination"์ผ๋ก ์์นด์ด๋ธํฉ๋๋ค. | rsync -a /mnt/source-tmp /media/destination/ |
"sorce_dir"์ ํ์ผ(๋๋ ํ ๋ฆฌ ์ ์ธ)์ "target_dir"๋ก ์์นด์ด๋ธํฉ๋๋ค. | rsync -a --filter="-! */" sorce_dir/ target_dir/ |
/fss/fin์ 1๋จ๊ณ ํ์ ๋๋ ํ ๋ฆฌ ๋ชฉ๋ก์ /fss/fi/outfile.tar.gz๋ก ์์นด์ด๋ธํฉ๋๋ค. | tar -czf /fss/fi/outfile.tar.gz `find /fss/fin -d 1 -type d -name "*" -print` |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4