funk-shun
funk-shun

Reputation: 4421

Switch two file names?

Is there a way in unix to easily/automatically switch the filenames of two files?

Files:

want to switch the file2 to be named file1, and file1 to be named file2

Upvotes: 2

Views: 457

Answers (1)

Bala R
Bala R

Reputation: 108957

>mv file1 temp
>mv file2 file1
>mv temp file2

Upvotes: 1

Related Questions