Skip to content

Instantly share code, notes, and snippets.

@anjijava16
Last active March 4, 2023 01:29
Show Gist options
  • Save anjijava16/6452a2fc15d81bc1b8ff12c738c99976 to your computer and use it in GitHub Desktop.
Save anjijava16/6452a2fc15d81bc1b8ff12c738c99976 to your computer and use it in GitHub Desktop.
# Create a File
seq 1 100000000 > my_file.txt
# Check File Size
welcome@welcomes-MacBook-Pro temp_data % ls -hl
total 2326664
-rw-r--r-- 1 welcome staff 1.1G Mar 3 20:27 my_file.txt
-rw-r--r-- 1 welcome staff 71B Mar 3 20:22 read_file.sh
welcome@welcomes-MacBook-Pro temp_data %
# Read a File
input=my_file.txt
while read -r line
do
echo "$line"
done < "$input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment