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
PBR Concepts

What is a Health Group? A Health Group  is a configuration object used to group specific PBR destination interfaces—typically the consumer and provider interfaces of the same service node (such as a f

 
 
 
Active/Standby F5 Across Different ACI Pods

Normal L3Out vs Floating L3Out Explained Understanding Cisco ACI Multi-Pod Architecture In a Cisco ACI Multi-Pod design: Each Pod has an independent IS-IS control plane Endpoint learning is maintained

 
 
 
Multi-site Traffic Flow

This article explains how traffic flows between Endpoint Groups (EPGs) across multiple sites in Cisco ACI using Nexus Dashboard Orchestrator (NDO). We will walk through three common design scenarios a

 
 
 

Comments


Follow me

© 2021 by Mukesh Chanderia
 

Call

T: 8505812333  

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