too*_*oop -1 unix bash shell perl solaris
用目录结构说,例如:
toplev/
file2.txt
file5.txt
midlev/
test.txt
anotherdirec/
other.dat
myfile.txt
furtherdown/
morefiles.txt
otherdirec/
myfile4.txt
file7.txt
Run Code Online (Sandbox Code Playgroud)
你会如何从'anotherdirec'中删除所有文件(不是目录而不是递归)?在这个例子中,它将删除2个文件(other.dat,myfile.txt)
我在'midlev'目录中尝试了下面的命令,但是它给出了这个错误(find: bad option -maxdepth find: [-H | -L] path-list predicate-list):
find anotherdirec/ -type f -maxdepth 1
Run Code Online (Sandbox Code Playgroud)
我正在运行SunOS 5.10.
rm anotherdirec/*
Run Code Online (Sandbox Code Playgroud)
应该适合你.