2024年4月

文件的移动

命令格式: mv [option] source destination

mv  move  [移动 改名] Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. 把目标文件[SRC]移动到目标位置[DEST]改名,或者把源文件移动到目标目录
 
1.移动
#mv a.txt /tmp  //把文件a.txt移动到/tmp 目录下
 
2.改名
#mv a.txt aa.txt  //把文件a.txt移动到当前目录下并改名为aa.txt
#mv /tmp/a.txt  aaa.txt  //把/tmp目录下的a.txt文件移动到当前目录下并改名为aaa.txt   在linux系统中 如果文件前面不加路径 默认为当前路径下的文件
 
3.对多个文件移动
#mv file1.txt file2.txt file3.txt  /tmp //把当前目录下的file{1..5}.txt 文件移动到/tmp目录下   mv命令默认最后一个参数为目标位置 其余的为源文件
 
4.对多个文件和目录文件进行移动
#mv /tmp/file1.txt /tmp/file2.txt /tmp/dir1  /root
#把/tmp目录下的file1.txt file2.txt dir1 移动到/root目录下

文件的删除

文件删除 : rm [option] source destination

rm  remove  删除
Remove (unlink) the FILE(s).
删除(解除)文件
 
常用的rm命令参数:
-f force  ignore nonexistent files and arguments, never prompt  忽略不存在的文件和参数,不提示 
 
rm -f filename 删除文件且不询问
 
-r or -R recursive  remove directories and their contents recursively 递归地删除目录及其内容
 
rm -rf dirname  删除目录且不询问
 
常用命令
rm -rf ./* 删除当前目录下的所有文件
注:删除时谨慎使用* 不要把根目录全删了

文件复制

命令格式 : cp [option] source destination

cp  copy 复制
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
把源文件[src]复制到目标位置dest,或者将多个源文件复制到目标位置
 
常用的cp命令参数:
-f force 与rm命令参数中的-f一致 强制删除 不询问
-r recursive 递归
 
复制单个文件
cp a.txt /tmp   // 将当前目录下的a.txt文件复制到目录 /tmp 下
 
 
复制多个文件
cp file1.txt file2.txt file3.txt  /tmp
#将多个文件复制到/tmp目录下   cp与mv命令相似 默认把最后一个参数作为目标位置 其余为源文件
 
复制目录
cp -r dir1 /tmp   //复制目录dir1 到 /tmp下
 
cp -rf dir1 /tmp  
 
cp -rf dir1/*  /tmp  // 复制目录dir1下的所有文件和目录到/tmp下

  • 列表项目
  • 按住win键后按R键,打开运行框,输入【regedit】,进入注册表
  • 打开【HKEY_CURRENT_USER】目录,并打开【Software】目录
  • 依次打开【Microsoft\Windows\CurrentVersion\Explorer\Mycomputer\NameSpace】
  • 选中【NameSpace】下的迅雷下载文件,删除即可

字典

Private Dict As New Dictionary(Of String, String) From {
{"key1", "value1"},
{"key2", "value2"},
{"key3", "value3"},
{"key4", "value4"}}

数组

Private opcString() As String = {"B_0002_MYRG.EL.Rcv.Constituent[1].ActualValue",
"B_0003_MYRG.EL.Rcv.Constituent[1].ActualValue",
"B_0004_MYRG.EL.Rcv.Constituent[1].ActualValue",
"B_0007_MYRG.EL.Rcv.Constituent[1].ActualValue",
"MILBS001.PCReadJob.TarExt.B_2143_KCL10.TargetMoisture"}