In order to remove a file, you need to use the ls command to list the contents of the directory and find the filename you want to remove. For example, if yoy have a file or files in the /home/you/letters/ directory that you want to delete from the system. Type the following command to change the directory:
$ cd /home/you/lettersList the contents of the directory, run:
$ lsOR
$ ls -lOR
$ ls -l | lessTo delete all files, enter:
$ rm *OR
$ /bin/rm *To remove a directory, use the rmdir command, run:
$ cd /home/you
$ rmdir lettersTo remove a directory called /tmp/foo/ and all its files including subdirectories, use the rm command as follows:
$ rm -rf /tmp/foo/
No comments:
Post a Comment