Albay Sunucusu - Altyapı Sunucu Barındırma

İletişim Bilgileri

Seğirme 96072377

[email protected]

Başlayın
nano
image_pdfPDF indir

Nano Metin Düzenleyicisini Kullanma: Tam Bir Kılavuz

Linux üzerinde komut satırı modunda çalışırken, Metin dosyaları oluşturmanız veya düzenlemeniz gerekir. Tanınmış editörlerden biri Vim, Ama yeni başlayanlar için zor olabilir. Daha basit ve daha kullanıcı dostu bir alternatif arayan kullanıcılar için, the Nano text editor is available.

Cloud VPS

Need Affordable CLOUD VPS

Cloud Power with Full Control

See Plans

Nano is a lightweight, command-line text editor for Unix and Linux systems. It supports useful features beyond basic editing such as search and replace, cut and paste, and syntax highlighting.

In this guide, we will walk through the main functions of Nano: creating and opening files, editing and saving content, searching and replacing text, cutting and pasting, and customizing settings.

Installing Nano

Nano is typically pre-installed on most Linux distributions. To check if it is installed, run:

nano --version

If not installed, use the following commands:

Ubuntu/Debian

sudo apt install nano

CentOS/Fedora

Debian VPS

Debian VPS Server

Güvenli, Stable & Affordable

Explore Now
sudo yum install nano

Creating and Opening Files

To open or create a file:

nano filename

This opens a text editing interface. You can start typing right away.

Shortcuts are displayed at the bottom of the screen:

  • ^ = Ctrl key
  • M = Alt key
  • Örneğin, ^J = Ctrl + J

Use Ctrl + G to view the full list of available commands.

Windows VPS

Windows VPS Hosting

Remote Access & Full Admin

Şimdi al

Editing Files

Unlike vi, Nano allows immediate editing upon opening a file.

To jump to a specific line:

  • Press Ctrl + _, then enter the line number.

Searching and Replacing

  • Search text: Ctrl + W, type the keyword, then Enter.
  • Next match: Alt + W

Search and Replace:

  1. Press Ctrl + \
  2. Enter the text to find
  3. Enter replacement text
  4. Confirm each replacement with Y (Evet), N (HAYIR), or replace all with A

Copying, Cutting, and Pasting

  1. Select text: Move the cursor to start point, press Alt + A, move to the end.
  2. Copy: Alt + 6
  3. Cut: Ctrl + K
  4. Paste: Move the cursor to the target location, press Ctrl + U

To cancel selection: Ctrl + 6

Saving and Exiting

  • Kaydetmek: Ctrl + O, then Enter
  • Exit: Ctrl + X. If changes are unsaved, Nano prompts you to save.

Nano Configuration (nanorc)

Nano reads its configuration from the following files (in order):

  • System-wide: /etc/nanorc
  • User-specific: ~/.config/nano/nanorc veya ~/.nanorc

User settings override system defaults.

Syntax Highlighting

Nano supports syntax highlighting for common file types. Syntax files are stored in:

/usr/share/nano/

To include them:

include "/usr/share/nano/*.nanorc"

Set Nano as Default Editor

To use Nano as your default editor for commands like crontab veya visudo, set the environment variables:

Add the following lines to your ~/.bashrc:

export VISUAL=nano
export EDITOR="$VISUAL"

Summary

  • Launch Nano with: nano filename
  • Start editing immediately
  • Use Ctrl + O to save, Ctrl + X to exit
  • Use shortcuts for advanced editing features

Nano is an intuitive and powerful tool for quick and easy file editing in Linux.

Bu gönderiyi paylaşın

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir