November 28th, 2010, 08:01 AM
Delete a file from different dir without using cd
i want to delete the name.txt file from a folder with name FOL.
But i do not want to use the first command , the cd .
*the -f is force remove
rm -f name.txt
i would like the above to be like this :
Any help please ..
rm -f name.txt from FOL folder
Thank you very much .
November 28th, 2010, 01:32 PM
November 30th, 2010, 07:10 AM
sorry but i cannot understand you answer.
for example, we assume that we have 2 folders with the name 1 and 2 .
The folder 2 is inside 1 .
Also, in folder 2 we have file with name "file.txt".
And we are in folder 1 .
How can we delete the file.txt in one command line ?
I mean without using the code below:
rm -f file.txt
November 30th, 2010, 09:21 AM
Like he said:
rm -f /path/to/file.txt
for example, if you have structure like:
assuming you're in folder a, you can type:
rm -f b/file.txt