|
Write a command that lists all files in your home directory and the directories beneath it that end with the three letters “txt”, and also contain the word “code” somewhere in the path.
Write a command that removes all of the files specified in question 11.
Assume that there is a file named myFile in your home directory. Write a command that prints the file to the monitor, but replaces all instances of the character “e” with the character “x”.
Write a command that creates a file named myFileTwo, full of the same contents as myFile with all instances of the three character string “src” replaced with the six character string “source”.
The command “find . –type d” produces a list of all the subdirectories of the current directory. Write a command that print this list to a file named subdirectoriesFile, and also prints the list to the monitor. Before the list is printed to the monitor, however, remove any lines that contain the string “mail”.
Write a regular expression that matches any word that starts with a capital letter and ends with a period (“.”). Remember that regular expressions will attempt to make the longest possible match, so make sure that the regular expression will not allow capitol letters or periods inside the expression, just on their respective ends.
Describe the behavior of the following sed script. Pay careful attention to the space characters in the fourth line. Note that the 2 in the first line is not a regular expression. It is a line number.
2 d
/the/ d
s/[0-9]/number/g
s/ +/ /g |
|