Whenever I try cd folder_name/
in bash on any directory it gives this error:
-bash: cd: folder_name/: Permission denied
Execution permissions are given to all folders so that doesn't seem to be the problem. E.g. running stat on Desktop/
outputs:
File: 'Desktop/'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 807h/2055d Inode: 13107232 Links: 2
Access: (0755/drwxr-xr-x) Uid: ( 1000/caffeine) Gid: ( 1000/caffeine)
Access: 2017-12-07 14:39:42.715820915 +0500
Modify: 2017-12-06 01:16:13.985722935 +0500
Change: 2017-12-06 01:16:13.985722935 +0500
Birth: -
Some other possibly relevant information:
- I can read or write files in any directory without any issue.
mkdir
executes normally but I can'tcd
into the new folder.rmdir
executes normally.- I can open a terminal in a particular folder by navigating to that folder and opening a terminal from it.
So can anyone tell what the problem can be?
Thanks in advance.
EDIT:
type -a cd
shows the following output:
cd is a function
cd ()
{
echo "-bash: cd: $1: Permission denied"
}
cd is a shell builtin
type -a cd
to your post, please.unset cd
and things should work. Next, rungrep 'Permission denied' ~/.bashrc ~/.bash_profile ~/.profile
and report what you find.cd function
is set else it will repeat