I have this project Using Linux OS I need help wirh this Lab assignment : which
ID: 3878836 • Letter: I
Question
I have this project Using Linux OS
I need help wirh this Lab assignment :
which Linux command to use for each task?
Discover the following information about the Course Server’s network connection:
Number of network devices
Name of each network device
IP address (xxx.xxx.xxx.xxx) assigned to each network device (if present)
IPv6 address (xxxx::xxxx:xx:xxxx:xxxx/64) assigned to each network device (if present)
MAC (hardware) address (xx:xx:xx:xx:x:xx) assigned to each network device
Broadcast address (xxx.xxx.xxx.xxx) assigned to each network device (if present)
Subnet Mask (xxx.xxx.xxx.xxx) assigned to each network device (if present)
In your home directory, perform the following steps
Create a folder named lab2
In the lab2 folder
Create an empty file named myPets (do NOT use a text editor)
Store the text Dog: Morris in the myPets file (do NOT open the file)
Display the contents of the myPets file (do NOT open the file)
Using the sed command, change Dog to Cat in the myPets file (do NOT open the file)
Display the contents of the myPets file (do NOT open the file)
For each month of the year, count how many files in the /bin directory have a timestamp for that month
Note 1: Perform the counts for all the months using a single command.
Note 2: The length of a month name in a timestamp is exactly three (3) letters.
Note 3: Linux is case-sensitive (Jan is not equal to jan).
Note 4: The output of the command should match the following format exactly:
Jan: x
Feb: x
Mar: x
Thanks.
Explanation / Answer
ip link show —>Number of network devices
ip link show —> Name of network devices
ip -6 addr —> IPv6 address check
dmesg | grep eth0 —> MAC address
Ifconfig —> Broadcast IP
Ifconfig —> subnet
mkdir lab2 —> Make Lab2 Directory
touch lab2/myPets —> make a empty myPets file in lab2 folder
echo "Dog:Morris" > lab2/myPets —>Store the text Dog: Morris in the myPets file
cat lab2/myPets —>Display the contents of the myPets file
sed -i -e 's/Dog/Cat/' lab2/myPets —> Using the sed command, change Dog to Cat in the myPets file
cat lab2/myPets —>Display the contents of the myPets file
ll -sort | awk '{if ($8 == "2018”) print $6;}' | uniq -c | awk '{print $2":",$1}’ —>count how many files in the /bin directory