Read Text File on Linux

written by bakoppan

I am new to creating analysis and was interested reading a text file on a linux box. I’ve seen some postings for reading files on a windows server, but haven’t located anything for linux. Is this possible? I would like the entire contents of the file to be read on the console. It only contains a few lines.

written by gearoid

Depends on exactly what you are trying to do but the relevance should be the same or similar to windows.

For example to return the lines of a Linux file /tmp/myfile the relevance you put the analysis is:

lines of file “/tmp/myfile”

written by jgstew

You can even go a step further and do the following:

lines of files “myfile.txt” of (folders “temp” of it;folders “tmp” of it) of root folder of drive of system folder

This relevance will read the lines of “C:\temp\myfile.txt” on windows and “/tmp/myfile.txt” on linux/unix/osx, making it cross platform.

You could also do it this way:

lines of files “myfile.txt” of (folders “temp” of windows folder;folders “tmp” of root folder of drive of system folder)