If you can see this check that

next section prev section up prev page next page

Removing Directories

Once you have several directories in use, you will need to maintain your hierarchy. This will involve removing directories as well as other activities. The rmdir command lets you remove directories. However Unix will not remove a directory that is not empty, so you must first move or remove any files or subdirectories within the directory you want to remove.

The rm command has a recursive option -r that will remove a directory, and any of its subdirectories and files. It should however be used with extreme caution, as it allows in a single command the ability to quickly remove all files you have access to! Many people believe that it is good practice to never use rm -r without also using -i (interactive). The command 'rm -ri' will ask you to confirm each file or directory which is going to be deleted before the deletion is carried out.


Centos 7 intro: Paths | BasicShell | Search
Linux tutorials: intro1 intro2 wildcard permission pipe vi essential admin net SELinux1 SELinux2 fwall DNS diag Apache1 Apache2 log Mail
Caine 10.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam |
Caine 13.0: Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Registry | Mock Exam |
CPD: Cygwin | Paths | Files and head/tail | Find and regex | Sort | Log Analysis
Kali: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7a | 8a | 8b | 9 | 10 |
Kali 2020-4: 1a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10 |
Useful: Quiz | Forums | Privacy Policy | Terms and Conditions

Linuxzoo created by Gordon Russell.
@ Copyright 2004-2024 Edinburgh Napier University