Linux rm and rmdir command
Oftentimes, files or directories that are no longer needed need
to be removed. To remove files, use the rm command.
$ ls
shopping_list.txt to_do_list.txt
$ rm shopping_list.txt
$ ls
to_do_list.txt
Similar to mkdir and many other commands, list multiple files to be
removed by separating them with spaces.
The command rmdircan be used
to remove empty directories, but it will not work if the directory
still has something in it.
$ cd ../
$ ls
Desktop lists notes
$ mkdir empty_dir
$ ls
Desktop empty_dir lists notes
$ rmdir empty_dir
$ ls
Desktop lists notes
$ rmdir lists
rmdir: lists: Directory not empty
$ ls
Desktop lists notes
If you want to remove a directory and its contents, add the -r
flag to the rm command.
$ ls
Desktop lists notes
$ rm -r lists
$ ls
Desktop notes
Note: Before
using rm -r, or any other form of rm for that matter, be
sure that what is about to be deleted is no longer needed!
There is no undo, and no easy way to recover deleted files!
|
|
|
|
Get the Complete Details on
Linux System Management for Oracle DBAs
The landmark book
"Linux for the Oracle DBA: The
Definitive Reference"
provides comprehensive yet specific
knowledge on administering Oracle on Linux. A
must-have reference for every DBA running or planning to run
Oracle on a Linux platform.
Buy it
for 30% off directly from the publisher.
|
|
|
|
Burleson is the American Team
Note:
This Oracle
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
Oracle forum.
Verify
experience!
Anyone
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
publish
their Oracle
qualifications.
Errata?
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
feedback. Just
e-mail:
and include the URL for the page.
Copyright © 1996 - 2017
All rights reserved by
Burleson
Oracle ®
is the registered trademark of Oracle Corporation.
Remote Emergency Support provided by
Conversational
|
|