Windows命令行和VScode升级报错解决

Windows命令行

cmd是command的缩写.即命令行

 命令 MS-DOS Linux  
 列举文件 dir      ls 
 查看文件    type     cat 
 显示你在文件系统中的位置 chdir pwd 
 用指定的路径(绝对路径,absolute path)来改换目录 cd 路径名 
显示文件目录 tree 
 用一个相对路径(relative path)来改换目录 cd .. cd ..  
 把输出“回响”到屏幕上 echo echo echo this message
 查看文件 more less([d]) less thisfile.txt
搜索  where  where命令显示命令所在的路径
 在文件中寻找字串 find grep grep 词或词组 thisfile.txt
 显示命令帮助 命令 /?    man([c])  
 创建目录 mkdir mkdir mkdir 目录
 复制文件 copy cp  
 转移文件 move mv
 重新命名文件 ren mv([e]) mv thisfile.txt thatfile.txt
 程序
    查看所有进程     tasklist 
    查看进程号信息:   tasklist |findstr  9999
    杀进程: taskkill -f -t -im javaw.exe; 
 设置环境变量
     set path=G:\ant\rocketmq-all-4.2.0;%path%;    
 其他相关
    explorer ------- 打开资源管理器
    taskmgr  ------- 任务管理器
windows变量
cmd
%APPDATA%	 C:\Users\用户名\AppData\Roaming
%HOMEPATH%	 C:\Users\用户名
%USERPROFILE%	C:\Users用户名
%TEMP%和%TMP%	C:\Users\用户名\AppData\LocalTemp
%SystemRoot%	C:\Windows
%WINDIR%		 C:\Windows
windows进程
explorer.exe是Windows程序管理器或者文件资源管理器,
    它用于管理Windows图形壳,包括桌面和文件管理,删除该程序会导致Windows图形界面无法使用。
	%SystemRoot%\explorer.exe
iexplore.exe 是浏览器进程
示例
     type c:\windows\system32\drivers\etc\hosts
     net start 查看开启了哪些 Windows 服务
	 echo %PATH%    Linux中是 echo $PATH
 退出
  exit
  ver     uname -a
  点击 F7  或者 doskey /history     类似于 linux  history
  查看最近操作  recent
  执行情况
     bat文件是dos下的批处理文件,批处理文件是无格式的文本文件,
	它包含一条或多条命令,后缀为.cmd或.bat

区分文件类型

 window中默认情况下有一下后缀名的文件可以直接执行:
      .EXE 最常见的可执行文件
      .MSI 一般用来做安装文件
      .VBS 这个是vb脚本文件
      .JS 这个是java脚本文件
      .CMD 这个是操作命令文件
      .BAT 这个是批处理文件
      .SCR 这个一般是屏保之类的
      .REG 这个是导入注册表文件
Linux与Windows不同,不是根据扩展名来区分文件类型的
UNIX/LINUX 平台下三种主要的可执行文件格式:
    a.out(assembler and link editor output 汇编器和链接编辑器的输出)
	COFF(Common Object File Format 通用对象文件格式)、
    ELF(Executable and Linking Format 可执行和链接格式

方案一

需要根据自己的Vscode的commit,
手动下载vscode-server-linux-x64.tar.gz,
01.本地Vscode 查看方式:Vscode的菜单栏中help–>>About

02.commit之后(我的commit:2d23c42a936db1c7b3b06f918cde29561cc47cd6, 
commit与vscode的版本号对应,我的vscode版本:1.14.1),
需要在可以连接该网址的电脑上打开,下载得到了vscode-server-linux-x64.tar.gz

 https://update.code.visualstudio.com/commit:2d23c42a936db1c7b3b06f918cde29561cc47cd6/server-linux-x64/stable
ssh登陆服务器的客户端上登陆账户,在账户的主目录下,
进入.vscode-server/bin/(commit)/目录下(注意:commit:需要自己根据vscode版本号更改),
上传下载好的vscode-server-linux-x64.tar.gz
cd ~/.vscode-server/bin/2d23c42a936db1c7b3b06f918cde29561cc47cd6/              注意:commit:需要自己根据vscode版本号更改


上传好了之后,在当前目录下执行下面的两行命令,重启vscode即可登陆
tar -zxvf vscode-server-linux-x64.tar.gz -C ./

解压好了最后一步,进入vscode-server-linux-x64/文件夹下,将所有文件移到上一级目录(commit)下
mv vscode-server-linux-x64/* .

在连接的过程中
cd ~/.vscode-server/bin/2d23c42a936db1c7b3b06f918cde29561cc47cd6/  

touch  vscode-scp-done.flag  

方案二:

卸载了,重新安装最新的VScode

说明

ms-vscode-remote.remote-ssh
本机可以直接联网  启用remote.SSH.allowLocalServerDownload选项,
   即可先在本机下载VSCode服务器,然后自动通过SCP上传至远程机
  remote.SSH.allowLocalServerDownload	
	If downloading the VS Code server fails on the host, 
	this allows the extension to fall back to downloading on the client 
	and transferring it to the host with scp
 remote.SSH.localServerDownload	
    Whether the extension can download the VS Code Server on the client and transfer it to the host with scp, 
    instead of downloading it on the host.

参考:

 本地vscode通过SSH远程连接Ubuntu服务器 https://blog.csdn.net/Deeachain/article/details/106981149	
 VSCode离线环境求生指南:远程SSH服务器 https://zhuanlan.zhihu.com/p/111324187
posted @ 2022-03-24 16:42  辰令  阅读(337)  评论(0编辑  收藏  举报