encouraging a tendency to alternately pound y and the return key to affirm removes - until just past the one file they needed to keep. Users have even been seen going as far as "yes | rm files", which automatically inserts "y" for each file. A compromise that allows users to confirm just once, encourages proper wildcarding, and makes verification of the list easier can be achieved with something like: if [ -n "$PS1" ] ; then rm () { ls -FCsd "$@" echo 'remove[ny]? ' | tr -d '\012' ; read if [ "_$REPLY" = "_y" ]; then /bin/rm -rf "$@" else echo '(cancelled)' fi } fi It is important to note that this function should not be made into a shell script, which would run a risk of it being found ahead of the system rm in the search path, nor should it be allowed in non-interactive shells where it could break batch jobs. Enclosing the definition in the if [ -n "$PS1" ] ; then .... ; fi construct protects against the latter. There exist third-party alternatives which prevent accidental deletion of important files, such as "safe-rm" or "trash". Maximum command line argument limitation GNU Core Utilities implementation used in multiple Linux distributions will be limited in command line arguments bytes number of pages that are allocated within the kernel for command-line arguments before kernel 2.6.23 Released on 9 October 2007 were defined at kernel compile time at variable MAX_ARG_PAGES in include/linux/binfmts.h file but new kernels limits the maximum argument length to 25% of the maximum stack limit (ulimit -s). Error: /bin/rm: Argument list too long. will prompt if command-line argument limit is exceed See also srm (Unix): secure remove file in Unix unlink(): the underlying system call called by this user space program for its main functionality del (command) deltree dsw (command) - an obsolete Unix command for deleting difficult files References Further reading External links File deletion Standard Unix programs Unix SUS2008 utilities Plan 9 commands Inferno (operating system) commands IBM i Qshell commands