•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

เปลี่ยนชื่อไฟล์ใน linux

  • Home
  • Client
  • Qa Forum
  • เปลี่ยนชื่อไฟล์ใน linux

Posted By: Jeremy | 1 Replies | Last Reply On: May 23, 2017 06:22:54

วิธีการเปลี่ยนชื่อไฟล์ใน linux?

Psychz - Raviteja

Votes: 0Posted On: May 23, 2017 06:22:54
 

ไฟล์ในลินุกซ์สามารถเปลี่ยนชื่อได้โดยใช้วิธีการต่างๆ ต่อไปนี้เป็นวิธีสำคัญที่ใช้เพื่อเปลี่ยนชื่อไฟล์ใน linux

คำสั่ง "mv" (ย้าย)

คำสั่ง "mv" ในลินุกซ์สามารถใช้เพื่อย้ายและเปลี่ยนชื่อไฟล์ในลินุกซ์ได้ สมมติว่าคุณต้องการเปลี่ยนชื่อไฟล์ที่คุณต้องย้ายไฟล์ไปยังไดเรกทอรีเดียวกันโดยใช้ชื่ออื่น ให้เราแสดงตัวอย่างด้วยตัวอย่าง

ลองนึกภาพคุณมีไฟล์ชื่อ "file1" ในไดเร็กทอรี "document" คุณต้องการเปลี่ยนชื่อไฟล์นี้เป็น "file2" เรียกใช้คำสั่งต่อไปนี้ในเทอร์มินัลของคุณ

mv file1 file2

ไวยากรณ์ของคำสั่ง "mv" คือ

mv "ชื่อแฟ้มเก่า" "ชื่อไฟล์ใหม่"

บางตัวเลือกที่สามารถใช้ได้กับคำสั่ง "mv" คือ:

1. Verbose (-v)

mv -v "ชื่อไฟล์เก่า" "ชื่อไฟล์ใหม่"

นี่คือตัวเลือก verbose ที่จะแสดงสิ่งที่คำสั่งที่ได้ดำเนินการ

ตัวอย่างเอาท์พุท -

2. Interactive (-i)

mv -i "ชื่อไฟล์เก่า" "ชื่อไฟล์ใหม่"

ตัวเลือกนี้จะแจ้งให้คุณทราบก่อนทำการเปลี่ยนแปลงใด ๆ

คำสั่ง "rename"

คำสั่ง "rename" สามารถใช้เพื่อเปลี่ยนชื่อไฟล์ได้หลายไฟล์

ไวยากรณ์ของมันจะได้รับเป็น:

เปลี่ยนชื่อไฟล์ 's / old_name / new_name'
เปลี่ยนชื่อ - [options] 's / old_name / new_name' ไฟล์

สมมติว่าคุณต้องการเปลี่ยนไฟล์ ".jpg" ทั้งหมดเป็นไฟล์ ".jpeg" ที่คุณเรียกใช้คำสั่งต่อไปนี้

เปลี่ยนชื่อ 's / jpg / jpeg /' * .jpg

นี่คือสองคำสั่งพื้นฐานที่ใช้เพื่อเปลี่ยนชื่อไฟล์ใน linux คำสั่งเหล่านี้มาพร้อมกับตัวเลือกต่างๆ เมื่อคุณได้รับความรู้พื้นฐานแล้วคุณสามารถย้ายไปยังตัวเลือกที่ซับซ้อนได้

Was this reply helpful?

Related topics

  • โซลูชันเฉพาะของ Linux และ Windows
  • เซิร์ฟเวอร์โฮสติ้ง Linux แบบ Dedicated
  • วิธีการหาไฟล์โดยใช้ค้นหาและค้นหาคำสั่งบนลินุกซ์?
  • Linux Server Firewall Configuration
  • Best Linux Distro for Game Server
  • cVirtual Connect from Windows
  • sBlock - iSCSI Linux Guide
  • Deploy Psychz Dedicated Server Using Terraform Provider
  • How to setup a dedicated server for Ark: Survival Evolved
  • How To Remotely Connect To Windows Server?
  • คุณสมบัติที่เป็นประโยชน์สูงสุดของลินุกซ์มิ้นท์
  • วิทยาศาสตร์ Linux และคุณลักษณะของมัน
  • สูงสุดตำนานเกี่ยวกับการรักษาความปลอดภัยลินุกซ์
  • สิ่งที่วิทยาศาสตร์ลินุกซ์และคุณลักษณะของมัน
  • ในการเปรียบเทียบ: FreeBSD VS ลินุกซ์
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801