cd
SFTP 또는 FTP 서버에서 현재 폴더 변경 또는 보기
설명
예제
SFTP 객체를 생성하여 SFTP 서버에 대한 연결을 엽니다. SFTP 객체를 사용하여 서버에 있는 하위 폴더의 내용을 나열합니다. SFTP 세션이 종료되면 연결을 닫습니다.
먼저, 예제 SFTP 서버에 연결합니다.
s = sftp("sftp.example_galapagos.net","jsmith")
SFTP with properties: Host: "sftp.example_galapagos.net" Username: "jsmith" Port: 22 ServerSystem: "unix" DatetimeType: "datetime" ServerLocale: "en_US" DirParserFcn: @matlab.io.ftp.parseDirListingForUnix RemoteWorkingDirectory: "/home/jsmith"
최상위 폴더의 내용을 나열합니다.
dir(s)
air_quality fish insects README.txt birds INDEX.txt mammals reptiles climate index.html rainfall sftp.html
dir
함수를 사용하여 하위 폴더의 내용을 나열합니다.
dir(s,"home/jsmith/birds")
albatrosses ducks herons parrots avocets_stilts falcons kingfishers pelicans barn_owls flamingos mockingbirds penguins blackbirds frigatebirds nightjars pheasants boobies grebes northern_storm_petrels pigeons cardinal grosbeaks guineafowl osprey plovers cormorants gulls owls rails cuckoos hawks oystercatcher sandpipers
cd
함수를 사용하여 하위 폴더로 변경합니다. cd
의 출력값은 현재 MATLAB 폴더가 아닌 SFTP 서버에 있는 현재 폴더의 경로입니다.
cd(s,"home/jsmith/birds/herons")
ans = "home/jsmith/birds/herons"
현재 폴더의 내용을 나열합니다.
dir(s)
documentation great_egret_data migration_patterns great_blue_heron_data green_heron_data nesting_behaviors
SFTP 서버와의 연결을 닫습니다. SFTP 객체를 삭제하거나 연결이 시간 초과되도록 하여 연결을 닫을 수도 있습니다.
close(s)
입력 인수
SFTP 또는 FTP 서버와의 연결로, SFTP 객체 또는 FTP 객체로 지정됩니다.
SFTP 또는 FTP 서버의 대상 폴더 이름으로, 문자형 벡터 또는 string형 스칼라로 지정됩니다. 현재 폴더의 상위 폴더를 지정하려면 '..'
를 사용하십시오.
팁
로그인 폴더로 이동하려면
cd
함수에~
기호를 전달하십시오.
버전 내역
R2006a 이전에 개발됨
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)