fungsi nano [ Linux ]
fungsi nano [ Linux ]
Fungsi nano adalah untuk mengedit sesuatu File dalama Editor/Terminal.
Quote:
Opening and creating files
Opening and creating files is simple in nano, simply type:
Code:
nano filename
Nano is a modeless editor so you can start typing immediately to insert text. If you are editing a configuration file like /etc/fstab use the -w switch, for example:
Code Listing 1.2: Disable the word wrapping
Code:
nano -w /etc/fstab
Saving and exiting
If you want to save the changes you've made, press Ctrl+O. To exit nano, type Ctrl+X. If you ask nano to exit from a modified file, it will ask you if you want to save it. Just press N in case you don't, or Y in case you do. It will then ask you for a filename. Just type it in and press Enter.
If you accidentally confirmed that you want to save the file but you actually don't, you can always cancel by pressing Ctrl+C when you're prompted for a filename.
Cutting and pasting
To cut a single line, you use Ctrl+K (hold down Ctrl and then press K). The line disappears. To paste it, you simply move the cursor to where you want to paste it and punch Ctrl+U. The line reappears. To move multiple lines, simply cut them with several Ctrl+Ks in a row, then paste them with a single Ctrl+U. The whole paragraph appears wherever you want it.
If you need a little more fine-grained control, then you have to mark the text. Move the cursor to the beginning of the text you want to cut. Hit Ctrl+6 (or Alt+A). Now move your cursor to the end of the text you want to cut: the marked text gets highlighted. If you need to cancel your text marking, simply hit Ctrl+6 again. Press Ctrl+K to cut the marked text. Use Ctrl+U to paste it.
Searching for text
Searching for a string is easy as long as you think "WhereIs" instead of "Search". Simply hit Ctrl+W, type in your search string, and press Enter. To search for the same string again, hit Alt+W.
Quote:
Opening and creating files
Opening and creating files is simple in nano, simply type:
Code:
nano filename
Nano is a modeless editor so you can start typing immediately to insert text. If you are editing a configuration file like /etc/fstab use the -w switch, for example:
Code Listing 1.2: Disable the word wrapping
Code:
nano -w /etc/fstab
Saving and exiting
If you want to save the changes you've made, press Ctrl+O. To exit nano, type Ctrl+X. If you ask nano to exit from a modified file, it will ask you if you want to save it. Just press N in case you don't, or Y in case you do. It will then ask you for a filename. Just type it in and press Enter.
If you accidentally confirmed that you want to save the file but you actually don't, you can always cancel by pressing Ctrl+C when you're prompted for a filename.
Cutting and pasting
To cut a single line, you use Ctrl+K (hold down Ctrl and then press K). The line disappears. To paste it, you simply move the cursor to where you want to paste it and punch Ctrl+U. The line reappears. To move multiple lines, simply cut them with several Ctrl+Ks in a row, then paste them with a single Ctrl+U. The whole paragraph appears wherever you want it.
If you need a little more fine-grained control, then you have to mark the text. Move the cursor to the beginning of the text you want to cut. Hit Ctrl+6 (or Alt+A). Now move your cursor to the end of the text you want to cut: the marked text gets highlighted. If you need to cancel your text marking, simply hit Ctrl+6 again. Press Ctrl+K to cut the marked text. Use Ctrl+U to paste it.
Searching for text
Searching for a string is easy as long as you think "WhereIs" instead of "Search". Simply hit Ctrl+W, type in your search string, and press Enter. To search for the same string again, hit Alt+W.
Permissions in this forum:
You cannot reply to topics in this forum
|
|