- Feb 3, 2005
- 213
- 0
- 0
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?
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?