Write a script that displays information about you and your machine using the following commands: whoami date, w, uname, uptime
#!/bin/bash
user=$(whoami)
date=$(date)
curUsr=$(w)
usrName=$(uname)
uptime=$(uptime)
echo "Your system Information:"
echo "User Name is : $user"
echo "User Name is : $date"
echo "Current user is : "
echo $(w)
echo "The user name is $usrName"
echo "The uptime is $uptime"
Write a script that displays information about you and your machine using the following commands: whoami...
Create any Linux (Ubuntu, Debian, Kali etc) Virtual Machine on your computer. A shell script is a sequence of shell commands written in an executable script file. Executing this file instructs the shell to execute all commands in the order of their appearance in the script file. There is several shell scripting tutorials available on the web, e.g. search by entering the keywords Linux shell script tutorials. Go through one of these tutorials and then write a shell script that...
Write a function named getComputerinfo that displays disk usage, memory usage, the uptime, currently logged users, and password information. (Hint, you can use free (free memory), df (free disk), uptime, w, and cat /etc/shadow) commands to complete your task
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...
Using Linux Create a custom banner that displays the following information when you log into your normal user’s shell (hint: edit ~/.bashrc): “Hello USER” – (make use of the USER environment variable to get the username) “Welome to HOSTNAME” (make use of the HOSTNAME environment variable) System uptime System’s private IP addresses (not full blown ifconfig output, but just a line for each interface that says “The IP address for ETHX is: XXX.XXX.XXX.XXX” – hint: use the grep and awk...
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...
Write a script using simple shell commands. The script takes a command line argument that specifies a directory dir. The script first changes directory to dir, then prints the following in sequence: (a) A line starting “Current date and time: ”. Then on the same line, the current time and date. (b) A line starting “Current directory is : ”. Then, on the same line, the absolute pathname of the current working directory. (c) An empty line (d) The line...
Programs/scripts 13. Write a bash shell script that displays the date by using the shell command date. 14. Write a command line program that takes a number and a command as arguments. Call that command that number of times. For example, if your program name is "test" test 3 dir <shows directory> dir <shows directory> dir <shows directory>
Write a BASH script commands that do the following: Print to screen/terminal content of PATH variable Add at the beginning of the PATH variable your home directory (not the directory named /home but the home directory of the user logged to the system) Print to screen/terminal content of PATH variable after you changed it
Need Linux Commands and instructions for the following:
6. Write a script to display numbers from 1 to n, where n is an integer provided by users (if not, default to 10). Hint: use "read" command to accept user input. a) Display the source code in an editor (#4-9) b) Execute your script in the terminal, and display the command and the result (#4-10)