简体   繁体   中英

Can't drop a folder in Unix

I was trying to create some folders from a text file (arbo.txt which contains a list of directories) using:

xargs --verbose -d\n  mkdir -p < /applis/arbo.txt

I guess the -d\\n is not correct since I got other folders than those in arbo.txt file. The problem is that now I'm not able to drop these folders, I tried:

rm f
rm -rf f

There are no errors, but the folder is not dropped (I can see it using ls ), and when I try:

cd f

I get:

-ksh: cd: f: [No such file or directory]

Edit:

using ls I can see that the folder name is: f?.

How can I drop this folder?

Thanks

Try to use:

> xargs -n1 mkdir -p < dirs.txt

Otherwise, help out with some info on f :

> ls -l f
> file f

If what appears as f contains unprintable characters, using the file name expansion of the shell may save you the trouble to figure them out exactly. Be careful not to delete other important files that match the same name pattern!

rm -rf f*

In you command it add the ? to the folder name f. You can use the below to delete the file.

rm -rf f\?

UPDATE:-

rm -rf '<file name >'

The file name is,

All the contents in the arbo.txt file without any change.

Because your command creates only one folder with the name as all the contents in the arbo.txt file including the new line also. after that it add the ? to before each new line.

To get the folder name as easily, you can type starting name of the folder name and give tab. it give the full name of the folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM