如何用cmd创建文件? [英] how to create a file with the cmd?

查看:181
本文介绍了如何用cmd创建文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台win7机器,我使用了Git Shell(它似乎是Windows Powershell)。我试图遵循GIT IMMERSION的实验3教程( http://gitimmersion.com/lab_03.html )。



我不知道如何用下面的内容创建一个名为hello.rb的文件。

  putsHello,World

任何帮助表示赞赏。非常感谢!

解决方案

如果是Powershell,那么使用 Set-Content

  Set-Content hello.rb'putsHello,World'


I have a win7 machine and I use Git Shell (which seems to be Windows Powershell)

I am trying to follow the Lab 3 tutorial of GIT IMMERSION (http://gitimmersion.com/lab_03.html).

I do not know how to create a file named hello.rb with the contents below.

puts "Hello, World"

Any help is appreciated. Many thanks!

解决方案

If it's Powershell, then use Set-Content

Set-Content hello.rb 'puts "Hello, World"'

这篇关于如何用cmd创建文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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