I wish to list only files along with the absolute path in a given directory on my AiX 6.1 system.
Below is the best I could do.
ls -p "/app/scripts"/*
This gives a a list of all filename along with folder names with absolute path non-recurrsive (without listing files in sub-directories)
I notice that each directory is listed with a colon ':' at the end which I wish to eleminate as shown below.
Can we grep for the listing with a colon at the end as I m not expecting my filenames to have a colon at the end ? if yes how can i do that. Below is how I tried to grep each entry ending with a colon in ksh shell but none of them worked.
echo "/app/scripts/myfolder:" | grep *:
echo "/app/scripts/myfolder:" | grep "*:"
echo "/app/scripts/myfolder:" | grep *':'
echo "/app/scripts/myfolder:" | grep *":"
This approach is pretty fast and hence I like it.
I tried find command but it is searching recurrsively inside sub-directories.
Can you please suggest ?