ftello - Linux


ftello is a simple command that returns the current position of the file pointer in a specified file. It’s primarily used to determine the offset of the next read/write operation.


ftello FILE
  • FILE: Path to the target file.




  • Get the current file pointer position:
ftello /path/to/file.txt
  • Check if a file is empty:
if [ $(ftello /path/to/file.txt) -eq 0 ]; then
  echo "File is empty"
  • Seek to a specific offset in a file:
fseek /path/to/file.txt 1024

Common Issues

  • Permission denied: Ensure you have read/write permissions for the specified file.
  • File not found: Verify that the file exists and is accessible.


  • ftello can be used with seek to manipulate the file pointer.
  • It’s commonly used in scripts for reading and manipulating files.

Related Commands

  • fstat: Get file status information
  • fseek: Seek to a specific offset in a file
  • stat: Get file status information