Accroding to chegg guidlines, 1 question with 4 parts. (Using linux terminal)I h
ID: 3702491 • Letter: A
Question
Accroding to chegg guidlines, 1 question with 4 parts. (Using linux terminal)I have provided my answer for each part, I need it checked and provided correct answer if needed. Thankyou.
1
a) Write the commands that will display your computer's current network interfaces
showing their current active ip addresses
ip addr
b) Write the commands that will display the name of all the current network interfaces,
in your computer, that are NOT currently connected
ifplugstatus
c) Run command to listen to your computer's ports, as learned in class, such as:
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 1315/mongod
tcp6 0 0 :::139 :::* LISTEN 1079/smbd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 714/avahi-daemon: r
udp6 0 0 :::48054 :::* 714/avahi-daemon: r
sudo netstat -plunt
d) Write the commands that will display lines with anything not a letter or number
in a text file
grep '[^a-zA-Z0-9] fileName
Explanation / Answer
NOTE: I have completed your assignment. Please check and let me know if you find any issues. I will revert back within 24 hours. thanks for your patience.
1)
Explanation:
a) ip addr command displays n/w addresses and their properties.
b) I think for the question ifconfig command is relevant because it tells about n/w interfaces, the state they are in and the assigned IP address.
c) Type ifconfig in your computer and you will see the difference.
2)
Explanation:
a) Yes. ifplugstatus command will tell you whether cable is plugged into network interface or not.
b) We can also use the ip command to get the information about n/w interfaces that are not connected.
ip link show | grep DOWN
c) In the above ip command lists all interfaces and their status. Further to filter down the devices not connected we are grepping for DOWN.
3)
Explanation:
a) Yes you are correct.
b)The below netstat command displays all TCP ports that are being listened and name of each listeners daemon and its PID.
netstat -plnt
4)
Explanation:
a) [^a-zA-Z0-9] is a regex pattern which will match lines not containing letter or digits
b) grep '[^a-zA-Z0-9]' will identify those lines which contains special characters other than letter or digits.
c) Below is the sample file i have tested along with command output snaphot.
Sample file checked:
Unix Terminal> cat testing.txt
saljfkas
asfaslkf
12313
*($&(!#(!*$
!@!(!#
1sdfas!#!#
Unix Terminal>
Command snapshot:
Unix Terminal> grep '[^a-zA-Z0-9]' testing.txt
*($&(!#(!*$
!@!(!#
1sdfas!#!#
Unix Terminal>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.