options 1 and 2 are correct. what is the problem? You are already inside the directory from where the command is invoked. In the first for loop file2.txt will not be found in dir1 and will be found in dir2. In the second for loop file2.txt is not a file inside dir1 but is a file inside dir2.