Window
사용할 때마다 정리해두기!
윈도우 실행
- win+R : 실행창
- ctrl+shift+enter : 관리자 권한으로 실행
Linux command vs Window cmd command
업데이트 중 …
| Linux | Window |
| pwd | cd , |
| cd | cd |
| ls | dir |
Window batch file에서 %의 의미
출처 : https://jeffpar.github.io/kbarchive/kb/075/Q75634/
1. 배치 파일에서 %0~9는 매개 변수라는 의미로 사용된다.
MS-DOS uses %1, %2, ... %9 as replaceable command line parameters. For example,
before executing the command ECHO %1, %1 will be replaced with the first
parameter passed to the batch file. %0 is replaced with the command used to
execute the batch file.
Code language: JavaScript (javascript)
2. 1번의 경우를 제외한 하나의 **%**는 ‘nul‘로 인식한다.
A single percent sign on a line is treated as a "nul" character in a batch file.
For example:
ECHO % is processed as ECHO
ECHO a%b is processed as ECHO ab
Code language: PHP (php)
3. 두 개의 %와 % 사이에 문자가 있는 경우에 환경 변수로 해석됩니다.
If a command contains two percent signs, MS-DOS will treat any characters between
them as an environment variable to be expanded. For example, if the SET command
shows that the current environment variables are
COMSPEC=C:\COMMAND.COM
PATH=C:\DOS
PROMPT=$P$G
B=C
then
ECHO %PATH% is processed as ECHO C:\DOS
ECHO a%b% is processed as ECHO aC
ECHO a%b b%a is processed as ECHO aa
// %b b%라는 변수는 없다.
Code language: PHP (php)
4. 배치 파일에선 사이에 아무것도 없는 두 퍼센트 기호 **%%**는 **단일 퍼센트 기호 %**를 사용하고 싶을 때 사용한다.
If there are no characters between the two percent signs, one percent sign is
stripped off and the other will remain. This is why a FOR command that echos the
name of each file with a .COM extension would be
FOR %V IN (*.COM) DO ECHO %V
but if the same command is placed in a batch file, the following is required:
FOR %%V IN (*.COM) DO ECHO %%V
Code language: PHP (php)