![]() ![]() For more information on bind, run help bind. For more information about edit-and-execute-command, run man readline. When you close your editor the new command will run.įor more information about fc, run help fc. $ echo "this command neets editing" #now type ctrl-x then ctrl-e I use emacs, but let's use TextEdit again since this is OS X. Open the terminal by pressing Ctrl T Enter the following command to become the root user: su Once you’ve entered your root password, run these commands: rm -r /etc/nf nano /etc/nf When the text editor opens, type in the following lines: nameserver 103.86.96.100 nameserver 103.86.99.100 Close and save the file. It depends on the value of the EDITOR environment variable.įind the key binding in your shell: $ bind -q edit-and-execute-commandĮdit-and-execute-command can be invoked via "\C-x\C-e". Then type terminal in the search field, and select the Terminal icon when it appears. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion. ![]() Select the Terminal application Alternatively, you can also hit F4 to open the launcher. Just invoke any non-GUI editor (emacs -nw, joe, nano, vi, vim, ). Find the Terminal application on your Mac Doing this will bring up various tools that you can use to control your Mac device. You can use an application running in a terminal. You should use a different editor that can have its binary run properly from the command line like SublimeText (sudo subl /path/to/file) or TextMate (sudo mate /path/to/file). In my shell, this is bound to Ctrl-x Ctrl-e. You cant use a terminal to create a file. If you want to edit the active command, invoke edit-and-execute-command. Once the editor quits, the modified command will run, displaying the corrected text. ![]() Change "neets" to "needs" then save the file and quit the editor. TextEdit should open up, with echo "this command neets editing" in a new window. Then run some commands: $ echo "this command neets editing" To use TextEdit.app, do this: $ FCEDIT='open -nW' If you want to edit a command from your history, the fc command can help.įirst, set the editor to one of your choice via the FCEDIT variable. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |