* at end of directory path

The * here is a "globbing character" and means "match 0 or more characters". To illustrate, consider this directory:

$ ls
dirA  dire  dirE  dirEa  dirEEE
$ echo dirE*
dirE dirEa dirEEE

As you can see above, the glob dirE* matches dirE, dirEa and dirEEE but not dirA or dire (*nix systems are case sensitive).

So, in your script, that means it will delete archives from any directory in dirA/dirB/dirC/dirD/ whose name begins with dirE.


I'll just add a note here for those that come to this Q&A for another reason.

If you see a * at the end of a filename in the output of ls (actually of ls -F, but ls is sometimes aliased to ls -F (or the ls-F builtin in tcsh), or of zsh or tcsh completions, that's something completely different.

With the -F option, ls adds a trailing character at the end of some special file name to help identify their specialness. zsh and tcsh do the same when listing file name completions.

If you see:

$ ls -F
dir/  fifo|  file  link@  ls*  socket=

Those /, |, * and = are not part of the file name (though they might be if someone tried to trick you), but are appended by ls to tell you that:

  • dir is a directory (/)
  • fifo is a named pipe/fifo (|)
  • link is a symbolic link (@)
  • ls is an executable regular file (*) (has at least one execution bit in its permissions)
  • socket is a Unix domain socket (=)

Some ls implementations (and zsh's completion) can also do that differentiation via colours for terminals that support them with different options.