• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

UNIX people needed!

Mashed Potato

Senior member
This is a question I have to answer. I have looked but I cant figure out how to awk a dir. Please help. If you don't want to answer it for me, could you direct me to where I could find the answer? Thank you....here it is:

cd to the /midterm directory. Using awk, generate an output that contains the file entry names and file type/permissions only of the file entries within the directory.

Separate the file entry names and file type/permissions columns by a colon 🙂).

The output should resemble the following:

filename : permissions

A) What awk command string did you use?

>awk '{print filename: permission}' midterm *filename: permission being the entry I do not know.

Midterm is a dir, could I ls -l saving the output to a file and then go from there? If so, what is the command to save the output to file. Can it be done with one string?
 
What they probably want you to do is pipe the output from ls -l and redirect the output from awk to a file. And if you google 'awk variables' you should be able to figure out what to replace "filename: permission" with.
 
Back
Top