Suppose I have a large number of files in a directory with .txt
extension.
How can I change the extension of all these files to .c
using the following command line environments:
- Powershell in Windows
- cmd/DOS in Windows
- The terminal in bash
Suppose I have a large number of files in a directory with .txt
extension.
How can I change the extension of all these files to .c
using the following command line environments:
On Windows, go to the desired directory, and type:
In PowerShell, it is better to use the
Path.ChangeExtension
method instead of-replace
(thanks to Ohad Schneider for the remark):For Linux (Bash):