You have to create your own function and put it in a file which is sourced whenever a user logins or opens a new shell session. It depends on the system you're running on (e.g. /etc/bashrc, /etc/profile, etc).
Code:
function cd() {
builtin cd "$@" && test "$PWD" == "/home/$USER/someApp" && echo ALERT\!\!\! && echo Please don\'t delete any files in the folder...
}
Edit: I was wondering about the possibility a user changes directly to a directory that is some levels down /home/user/someApp. In that case the message is not displayed unless you change the function to match $PWD against a regular expression. The following is valid for Bash version 3 only (version 2 does not have the =~ operator). For older versions you have to change the code using grep:
Code:
function cd() {
builtin cd "$@"
if [[ "$PWD" =~ "^$HOME/someApp" ]]
then
echo ALERT\!\!\!
echo Please don\'t delete any files in the folder...
fi
}
For bash version 2, change the if statement to
Code:
if echo "$PWD" | grep -q $HOME/someApp