Active3 years, 3 months ago
I would like to be able to create and edit the text of a file, all from the command line. No pop-up window (like with notepad), just create the file and start editing. I know this can be done with Nano on Mac.
My current command line is 'Command Prompt with Ruby and Rails,' which I'm using on Windows 8. Apparently I have VIM installed, or VI. When I commit to git, I am entered into an excellent text edit space - within my current window. Great! But how do I do it if not committing anything, and just want to >make file>edit file>. Something like >vim file_name.
So the VIM command would be appreciated. If not available, what else can I install? I tried the Nano binary. I ran the
nano.exe
and it works, but calling >nano file_name from cmd doesn't work. I already copy-pasted the cygwin1.dll
to the folder nano asks for in the readme. No luck. I'm using the WinNT/9x binary, .zip
format download.An A-Z Index of the Apple macOS command line (OS X). Service command line utility du Estimate file space usage e echo Display text on screen • ed A line-oriented text editor (edlin) enable. “Mac OS X is a rock-solid system that's beautifully designed. Opening Sublime Text (or other text editor) from command line as root on Mac OS. Ask Question. Up vote 0 down vote favorite. I've modified my /var/root/.profile using nano (this is the only editor which works with root for some reason(. Ridiculous, I know))). Sublime Text Editor command not found. The command line is a text interface for your computer. It's a program that takes in commands, which it passes on to the computer's operating system to run. From the command line, you can navigate through files and folders on your computer, just as you would with Windows Explorer on Windows or Finder on Mac OS. Depends on what text editor you want to use. Personally I use vi, but it's a bit UNIX-y for traditional Mac folks. Command would either be 'vi ' or 'sudo vi ' for system config files.
I'm using x64 Windows 8 OS.
Kevin Panko6,1241111 gold badges3737 silver badges4848 bronze badges
user258613user258613
5 Answers
What Is Text Edit For Mac
Vim will work inside the Windows console window if you run it with
vim.exe
.If you run it with
gvim.exe
then it will pop up a graphical window, kind of like Notepad would.Therefore, you want to type the command
vim
or vim file_name
and you should get what you want.Instead, you could use a and have the speech converted into text more easily. Transcribe audio to text software free download for mac.
Make sure your
Kevin PankoKevin Panko$PATH
is set to include the folder with vim.exe
.6,1241111 gold badges3737 silver badges4848 bronze badges
I always use Cygwin with Git and Vim installed to be like on a Unix term and it works perfectly (with a bashrc and alisases ..) and of course ou can install ruby and irb.
HettomeiHettomei
It just depends what editor you install. I like UltraEdit, but it's not free for long-term use. Some people like XPad, which is apparently free. There is a program called 'WinVI' which is a Windows editor similar to VI, of course. You just have to decide what type of editor you want. For that matter, you could use the XP EDIT program, just copy it to Win7 from an XP system. However, I'm not sure that there's any advantage to using a text-based 'DOS' style editor in Windows 7; it may look retro, but there's not likely to be any upside to it.
I think if I had to recommend something DOS-like, I'd go with Emacs-for-Windows:http://ftp.gnu.org/gnu/emacs/windows/
Whatever editor you want to use, put the installation folder into your PATH variable, which is found with Control Panel > System > Advanced System Settings > click on Environment Variables box. Select the PATH variable, and Edit, to add a colon at the end & then the path to the newly-installed program (i.e. 'C:Program Files (X86)Editco'
This path change will then allow you to just type the program name, instead of the specific location, i.e.instead of
you'd just type
DebraDebra3,91011 gold badge1111 silver badges2121 bronze badges
You could try one of the following options:
- vim for Windows.
daviewalesdaviewales
edit
is still available in Windows 7. Microsoft removed it in Windows 8 and up.If you want to create a simple file from the command prompt use:
c:>
copy con filename.txt
Use CTRL+Z to save the file.
Text Edit For Mac Tutorial For Beginners
You can also use echo and pipe it to a file.
Community♦
SunSun4,72988 gold badges2525 silver badges4444 bronze badges
Not the answer you're looking for? Browse other questions tagged windowscommand-linevimgit or ask your own question.
If you’ve been using a Mac for any length of time, you know that it’s more than just a pretty point-and-click, window-and-icon interface. Beneath the surface of OS X is an entire world that you can access only from the command line. Terminal (in your /Applications/Utilities folder) is the default gateway to that command line on a Mac. With it, instead of pointing and clicking, you type your commands and your Mac does your bidding.
Why would you want to do that? For almost all of your computing needs, the regular graphical user interface is enough. But the command line can be handy when it comes to troubleshooting your Mac, to turn on “hidden” settings, and other advanced chores. Many of the hints we publish on the Mac OS X Hints website require the use of the command line. It’s a good idea for anyone who isn’t an utter beginner to be familiar with it.
If you aren’t already familiar with OS X's command-line interface, this week we'll get you up to speed. The plan is to cover the most important commands you need to know and show you how to use them. First up: How to navigate the file system from the command-line prompt.
The prompt
By default, when you open Terminal, the first thing you’ll see is something like this:
The first line shows the last time you logged into your Mac via the command line; that’s the current time, when you’re using Terminal. The second line is the prompt, and while it can change from system to system depending on configuration, by default it contains several bits of information.
![Command Prompt And Text Edit For Mac Os Command Prompt And Text Edit For Mac Os](/uploads/1/2/5/3/125300674/225657310.png)
In my prompt, walden is the name of my Mac (same as the name in the Sharing pane of System Preferences), and kirk is my user name. The ~ shows where I am in the file system of my Mac; ~ is a shortcut that means the current user’s home folder. (In the Finder, that’s the folder with your user name and the house icon.) Finally, the $ is a character that the bash shell (the default interface that Terminal uses) displays to indicate that it’s ready to accept a command.
What’s in a folder
When you first get to the command line, you’re in your home folder. While you’re there—or when you’re in any folder (directory in Unix-speak)—you might want to know what’s in it. To do that you use the
ls
(or list) command. Type ls
and press the Return key, and you’ll see the folders (and/or files) in the current directory.The output of the plain
ls
command is pretty sparse; it shows you the names of files and folders contained in the current directory (including some familiar ones such as Movies, Music, Pictures, and so on). Fortunately, you can add a number of optional switches to the ls
command that allow you to see more information. So, for example, try typing ls -l
(that’s a lower-case L), then pressing Return. You’ll see something like this:Don’t worry too much about what all that means right now; we’re just getting our feet wet. The point is that
ls
can provide additional information about files and folders, depending on the options you specify. In this case, that additional information includes the name of the user who owns each item in the directory. (That ownership is part of the Unix system’s file-permissions regime.) The kirk kirk
next to most of those items above means that each one is owned by the user kirk, who is in the group kirk. The other understandable bit of information next to each file and folder is the date and time each one was last modified.One other handy option: You can view invisible files—ones that the Finder doesn’t normally show you—by typing
ls -a
. (These hidden files all have dots (.) in front of their names.)Moving around
When you’re in the Finder and you want to move to another folder, you find that folder and double-click it. From the command line, you use the
cd
(or change directory) command instead. So let’s say you’re in your Home folder and want to peek inside the Downloads folder. To do that, you’d type cd Downloads
. (Remember to always type a space after any command that has an additional argument, such as the name of a directory in the previous example.) Once you’ve done that, ls
will show you the contents of your Downloads folder.Here are a couple of quick tricks for moving around in your Mac’s file system.
- If you type
cd
and press the Return key—with no directory specified—you’ll go back to your Home folder. (You can also typecd ~
to go there.) - If you type
cd /
, you’ll go to the root level of your startup disk. - If you type
cd .
(that’s two periods), you’ll go to the directory above the one you’re currently in. So if you’re in your home folder, and typecd .
, you’ll go to your Mac’s /Users folder. - And if you type
cd -
(hyphen) you’ll go back to the directory you were in before the last time you issued thecd
command.
That should be enough to get you started. Try playing around in Terminal, exploring your folders and files with just those two commands. In future articles, I’ll show you how you can apply the
ls
and cd
commands in more depth, so you can be comfortable flitting around your file system from the command line.Note: When you purchase something after clicking links in our articles, we may earn a small commission. Read our affiliate link policy for more details.