DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
eb.txt
~/calebfinal.txt

$ mv -i *
/home/username/ne
w/

Moves all files and directories in
the current folder to a directory
called new

rm


To delete a file or directory, you use the rm command. If
the item you are deleting is a file or an empty directory,
you just need to supply the name and press Enter. On the
other hand, if you try to delete a directory that has files
in it, rm tells you that the directory is not empty. In that
case, you can use the -rf flag to force the deletion. You
can use the rm command as follows:


$ rm
test.txt

Deletes the file test.txt in the current working
directory

$ rm -rf
test

Forces the deletion of the folder test and
everything in it

touch


The touch command is used to create a file and/or
change the timestamps on a file’s access without opening
it. This command is often used when a developer wants
to create a file but doesn’t want to put any content in it.
You can use the touch command as follows:


$ touch
emptyfile.txt

Creates an empty file named
emptyfile.txt

$ touch
file{1..20}.txt

Bulk creates files from file1.txt to
file20.txt
Free download pdf