Created
May 16, 2013 15:54
-
-
Save seanbuscay/5592786 to your computer and use it in GitHub Desktop.
Shell commands to remove Files
#shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm command syntax | |
rm (short for remove) is a Unix / Linux command which is used to delete files from a filesystem. Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). The syntax is as follows: | |
rm -f -r {file-name} | |
Where, | |
-f: Forcefully remove file | |
-r: Remove the contents of directories recursively | |
Remove or Delete a File | |
To remove a file called abc.txt type the following command: | |
$ rm abc.txt | |
To remove all files & subdirectories from a directory (MS-DOS deltree like command), enter: | |
$ rm -rf mydir | |
To remove empty directory use rmdir and not rm command: | |
$ rmdir mydirectory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment