Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

GATE | GATE-IT-2004 | Question 16

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Which of the following commands or sequences of commands will rename a file x to file y in a Unix system?

I. mv y, x

II. mv x, y

III. cp y, x (rm x)

IV. cp x, y (rm x)
(A) II and III
(B) II and IV
(C) l and III
(D) II only


Answer: (B)

Explanation: I. mv y, x                        //will move contents of file x to file y

II. mv x, y                      //will move contents of file y to file x

III. cp y, x (rm x)         //will copy  file x to file y (removal of x after the command)

IV. cp x, y (rm x)         //will move contents file y to file x (removal of x after the command)

 

Hence Answer B

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 03 Oct, 2019
Like Article
Save Article
Similar Reads