使用 Powershell 在控制台上编辑文本文件 [英] Edit a text file on the console using Powershell

查看:373
本文介绍了使用 Powershell 在控制台上编辑文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出在控制台中编辑文本文件的最简单方法(在我的例子中是 PowerShell).我正在使用 Windows 7 64 位.我不能只输入 edit filename.txt 来编辑文件,这让我很恼火.这曾经有效,但一切都变了.我有哪些选项可以在 Windows 控制台中查看和编辑文本文件,如果你告诉我安装和学习 VIM,我会打你的脸.:-)

I'm trying to figure out the easiest way to edit text files in the console (PowerShell in my case). I'm using Windows 7 64 bit. It galls me that I can't just type edit filename.txt to edit a file. That used to work, but that's all changed. What are my options to view and edit text files within the windows console, and if you tell me to install and learn VIM I'm going to punch you in the face. :-)

推荐答案

为什么不使用记事本?

notepad.exe filename.txt

旧的 edit.com 可在 PowerShell 中运行(至少在我的机器上:Windows 7 Pro x86)但在 x64 中由于其 16 位架构而无法运行.

The old edit.com works in PowerShell (at least on my box: Windows 7 Pro x86) but in x64 it doesn't work due to its 16bit architecture.

您可以看看这个简单的编辑器.

You can take a look at this easy editor.

这篇关于使用 Powershell 在控制台上编辑文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆