Answers for "how to open file in bash"

18

read file using shell script

#!/bin/bash
input="/path/to/txt/file"
while IFS= read -r line
do
  echo "$line"
done < "$input"
Posted by: Guest on February-22-2020
0

bash command to open file explorer

#The following works in all desktop environments by using the default file manager:

xdg-open .
#You can also open files from the terminal as if you had double clicked them in the file manager:

xdg-open file
Posted by: Guest on November-18-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language