How do I rename a file in UNIX?
The mv is a Unix command that renames one or more files or directories. The original filename or directory name is no longer accessible. Write permission is required on all directories and files being modified.
mv Syntax
You need to use the mv command to rename a file as follows:
mv old-file-name new-file-name
Examples
Open the terminal (bash shell prompt) and type the following command to list file names:
ls ls -l
In this example, rename a file called data.txt to letters.txt, enter:
mv data.txt letters.txt ls -l letters.txt
File is renamed so the following command will display an error on screen:
ls -l data.txtOutputs:
ls: cannot access data.txt: No such file or directory
Suggested Readings:
Type the following command to read mv command man page:
man mv
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 2 comments… read them below or add one }
Hi,
How can i read a multiples files from MF/Cobol, whose inside programs is assigned to read “file1″.
i am getting: 201108251343file1
201108251430file1
201108251740file1
Is there an routine to added the 3 files into one file1.
Many Thanks.
cat 201108251343file1 201108251430file1 201108251740file1>file1