top of page

Linux - Commands Part 4 Remove , Move & Copy

  • Writer: Mukesh Chanderia
    Mukesh Chanderia
  • Feb 13, 2021
  • 1 min read

Remove File & Folder


root@localhost ~]# rm abc

rm: remove regular empty file ‘abc’? Yes


root@localhost ~]# rm Folder1

rm: cannot remove ‘Folder1’: Is a directory


use "-r" to remove directory


root@localhost ~]# rm -r Folder1

rm: remove directory ‘heyRam1’? Yes


To remove forcefully directory use "-f"

root@localhost ~]# rm -rf test/


use argument "v" to print


root@localhost ~]# rm -vr "mukesh monu"

rm: remove directory ‘mukesh monu’? y

removed directory: ‘mukesh monu’


To remove all data of particular folder

root@localhost ~]# rm -vrf /tmp *

removed ‘/tmp/yum.log’

removed ‘/tmp/.X11-unix/X0’

removed directory: ‘/tmp/.X11-unix’

removed directory: ‘/tmp/.XIM-unix’


root@localhost ~]# mkdir India

[root@localhost ~]# ls

India

[root@localhost ~]# rename India Udaipur India

[root@localhost ~]# ls

Udaipur


Create multiple empty files with single command


root@localhost ~]# touch abc{1..9}

[root@localhost ~]# ls

abc1 abc2 abc3 abc4 abc5 abc6 abc7 abc8 abc9


Copy File "file1" to folder Udaipur


[root@localhost ~]# cp file1.txt Udaipur/


Copy folder to folder requires "-r"


[root@localhost ~]# cp -r Folder1 Folder2


If files are already present in folder then it will ask if you want to overide


root@localhost ~]# cp -rvf abc* India/

cp: overwrite ‘India/abc1’? Y


Now to say "Not" to overwrite add argument"n" in commad

root@localhost ~]# cp -rvfn abc* India


Move Data


root@localhost ~]# mv abc1 India/

mv: overwrite ‘India/abc1’? Y



 
 
 

Recent Posts

See All
In-Band Management Configuration in ACI

High-Level Objective The goal is to enable  APICs, leaf switches, and spine switches  to: Use  in-band management IP addresses Carry management traffic  over the ACI fabric data plane Reach  external

 
 
 
Debounce Timer in Cisco ACI

Understanding Interface Flapping and the Debounce Timer in Cisco ACI Interface flapping on Cisco ACI leaf switches is one of the most commonly misunderstood issues in environments connected to WAN, DW

 
 
 

Comments


Follow me

© 2021 by Mukesh Chanderia
 

Call

T: 8505812333  

  • Twitter
  • LinkedIn
  • Facebook Clean
©Mukesh Chanderia
bottom of page