I have to answer this question as an exercise.
Sample input: No sample, just trying to select and filter files using Unix shell according to some conditions
Sample output: a list of files that their name is composed of 4 letters and which contain the string “user” in their content.
I tried to use the
basename ~/
command to get the file name of some files, then tried to combine it withwc
by doing, for example,basename /etc/ |wc -c
. Finally, I triedgrep user file_test.txt
on an arbitrary file to see if it contains the word "user".
I am trying to combine all the required commands to answer the question.
I am supposed to use substitutions which I am not used to.
Could someone please help me?