GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

The file /usr/share/dict/words holds a list of English words…

The file /usr/share/dict/words holds a list of English words. We want to use egrep to display only those which match the following rules;  The word has tow or more quote symbol ‘ in it Each quote symbol is followed by one or more character The word should not start with a quote symbol ‘ In addition; we are working with Ubuntu Linux on the bash shell using GNU egrep tool Here are some examples of the words which will be matched; bo’s’n bo’s’n’s bo’s’ns Which of the following is the best solution?

Read Details

We want to use the ls command to list all the files from the…

We want to use the ls command to list all the files from the current working directory which names match the following pattern:  if the filename starts with a letter (lower or upper case) it is followed by 3 characters: a digit, an uppercase letter, and a lower case letter. Else it is followed by 5 characters: a digit, any character, an upper case letter, any character, and a lower case letter. Provide a single ls command that will list the above-described files in the current working directory.  

Read Details

Which two sections of the man pages are searched by the apro…

Which two sections of the man pages are searched by the apropos command?

Read Details

You already know what a palindrome is by now :)  We want to…

You already know what a palindrome is by now 🙂  We want to use egrep on one of the Linux dictionaries files, located at /usr/share/dict/american-english, in order to identify palindromes that are more than one letter-long and UP TO 5 letter-long (inclusive). 

Read Details

We have a plain-text file named persons-of-interest.txt. It…

We have a plain-text file named persons-of-interest.txt. It contains several fields, each separated from the next by a single space. Within each field, no space character is used. The first field is a first name, the 2nd a last name, and the 3rd an optional variable-length integer called the Jedi Extensive Directory Identifier (J.E.D.I.).  Another file, named mc.txt contains only two fields. The first one is a J.E.D.I. number, and the second a decimal number representing the midi-chlorian count of the corresponding individual.  Provide command lines allowing us to display only the last name and midi-chlorian count of any individual who has a J.E.D.I. number.   Provide another command line allowing us to display only the first and last name of anyone who does not have a J.E.D.I. number. 

Read Details

I want to count the words from one of the Linux dictionaries…

I want to count the words from one of the Linux dictionaries files, located at /usr/share/dict/american-english, that contain two successive vowels.

Read Details

This is the third time that I accidentally hit both the CONT…

This is the third time that I accidentally hit both the CONTROL and D keys on my keyboard and close my terminal. I want to make sure this does not happens anymore during my bash session. How do I do this? How would I go about making this change permanent for all my login bash shells? What if I wanted to make this change permanent only for my non-login bash shells?

Read Details

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)

Read Details

We are trying to figure out how we would store the name of a…

We are trying to figure out how we would store the name of a shell command in a variable named RUNME, then use this same variable to execute the command it holds in our Bash shell. For instance, we would store inside RUNME the date -R command, then use RUNME to get the shell to execute it later.The first part is easy, we simply do the following; export RUNME=”date -R” Select all of the solutions below which would allow us to execute the value held by RUNME

Read Details

Which shell command would you issue to display the limit of…

Which shell command would you issue to display the limit of disk space your system administrator allows you to use on a Linux system? Select all that apply.

Read Details

Posts pagination

Newer posts 1 … 43,770 43,771 43,772 43,773 43,774 … 85,222 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top