We want to use egrep to match lines of a text file named numbers.txt that contain at least 1 number between 0 and 255. Examples of numbers that would be matched: 255, 254, 123, 98, 5, 0. As an additional constraint, such a number cannot be headed by zeroes. Examples of numbers that would not be matched: 2134, 256, 092, 05, 005 and 000. Provide the command line to do so.
Blog
I certify that I understand that, as a 3 credit offering, th…
I certify that I understand that, as a 3 credit offering, this course will require me to work every single week of the semester for at least 12 hours during spring or fall semesters 20 hours during summer semesters I also certify that I understand that these hours will have to be split into several work sessions, spread over the entire week.
We want to issue a single Bash shell command which will exec…
We want to issue a single Bash shell command which will execute a program named myprog and perform the following redirections; – STDOUT will be redirected to a file named results_only – STDERR will be redirected to a file named errors_only If the file already exists, we simply overwrite it; our shell is not set to prevent this. Select all, if any, of the following shell commands which would fit the bill?
A friend asked me to help them out on the UNIX system they a…
A friend asked me to help them out on the UNIX system they are remotely connected to. Problem is, I’m not even sure this is a Linux system! What shell command would I issue to display the name of the operating system?Select all that apply.
We want to create a folder name /home/tux/EDU/CIS4930/case_s…
We want to create a folder name /home/tux/EDU/CIS4930/case_studies/ using a single command line and regardless of what our current working directory is. If, for some reason, the creation of the folder did not work, we want to display a message saying “Sorry, something went kablemo.”. On the other hand, if the creation of the folder went well, we want to cd into it. All this as part of the one command line.
We want to use the ls command, with appropriate options, in…
We want to use the ls command, with appropriate options, in order to list extended information about the files in our current working directory that match the following patterns: One or more zeros: e.g., 0 or 000 or 00000 or 000000 One or more ones: e.g., 1 or 11 or 1111 or 111111 Exactly 4 ones followed by 4 zeroes: i.e., 11110000 but we do not want to match any file like 0110010 or 10100 that feature another alternance of binary digits.
I just logged remotely to a Linux server on which I want to…
I just logged remotely to a Linux server on which I want to run a program named /home/tux/bin/sat_brute_force that will do some computations for a very long time. Since I share access to that Linux server with other users, I want to run the program as follows: It must run in the background It must use the lowest priority that I can set It must keep running in the background after I logout of the remote server Its output must be preserved in a file Provide the command line that you would use to start this program.
Which of the following meta-characters uses would not be esc…
Which of the following meta-characters uses would not be escaped when found within double quotes?
In the folder /var/log we have log files from various servic…
In the folder /var/log we have log files from various services running on our Ubuntu machine. Here is an example of the log files generated by one of these services: ubuntu-advantage.log ubuntu-advantage.log.1 ubuntu-advantage.log.2.gz ubuntu-advantage.log.3.gz ubuntu-advantage.log.4.gz ubuntu-advantage.log.5.gz ubuntu-advantage.log.6.gz ubuntu-advantage.log.7.gz ubuntu-advantage.log.8.gz ubuntu-advantage.log.9.gz ubuntu-advantage.log.10.gz ubuntu-advantage.log.11.gz ubuntu-advantage.log.12.gz The convention for these file names is as follows: The name of the log file (ubuntu-advantage in our example) is suffixed by .log. Regularly, the log file is emptied and its contents saved in a backup file named ubuntu-advantage.log.1, then ubuntu-advantage.log.2 and so on so forth. Every so often, some of these backup files will be compressed, thus earning an additional suffix .gz. Write a script that will accept the name of a service as first argument, e.g., “ubuntu-advantage”, and copy in a target folder of our choice that is specified as 2nd argument, all the log files for that service (compressed or not). You must match exactly the above-described syntax in order to avoid copying files that do not follow the syntax exactly such as ubuntu-advantage.log.10-My-backup.tgz. (1.5pts) You will display an appropriate error message if: The number of arguments passed to the script is different than 2 (.5pt) The primary log file for the service name does not exist (e.g., ubuntu-advantage.log) (.5pt) The target specified as 2nd argument to the script is not a folder or does not exist already (.5pt)
Texts Questions
Texts Questions