I would like to run the find
command and get some of the files/directories in the desktop directory using regex
option of the command with the symbol caret ^
As you know the caret ^
matches the beginning of a line, and I would like to get all the files/directories starting with the letter t
; I used the following command find . -regex "^./t"
, but as it turned out, it will only match the file/folder whose name is a simple t!
I know that the regex will match the whole path
and not only the file name
. But why all of these do not match since they start with ./t
.
./tcpdump.txt
./t.txt
./test.sh
./trade.txt
./torbrowser.desktop
./token.txt
PS: This regex worked for me, ^./t.*
, but still unable to understand the behavior of caret in the original command