How do i remove files from linux using command ?
Question
Share
Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To remove (or delete) a file or directory in Linux from the command line, use the
rm
(remove) commandExamples:-
1.To delete a single file
rm filename
2.To delete multiple files
rm filename1 filename2 filename3
rm *.pdf
Use the
-i
option to confirm each file before deleting itrm -i filename(s)
Use the -f
(force) optionrm -f filename(s)
3. To remove non-empty directories and all the files without being prompted use the
r
(recursive) and-f
optionsrm -rf dirname