Windows 7에서 git-bash를 사용하고 있습니다. 현재 디렉토리의 트리를보고 싶습니다. 하나:
jcollum@DEVELOPER01 ~/Dev/express_coffee
$ tree .
sh.exe": tree: command not found
좋아, 그래서 트리 명령이 없습니다. 어떻게 설치합니까? 기사를 찾았지만 Mac 용이었습니다.
답변
당신은 또한 "cmd //c tree"
Windows를 사용 하는 데 사용할 수 있습니다tree
설명:
- ‘/ c’인수로 cmd를 시작하고 트리를 실행 한 다음 종료하십시오.
/ C 문자열로 지정된 명령을 수행 한 다음 종료
(탈출을위한 추가 슬래시)
/ a 올바르게 표시되지 않는 경우 ASCII 문자로 실행하는 데 사용합니다.
https://stackoverflow.com/q/515309/1261166 에서 더 자세히 답변하십시오.
답변
제안 된대로 http://gnuwin32.sourceforge.net/packages/tree.htm 에서 zip 파일 내부의 tree.exe를 다운로드 했습니다.
그런 다음 tree.exe 파일을 추출했습니다 C:\Program Files\Git\usr\bin
(이 폴더를 Windows 경로에 추가하여 일반 CMD와 함께 작동하지만 GITBash에서도 작동합니다).
나는 이것이 어떻게 든 당신을 도울 수 있기를 바랍니다!
답변
Windows에는 이미 트리 명령이 있습니다. 문제는 tree.com이며 git bash는 확장명 .com을 자동으로 추가하고 실행하지 않습니다.
그러나 tree 또는 tre를 입력 한 후 tab을 누르면 찾을 수 있습니다.
// f를 사용해야하는 파일을 보려면 //를 사용해야합니다. // bash는 폴더 이름이라고 생각합니다.
또한 // a를 사용하여 ascii 라인을 표시했지만 사용할 필요는 없습니다.
예:
dean@dean:~/java$ tree
bash: tree: command not found
dean@dean:~/java$ tree.com //a
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
+---sublime
\---vscode
dean@dean:~/java$ tree.com //a //f
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
| test1
|
+---sublime
| test2
|
\---vscode
test3
dean@dean:~/java$
답변
트리의 GnuWin32 빌드는 http://gnuwin32.sourceforge.net/packages/tree.htm 에 있습니다. 아직 GnuWin32를 사용하지 않는 경우 수동으로 경로에 추가해야합니다.
Windows 콘솔에서도 사용하려면 tree.exe의 이름을 바꾸거나 lstree.exe와 같은 다른 이름으로 복사해야합니다. 그렇지 않으면 Windows tree 명령이 우선합니다. GnuWin 버전의 장점은 많은 옵션이 있다는 것입니다. 예를 들어 tree -L 2
재귀 깊이를 2로 제한합니다.
> tree --help
usage: tree [-adfghilnpqrstuvxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit #] [<directory list>]
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-i Don't print indentation lines.
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-p Print the protections for each file.
-u Displays file owner or UID number.
-g Displays file group owner or GID number.
-s Print the size in bytes of each file.
-h Print the size in a more human readable way.
-D Print the date of last modification.
-F Appends '/', '=', '*', or '|' as per ls -F.
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-A Print ANSI lines graphic indentation lines.
-S Print with ASCII graphics indentation lines.
-n Turn colorization off always (-C overrides).
-C Turn colorization on always.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
-R Rerun tree when max dir level reached.
-o file Output to file instead of stdout.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
--noreport Turn off file/directory count at end of tree listing.
--nolinks Turn off hyperlinks in HTML output.
--dirsfirst List directories before files.
--charset X Use charset X for HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.
Windows 트리와 비교 :
> tree /?
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
답변
git-bash는 실제로 mingw의 축소 버전입니다. cygwin.com에서 Cygwin을 설치 한 다음 패키지 관리자를 사용하여 ‘트리’또는 그 안에있는 패키지를 설치하거나 존재하지 않는 경우 gcc를 설치하고 여기에서 트리 소스를 다운로드하십시오.
http://mama.indstate.edu/users/ice/tree/
그런 다음 INSTALL 파일의 지시 사항을 따르십시오 (make, make install).
답변
또 다른 옵션은 MinGW 패키지를 사용하는 것입니다. MinGW가 이미 설치되어 있으면 트리가 패키지되어 있으므로 MinGW 터미널을 열고 실행하여 설치하십시오 pacman -Sy tree
.
MinGW가 아직 설치되어 있지 않은 경우 tree 명령으로 설치하는 것이 과도합니다.
답변
위 링크에서 http://gnuwin32.sourceforge.net/packages/tree.htm 링크를 통해 Windows 용 Three를 설치해야합니다.
그 외에도 트리 프로그램을 Windows 경로에 추가해야하거나 트리 명령은 cmd에서만 사용할 수 있습니다. Windows 경로에 액세스하여 이것을 추가하십시오 (기본 설치의 경우).
;C:\Program Files (x86)\GnuWin32\bin
그들은 Windows의 git bash에서 tree 명령을 사용할 수 있습니다.