디렉토리에 "/"를 추가하면 그 의미가 언제 변경됩니까?

디렉토리에 "/"를 추가하면 그 의미가 언제 변경됩니까?

/목차에 추가하면 언제 그 의미가 바뀌나요?

예를 들어 Linux를 간략하게 설명하면 다음과 같습니다.

전체 디렉터리 proj를 원격 호스트 ourhub의 /planning 디렉터리로 전송합니다.

$ rsync -r proj/ ourhub:/planning

proj 아래의 파일과 하위 디렉터리를 원격 호스트 ourhub의 /planning 디렉터리로 전송합니다.

$ rsync -r proj ourhub:/planning

그러나 ls proj와 는 ls proj/동일합니다. (이전에 비슷한 질문을 한 것 같은데 못찾겠습니다.) 감사해요.

답변1

시스템 전체에 적용되는 규칙은 없습니다. 그러나 표시되는 동작은 rsyncrsync 매뉴얼 페이지 시작 부분에 문서화되어 있습니다.

          rsync -avz foo:src/bar /data/tmp

   This would recursively transfer all files from the directory src/bar on the machine foo into the /data/tmp/bar directory on the local machine. The files are transferred
   in  "archive" mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer.  Additionally, compression will
   be used to reduce the size of data portions of the transfer.

          rsync -avz foo:src/bar/ /data/tmp

   A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination.  You can think of a trailing / on a  source  as
   meaning  "copy  the contents of this directory" as opposed to "copy the directory by name", but in both cases the attributes of the containing directory are transferred
   to the containing directory on the destination.  In other words, each of the following commands copies the files in  the  same  way,  including  their  setting  of  the
   attributes of /dest/foo:

관련 정보