# install
dotnet tool install --global KCmd
# update
dotnet tool update KCmd -g
# uninstall
dotnet tool uninstall KCmd -g
kcmd cmd RequiredParameters... [OptionalParameters...]
kcmd copy|cp src dest [name:value] ...
Position | Value |
---|---|
src | file or directory |
dest | file or directory |
Name | Alias | Default | Definition |
---|---|---|---|
AttributesToSkip | 0 | AttributesToSkip | |
ExcludeExe | false | ExcludeExe | |
ExcludeExeFiles | false | ExcludeExeFiles | |
ExcludeExeRelatedFiles | false | ExcludeExeRelatedFiles | |
ExcludeFileNameStartsWith | |||
ExcludeFileNameStartsWithIgnoreCase | |||
IgnoreInaccessible | true | IgnoreInaccessible | |
Include | I | Include | |
OverrideFile | Override | true | |
Recursive | R | false | |
Silent | S | false | |
SrcSearchPattern | * | ||
WhenDirectoryExists | WhenDirectoryExists | ||
WhenDirectoryNotExists | WhenDirectoryNotExists | ||
WhenFileExists | WhenFileExists | ||
WhenFileNotExists | WhenFileNotExists |
kcmd copy xxx/file.src yyy/file.dest
kcmd copy xxx/src yyy/dest recursive
kcmd copy xxx/src yyy/dest -recursive
kcmd cp xxx/src yyy/dest r
kcmd cp xxx/src yyy/dest -r
kcmd cp xxx/src yyy/dest -r -OverrideFile:false
kcmd cp xxx/src yyy/dest -r -override:false
kcmd cp xxx/src yyy/dest -r SrcSearchPattern:*.txt ExcludeFileNameStartsWith:exclude_
# This command copies the contents of ./src to ./dest at the top level, but only the top-level files (not directories).
kcmd copy ./src ./dest
src
file1
file2
folder1
file3
file4
subfolder1
file5
file6
dest
file1
file2
# This command copies the contents of ./src to ./dest recursively, including all subdirectories and their contents.
kcmd copy ./src ./dest recursive
kcmd copy ./src ./dest -r
src
file1
file2
folder1
file3
file4
subfolder1
file5
file6
dest
file1
file2
folder1
file3
file4
subfolder1
file5
file6
# Keep src folder in dest
kcmd copy ./src ./dest/src
src
file1
file2
folder1
file3
file4
subfolder1
file5
file6
dest
src
file1
file2
# Keep src folder in dest
kcmd copy ./src ./dest/src recursive
src
file1
file2
folder1
file3
file4
subfolder1
file5
file6
dest
src
file1
file2
folder1
file3
file4
subfolder1
file5
file6
kcmd move/mv src dest [name:value] ...
Position | Value |
---|---|
src | file or directory |
dest | file or directory |
Name | Alias | Default | Definition |
---|---|---|---|
AttributesToSkip | 0 | AttributesToSkip | |
ExcludeExe | false | ExcludeExe | |
ExcludeExeFiles | false | ExcludeExeFiles | |
ExcludeExeRelatedFiles | false | ExcludeExeRelatedFiles | |
ExcludeFileNameStartsWith | |||
ExcludeFileNameStartsWithIgnoreCase | |||
IgnoreInaccessible | true | IgnoreInaccessible | |
Include | I | Include | |
OverrideFile | Override | true | |
Recursive | R | false | |
Silent | S | false | |
SrcSearchPattern | * | ||
WhenDirectoryExists | WhenDirectoryExists | ||
WhenDirectoryNotExists | WhenDirectoryNotExists | ||
WhenFileExists | WhenFileExists | ||
WhenFileNotExists | WhenFileNotExists |
kcmd move xxx/file.src yyy/file.dest
kcmd move xxx/src yyy/dest recursive
kcmd move xxx/src yyy/dest -recursive
kcmd mv xxx/src yyy/dest r
kcmd mv xxx/src yyy/dest -r
kcmd mv xxx/src yyy/dest -r SrcSearchPattern:*.txt ExcludeFileNameStartsWith:exclude_
kcmd delete/rm src [name:value] ...
Position | Value |
---|---|
src | file or directory |
Name | Alias | Default | Definition |
---|---|---|---|
AttributesToSkip | 0 | AttributesToSkip | |
ExcludeExe | false | ExcludeExe | |
ExcludeExeFiles | false | ExcludeExeFiles | |
ExcludeExeRelatedFiles | false | ExcludeExeRelatedFiles | |
ExcludeFileNameStartsWith | |||
ExcludeFileNameStartsWithIgnoreCase | |||
IgnoreInaccessible | true | IgnoreInaccessible | |
Include | I | Include | |
OverrideFile | Override | true | |
Recursive | R | false | |
Silent | S | false | |
SrcSearchPattern | * | ||
WhenDirectoryExists | WhenDirectoryExists | ||
WhenDirectoryNotExists | WhenDirectoryNotExists | ||
WhenFileExists | WhenFileExists | ||
WhenFileNotExists | WhenFileNotExists |
kcmd delete xxx/file.txt
kcmd rm xxx/file.txt
kcmd delete xxx/dir recursive
kcmd delete xxx/dir -recursive
kcmd rm xxx/dir r
kcmd rm xxx/dir -r
kcmd rm xxx/src -r SrcSearchPattern:*.txt ExcludeFileNameStartsWith:exclude_
kcmd archive src [name:value] ...
Position | Value |
---|---|
src | file or directory |
Name | Alias | Default | Definition |
---|---|---|---|
AttributesToSkip | 0 | AttributesToSkip | |
CompressionLevel | Optimal | CompressionLevel | |
Dest | D | ||
Encoding | E | utf-8 | Encoding |
ExcludeBaseDirectory | true | ||
ExcludeExe | false | ExcludeExe | |
ExcludeExeFiles | false | ExcludeExeFiles | |
ExcludeExeRelatedFiles | false | ExcludeExeRelatedFiles | |
ExcludeFileNameStartsWith | |||
ExcludeFileNameStartsWithIgnoreCase | |||
IgnoreInaccessible | true | IgnoreInaccessible | |
Include | I | Include | |
IncludeBaseDirectory | false | ||
OverrideFile | Override | true | |
Recursive | R | true | |
Silent | S | false | |
SrcSearchPattern | * | ||
WhenDirectoryExists | WhenDirectoryExists | ||
WhenDirectoryNotExists | WhenDirectoryNotExists | ||
WhenFileExists | WhenFileExists | ||
WhenFileNotExists | WhenFileNotExists |
IncludeBaseDirectory
and ExcludeBaseDirectory
cannot be used at the same time.kcmd archive ./ SrcSearchPattern:*.txt AttributesToSkip:Hidden
kcmd archive ./ SrcSearchPattern:*.uff "AttributesToSkip:Hidden, System"
kcmd archive xxx/file.txt
kcmd archive xxx/file.txt Dest:file.zip
kcmd archive xxx/file.txt dest:file.zip
kcmd archive xxx/file.txt D:file.zip
kcmd archive xxx/file.txt d:file.zip
kcmd archive xxx/file.txt -Dest:file.zip
kcmd archive xxx/file.txt -dest:file.zip
kcmd archive xxx/file.txt -D:file.zip
kcmd archive xxx/file.txt -d:file.zip
kcmd archive xxx/dir
kcmd archive xxx/dir Dest:yyy/file.zip CompressionLevel:Fastest ExcludeBaseDirectory Recursive
kcmd archive xxx/dir Include:file-list.txt
kcmd archive-subdirectories src [name:value] ...
Position | Value |
---|---|
src | directory |
Name | Alias | Default | Definition |
---|---|---|---|
CompressionLevel | Optimal | CompressionLevel | |
Dest | D | ||
Encoding | E | utf-8 | Encoding |
IncludeBaseDirectory | false | ||
OverrideFile | Override | true | |
Silent | S | false | |
DeleteSubdirectories | Delete | false |
kcmd archive-subdirectories ./publish
kcmd archive-subdirectories ./publish -d:./publish/zip/
kcmd archive-subdirectories ./publish IncludeBaseDirectory OverrideFile
kcmd archive-extract/extract src [name:value] ...
Position | Value |
---|---|
src | zip file |
Name | Alias | Default | Definition |
---|---|---|---|
Dest | D | ||
Encoding | E | utf-8 | Encoding |
ExcludeExe | false | ExcludeExe | |
ExcludeExeFiles | false | ExcludeExeFiles | |
ExcludeExeRelatedFiles | false | ExcludeExeRelatedFiles | |
ExcludeFileNameStartsWith | |||
ExcludeFileNameStartsWithIgnoreCase | |||
OverrideFile | Override | true | |
Silent | S | false | |
WhenDirectoryExists | WhenDirectoryExists | ||
WhenDirectoryNotExists | WhenDirectoryNotExists | ||
WhenFileExists | WhenFileExists | ||
WhenFileNotExists | WhenFileNotExists |
kcmd archive-extract xxx/file.zip
kcmd extract xxx/file.zip
kcmd extract xxx/file.zip Dest:yyy/dir
kcmd extract xxx/file.zip Dest:yyy/dir Encoding:gb2312
kcmd extract xxx/file.zip Dest:yyy/dir Encoding:936
kcmd extract xxx/file.zip Dest:yyy/dir -E:gb2312
kcmd extract xxx/file.zip Dest:yyy/dir e:936
kcmd format src type [name:value] ...
Position | Value |
---|---|
src | file or directory |
type | FileFormatType |
Name | Alias | Default | Definition |
---|---|---|---|
AttributesToSkip | 0 | AttributesToSkip | |
Encoding | E | utf-8 | Encoding |
ExcludeExe | false | ExcludeExe | |
ExcludeExeFiles | false | ExcludeExeFiles | |
ExcludeExeRelatedFiles | false | ExcludeExeRelatedFiles | |
ExcludeFileNameStartsWith | |||
ExcludeFileNameStartsWithIgnoreCase | |||
IgnoreInaccessible | true | IgnoreInaccessible | |
Include | I | Include | |
OverrideFile | Override | true | |
Recursive | R | false | |
Silent | S | false | |
SrcSearchPattern | * | ||
WhenDirectoryExists | WhenDirectoryExists | ||
WhenDirectoryNotExists | WhenDirectoryNotExists | ||
WhenFileExists | WhenFileExists | ||
WhenFileNotExists | WhenFileNotExists |
Name | Value | Description |
---|---|---|
Xml | 1 | |
Utf8 | 2 | |
PreferDoubleQuotes | 10 | |
CSharpDataMemberOrder | 101 |
kcmd format ./KCmd.csproj xml
kcmd format ./ xml SrcSearchPattern:*.csproj -R
kcmd format ./common.h utf8 encoding:gb2312
kcmd format ./common.h utf8 encoding:gb2312 backup:false
kcmd format ./ utf8 SrcSearchPattern:*.cs Backup:false Recursive
kcmd format ./ utf8 SrcSearchPattern:"*.h;*.cpp" Backup:false Recursive
kcmd format ./lib/app.dart 10
kcmd format ./lib PreferDoubleQuotes SrcSearchPattern:*.dart Recursive
kcmd format ./lib PreferDoubleQuotes SrcSearchPattern:*.dart Recursive i:./lib/file-list.txt
kcmd format ./Config.cs CSharpDataMemberOrder
kcmd telnet [name:value] ...
none
Name | Alias | Default | Definition |
---|---|---|---|
Host | h | localhost | |
Port | p | 23 | |
UserName | u | ||
Password | pwd | ||
Type | t | 0(None) | 0|1, None|AndroidEmulator |
CommandFile | cf |
kcmd telnet h:localhost p:23 u:root pwd:admin
kcmd telnet Type:AndroidEmulator CommandFile:./cmd-line-by-line.txt Port:5554
kcmd telnet t:1 cf:./cmd-line-by-line.txt h:localhost p:5554
cmd-line-by-line.txt:
redir add tcp:18080:8080
redir add tcp:18081:8081
redir list
kcmd list dir [name:value] ...
Position | Value |
---|---|
dir | directory |
Name | Alias | Default | Definition |
---|---|---|---|
OnlyDirectories | false | ||
OnlyFiles | false | ||
Level | 0 | for sub-directory | |
Output | O | output file | |
Relative | false | use relative path | |
SearchPattern | * | ||
Separator | Environment.NewLine | ||
SurroundBy | |||
DoubleQuotes | false | ||
SingleQuotes | false |
kcmd list ./
kcmd list ./lib relative o:./lib/file-list.txt
kcmd list ./ SearchPattern:*.txt Separator:"," DoubleQuotes
kcmd upload src server [name:value] ...
Position | Value |
---|---|
src | file or directory |
server | http url |
Name | Alias | Default | Definition |
---|---|---|---|
Destination | Dest, D | ||
KeepDirectoryStructure | Keep | false | |
Recursive | R | false | |
AuthenticationType | Auth | ||
UserName | User, U | ||
Password | Pass, P |
This command is mainly used for kaven-file-server.
If Destination
is a directory, make sure it ends with a slash.
kcmd upload ./file.txt http://localhost:3000/file
kcmd upload ./ http://127.0.0.1/file Destination:sub/dir -r -keep
kcmd upload ./build/app-release.apk http://localhost:3000/file dest:"My App .apk"
kcmd upload ./file.txt http://127.0.0.1/file auth:Digest u:username p:password
kcmd generate-commands src [name:value] ...
kcmd gc src [name:value] ...
Position | Value |
---|---|
src | Defined json file |
Name | Alias | Default | Definition |
---|---|---|---|
Output | O |
Variables
and access the output of execution by {xxx}
, like Version
below.publish.json
:
[
{
"Name": "dotnet publish",
"Arguments": "./Kaven.Network.Statistics/Kaven.Network.Statistics.csproj",
"Variables": {
"Version": "kcmd parse-version ./Kaven.Network.Statistics/"
},
"Options": {
"--configuration ": [
"Release"
],
"--self-contained ": [
"false"
],
"-p:PublishSingleFile=": [
"true"
],
"--runtime ": [
"win-x64",
"win-x86",
"win-arm64"
],
"-p:DebugType=": [
"None"
],
"-p:DebugSymbols=": [
"false"
],
"--output ": [
"./publish/Kaven.Network.Statistics-{Version}-{--runtime }"
]
}
}
]
kcmd generate-commands .\publish.json
kcmd generate-commands .\publish.json -o:.\publish.ps1
outputs:
dotnet publish ./Kaven.Network.Statistics/Kaven.Network.Statistics.csproj --configuration Release --self-contained false -p:PublishSingleFile=true --runtime win-x64 -p:DebugType=None -p:DebugSymbols=false --output ./publish/Kaven.Network.Statistics-1.0.6-win-x64
dotnet publish ./Kaven.Network.Statistics/Kaven.Network.Statistics.csproj --configuration Release --self-contained false -p:PublishSingleFile=true --runtime win-x86 -p:DebugType=None -p:DebugSymbols=false --output ./publish/Kaven.Network.Statistics-1.0.6-win-x86
dotnet publish ./Kaven.Network.Statistics/Kaven.Network.Statistics.csproj --configuration Release --self-contained false -p:PublishSingleFile=true --runtime win-arm64 -p:DebugType=None -p:DebugSymbols=false --output ./publish/Kaven.Network.Statistics-1.0.6-win-arm64
kcmd pack src [name:value] ...
Position | Value |
---|---|
src | file or directory |
none
Based on the Archive command, the files in the corresponding directory are automatically packaged into a zip file.
kcmd pack ./
kcmd pack ./bin/Release/AnyCPU/publish/win-x64
kcmd pack ./bin/Release/AnyCPU/publish/win-x64/myApp.exe
->
Generate a file named `myApp-1.0.0.zip`
Generate a new Guid.
kcmd guid [name:value] ...
none
none
kcmd guid
kcmd http-server [name:value] ...
none
Name | Alias | Default | Definition |
---|---|---|---|
Directory | Dir, D | CWD | |
Host | H | ||
Port | P | 3991 | |
UserName | User, U | ||
Password | Pass, pwd | ||
Upload | Set to false to disable uploading, or set the directory path to upload to |
username
nor password
is empty.Directory
by default.kcmd http-server
kcmd http-server Dir:./root/ Host:192.168.1.100 Port:80
kcmd http-server UserName:test Password:123456
kcmd http-server Upload:false
kcmd http-server Upload:./root/upload/
kcmd ftp-server [name:value] ...
none
Name | Alias | Default | Definition |
---|---|---|---|
ConfigFile | Config, C | CWD |
demo configuration file:
{
"Port": 21,
"PasvServerAddress": "",
"PasvPorts": "5555,5600-5655",
"Users": [
{
"UserName": "admin",
"Password": "******",
"Paths": [
{
"VirtualPath": "/",
"RealPath": "E:/Temp"
}
],
"Permissions": "List, Download, Upload, Delete, Rename, CreateDirectory, DeleteDirectory",
"Disabled": false,
"MergePermissions": false,
"AllowClearProtectionLevelOnDataConnection": false
},
{
"UserName": "anonymous",
"Paths": [
{
"VirtualPath": "/",
"RealPath": "E:/Temp"
},
{
"VirtualPath": "/virtual",
"RealPath": "D:/Documents",
"Permissions": "Delete"
},
{
"VirtualPath": "/virtual/data/123",
"RealPath": "D:/Pictures"
}
],
"Permissions": "List, Download",
"Disabled": false,
"MergePermissions": true,
"AllowClearProtectionLevelOnDataConnection": true
}
],
"ImplicitTls": false,
"EnableActiveMode": false,
"EnableTls": true,
"CertificateFile": "certificate.crt",
"PrivateKeyFile": "privateKey.key",
}
kcmd ftp-server
kcmd ftp-server ConfigFile
kcmd ftp-server -c
kcmd ftp-server -c:./ftp.json
kcmd parse-version src [name:value] ...
Position | Value |
---|---|
src | file or directory |
Name | Alias | Default | Definition |
---|---|---|---|
Output | O |
none
kcmd parse-version ./
kcmd parse-version ./ output:./version.txt
kcmd parse-version ./package.json
kcmd parse-version ./pubspec.yaml
kcmd parse-version ./KCmd.csproj
kcmd parse-version ./xxx/Properties/AssemblyInfo.cs
kcmd generate-protobuf file [name:value] ...
kcmd gen-pb file [name:value] ...
Position | Value |
---|---|
file | Config file |
none
none
kcmd generate-protobuf ./pb.kcf
kcmd gen-pb ./pb.kcf
kcmd speed-test-server [name:value] ...
none
Name | Alias | Default | Definition |
---|---|---|---|
Port | 4520 | ||
Interval | 1000 | Calculate every second | |
BufferSize | 1048576 | ||
OneTime | false | Automatically close after the first client disconnects |
none
kcmd speed-test-server
kcmd speed-test-server port:3721 interval:5000 bufferSize:1024
kcmd speed-test-server -oneTime
kcmd speed-test-client [name:value] ...
none
Name | Alias | Default | Definition |
---|---|---|---|
Server | 127.0.0.1 | ||
Port | 4520 | ||
Interval | 1000 | Calculate every second | |
BufferSize | 1048576 |
none
kcmd speed-test-client
kcmd speed-test-client server:192.168.1.1 port:3721 interval:5000 bufferSize:1024
kcmd watermark src [name:value] ...
Position | Value |
---|---|
src | file or directory |
Name | Alias | Default | Definition |
---|---|---|---|
Output | O | src |
file or directory |
OverrideFile | Override | false | |
Text | DateTime.Now | watermark text | |
FontName | CygnetRound | ||
FontSize | Size | 16 | |
FontColor | Color | rgba(36, 33, 30, 0.16) | |
Angle | -45 | ||
HorizontalSpace | H | 60 | |
VerticalSpace | V | 30 | |
Utc | false |
Text
formatted with System.DateTime.ToString()kcmd watermark ./image.png -override
kcmd watermark ./ -output:./output
# you can escape the literal part of the format string using single quotes
kcmd watermark ./image.png -output:./watermarked.png -text:"'Kaven: 'yyyy-MM-dd HH:mm:ss"
kcmd watermark ./image.png -output:./watermarked.png -size:32
kcmd watermark ./image.png -output:./watermarked.png -color:red
kcmd watermark ./image.png -output:./watermarked.png -color:"rgba(36, 33, 30, 0.16)"
kcmd watermark ./image.png -output:./watermarked.png -color:"#f00"
kcmd compare file1 file2
Position | Value |
---|---|
file1 | file1 path |
file2 | file2 path |
none
kcmd compare ./file1 ./file2
kcmd generate-dummy-file output size [name:value] ...
kcmd gen-dummy output size [name:value] ...
Position | Value |
---|---|
output | save path |
size | file size |
Name | Alias | Default | Definition |
---|---|---|---|
FillRandomData | Fill | false |
none
kcmd gen-dummy ./file 10485760
kcmd gen-dummy ./file 10485760 -fill
kcmd gen-dummy ./file 100MiB -fill
kcmd gen-dummy ./file "10.5 GB" -fill
kcmd calculate-hash file [name:value] ...
kcmd hash file [name:value] ...
Position | Value |
---|---|
file | The file path for which the hash value needs to be calculated |
Name | Alias | Default | Definition |
---|---|---|---|
Output | O | file + ‘.yyyyMMddHHmmssfff.kaven.hash’ |
none
# Calculate file hash and save to default file
kcmd calculate-hash ./file
kcmd hash ./file
# Save to a custom file
kcmd hash ./file output:./hash.txt
# No need to save to file
kcmd hash ./file output:false
kcmd verify-hash file [name:value] ...
Position | Value |
---|---|
file | The file path for which the hash value needs to be verified |
Name | Alias | Default | Definition |
---|---|---|---|
HashFile | Specify a hash file generated by the Calculate-Hash/Hash command | ||
Output | O | file + ‘.yyyyMMddHHmmssfff.kaven.hash.fails’ |
Only if the verification fails will it be saved automatically |
none
# Automatically find hash files with the same name
kcmd verify-hash ./file
# Specify a hash file
kcmd verify-hash ./file hashFile:./hash.txt
# Specify the file to save the verification results
kcmd verify-hash ./file output:./result.txt
# No need to save even if validation fails
kcmd verify-hash ./file output:false
Searches for *.kcmd
files and runs the commands in the files line by line.
kcmd run [name:value] ...
none
Name | Alias | Default | Definition |
---|---|---|---|
Root | CWD |
Current working directory | |
SearchLevel | -1 | <0 : AllDirectories, 0 : TopDirectoryOnly |
none
kcmd run
kcmd run root:./src
kcmd run root:./src searchLevel:10
Display the processes that occupy the file.
kcmd find-open-handles file [name:value] ...
Position | Value |
---|---|
file | file path |
none
none
kcmd find-open-handles C:\Windows\explorer.exe
kcmd where [open]
kcmd help
Name | Value | Description |
---|---|---|
Fastest | 1 | The compression operation should complete as quickly as possible, even if the resulting file is not optimally compressed. |
NoCompression | 2 | No compression should be performed on the file. |
Optimal | 0 | The compression operation should be optimally compressed, even if the operation takes a longer time to complete. |
SmallestSize | 3 | The compression operation should create output as small as possible, even if the operation takes a longer time to complete. |
ExcludeExeFiles and ExcludeExeRelatedFiles
Exclude all .exe
files;
KCmd.exe
Exclude all .exe
related files.
KCmd.deps.json
KCmd.dll
KCmd.pdb
KCmd.runtimeconfig.dev.json
KCmd.runtimeconfig.json
Name | Value | Description |
---|---|---|
Archive | 32 | This file is marked to be included in incremental backup operation. Windows sets this attribute whenever the file is modified, and backup software should clear it when processing the file during incremental backup. |
Compressed | 2048 | The file is compressed. |
Device | 64 | Reserved for future use. |
Directory | 16 | The file is a directory. Directory is supported on Windows, Linux, and macOS. |
Encrypted | 16384 | The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and directories. |
Hidden | 2 | The file is hidden, and thus is not included in an ordinary directory listing. Hidden is supported on Windows, Linux, and macOS. |
IntegrityStream | 32768 | The file or directory includes data integrity support. When this value is applied to a file, all data streams in the file have integrity support. When this value is applied to a directory, all new files and subdirectories within that directory, by default, include integrity support. |
Normal | 128 | The file is a standard file that has no special attributes. This attribute is valid only if it is used alone. Normal is supported on Windows, Linux, and macOS. |
NoScrubData | 131072 | The file or directory is excluded from the data integrity scan. When this value is applied to a directory, by default, all new files and subdirectories within that directory are excluded from data integrity. |
NotContentIndexed | 8192 | The file will not be indexed by the operating system’s content indexing service. |
Offline | 4096 | The file is offline. The data of the file is not immediately available. |
ReadOnly | 1 | The file is read-only. ReadOnly is supported on Windows, Linux, and macOS. On Linux and macOS, changing the ReadOnly flag is a permissions operation. |
ReparsePoint | 1024 | The file contains a reparse point, which is a block of user-defined data associated with a file or a directory. ReparsePoint is supported on Windows, Linux, and macOS. |
SparseFile | 512 | The file is a sparse file. Sparse files are typically large files whose data consists of mostly zeros. |
System | 4 | The file is a system file. That is, the file is part of the operating system or is used exclusively by the operating system. |
Temporary | 256 | The file is temporary. A temporary file contains data that is needed while an application is executing but is not needed after the application is finished. File systems try to keep all the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed. |
Use Include
to include multiple files/directories under the Src
directory.
file-list.txt(relative to Src
):
dir1
dir3/file1
dir5/subDir/
file
...
kcmd mv xxx/src_dir yyy/dest_dir -include:file-list.txt
kcmd cp xxx/src_dir yyy/dest_dir Include:file-list.txt
kcmd rm xxx/src_dir I:file-list.txt
kcmd archive xxx/src_dir i:file-list.txt
Specify a directory path, execute the command only if the path exists.
kcmd cp README.md ../doc/KCmd/README.md WhenDirectoryExists:../doc
Specify a directory path, execute the command only if the path dose not exists.
Specify a file path, execute the command only if the path exists.
Specify a file path, execute the command only if the path dose not exists.
The creators of this command-line tool hereby declare that they bear no responsibility for any direct or indirect damages arising from the use of the code or information contained herein. All code within this tool is provided “as is,” with no expressed or implied warranties. Users assume full responsibility for any risks associated with utilizing this tool.
The code in this tool may contain errors or defects, and the creators do not ensure its accuracy, completeness, or suitability. Users are urged to validate the code and make necessary modifications to suit their specific requirements.
The creators shall not be held liable for any direct or indirect damages resulting from the use of this tool, including but not limited to loss of profits, data, or business interruption.
By utilizing this tool, you acknowledge and accept all terms and conditions stated in this disclaimer.