Answers for "bash list files with full file path"

1

bash list files with full file path

# Basic syntax:
ls -1 "$PWD/"search_pattern
# Where -1 (one) specifies printing one item per line, which is usually
#	preferable when you include the full path to the file

# Example usage:
# Say I have the following files in the current directory:
image_1.png
image_2.png
image_3.jpeg

# and the path to the current directory is given by:
/home/user

# If I wanted to list the png files with their full paths, I would run:
ls -1 "$PWD/"*.png
--> /home/user/image_1.png
	/home/user/image_2.png
Posted by: Guest on June-26-2021

Code answers related to "bash list files with full file path"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language