You can use the du command to view file size. du stands for disk usage. If you want to see how many bytes are in a file, you can run the du command with the -b option:
elliot@ubuntu-linux:~$ du -b facts.txt
210 facts.txt
The facts.txt file has 210 bytes. One character is equal to one byte in size, so now you know that the facts.txt file has exactly 210 characters.
You can also use the -h option, which will print the file size in a human-readable format. For example, to view the size of the dir1 directory and its contents, you can run:
elliot@ubuntu-linux:~$ du -h dir1
4.0K dir1/cities
16K dir1/directory2
24K dir1