You will create a shell script that prints out the following information about the system it is run on:
• The system’s name and IP address
• How much memory the system is currently using, and how much total memory it has
• The number of CPUs of the machine
• The number of unique users on the system at that moment
When your script is run, each of these values should be clearly labeled in the output, such as Number of active users: 10 Exactly how you choose to format the information you print is up to you, so long as it is easy to interpret and the labels for each value are clear. (Adding any additional visual touches, such as a title or horizontal dividers, is permitted.) Your script should not create any intermediate files when run, and should not add anything to or remove anything from the filesystem. You may wish to query 1 the information above using commands and then store the results in variables before printing them. Much of the information above can be found and formatted using commands already introduced in this course, especially related to handling rows and columns of information. You can use the help commands discussed in class, such as man -k or apropos to help you search for useful commands if you are not sure where to begin. Once you are satisfied your script is working, you submit the script, as well as a log of you running it on at least two different lab machines, whether physical lab machines or on tuxworld. Note that you can connect to different tuxworld machines from a lab environment or from a shell in tuxworld by running the command ssh tuxn where ”n” is a single integer, such as 6 or 8. If you have developed the script on your own machine, you can transfer it to tuxworld using the scp command for testing.
#/bin/bash
echo "System name is: "
hostname
echo
echo "Ip address is: "
hostname -I
echo
echo "Total memory usage and total available memory report: "
free -t
echo
echo "The number of CPUs of the machine : "
nproc
echo
echo "The number of unique users on the system at that moment :
"
echo
w

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)
You will create a shell script that prints out the following information about the system it...
You will create a shell script that prints out the following information about the system it is run on: • The system’s name and IP address • How much memory the system is currently using, and how much total memory it has • The number of CPUs of the machine • The number of unique users on the system at that moment When your script is run, each of these values should be clearly labeled in the output, such as...
I need this done ASAP. Please write a bash shell script that does the following: Prints out how many users are logged on. This can be accomplished using who and wc. Prints out a list of currently logged on users. This can be accomplished using who, grep, regular expressions, and echo. Prints out how many processes you have running from past days, and a list of those jobs. Use `whoami` to get your username. Run ps -ef and see how...
Write a script using the bash shell to add new users to the system. The script should read user information from a comma-delimited file (each field should be separated by a comma). The filename should be passed to the script as a command-line argument. Be sure the script contains a usage clause. The input file should contain the user information with one user per line. As the system administrator, you should determine the information necessary for each user to properly...
Write a shell script to solve the following business problem. Create a file called whoislogin.out that contains the output of the who command, then append to the whois.out file, the output of the date and finger commands. Your script should prompt to pick any users from the list of users currently logged onto the system. Use the variable concept to search for the specific user from those displayed on the screen coming from the who is.out file created. Show a...
You are currently running/debugging a shell script program in the foreground that seems to be in an infinite loop, to terminate/kill the shell script program. 7. (type/enter - control C to send a "program interrupt" ) or (contact the sysadmin person to kill your shell script program) 8. The UNIX/Linux exit command entered on the KORN shell command line will exit the shell session properly (best practice). [True / False] When killing a background process with the kill command you...
Part 1: Create a shell script that returns a full name associated with a userid specified in the command line argument. • Use the names found in /acct/common/CSCE215-Spring19. • Your shell script should be named “findName.sh” – Example usage: $ ./findName.sh seiei SETSUNA F SEIEI $ – Your shell script must either: Return the full name associated with the userid or Return an error message if the command line arguments are not equal to 1. or Return the message “Sorry...
Exercise 1: Write a shell script that loops through the /etc/passwd file one line at a time. Prepend each line with a line number followed by a colon and then a space. Example output: 1: root:x:0:0:root:/root:/bin/bash 2: daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin 3: bin:x:2:2:bin:/bin:/usr/sbin/nologin 4: sys:x:3:3:sys:/dev:/usr/sbin/nologin Exercise 2: Write a shell script that asks the user for the number of lines they would like to display from the /etc/passwd file and display those lines. Example output: How many lines of /etc/passwd would you like...
Create a shell program called "myprog" that prints "Hello" (use echo). Remember it must start with "Shebang" and the entire path to a bash shell. So you need at least 2 lines of codes, though use a blank line between the two. Give the program rights so you have all the rights, your group reading and driving rights, and everyone else just driving rights. Now run your shell program. How can you run the program? Why is just the name...
In this exercise, you will create a script called file_ops.sh that uses the various file operators The file_ops.sh script will Use one command line argument Use four IF THEN statement to compare the first command line argument Determine which file operators to use that produces the following output when the script run with the arguments shown WARNING: In the IF THEN statements, to avoid syntax error messages, there must be a space before and after each bracket and also between...