Back
Close

Computing with Data

elgeish
33.4K views
Previous: Displaying Files Next: Wildcard Characters

Moving, Copying, and Removing Files and Directories

touch file1 /tmp/file1
mkdir ~/tmpFiles
# copy file1 in current dir to file2 in current dir
cp file1 file2
# copy file1 in /tmp to file2 in ~
cp /tmp/file1 ~/file2
# rename file1 as file2 in current dir
mv file1 file2
# move file1 in /tmp to file2 in ~
mv /tmp/file1 ~/file2
# remove file2 in home dir
rm ~/file2
# removes directory tmpFiles and all its contents
rm -R ~/tmpFiles
# same as above but avoids calling an aliased version of rm
\rm -R ~/tmpFiles
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants