Category Archives: Command Line FU

Command Line FU Tips and Tricks

Cscope search results are invisible

Part of my ‘day job’ is trolling thru source code when looking for answers. My preferred mechanism, other than a recursive grep, is to use cscope Cscope is a useful tool for searching a source code tree after you build … Continue reading

Posted in Command Line FU, Linux | Leave a comment

Display ethernet devices on a Fedora system using the Linux Pseudo Filesystem and create a static IP Address

Encountered a fun riddle recently whereby on a Fedora 34 system I needed to locate all ethernet interfaces on a system that are obtaining a DHCP address, then after the first reboot create a static IP address. I am a … Continue reading

Posted in Command Line FU, Linux, Networking | Tagged , , | Leave a comment

Downloading an RPM package including all of its dependencies on Fedora

There are times when you need to fully download an RPM and all of its dependencies. However, If you have already downloaded the RPM re-downloading the RPM and all its dependencies can be very difficult. I have found the following … Continue reading

Posted in Command Line FU, Linux | Tagged , , , , | Leave a comment

Remove any potential special characters or spaces from an IP address using AWK

Got stuck earlier in an interesting regex mystery and I command-line FU’d an AWK Solution. PROBLEM I want to strip out all spaces and/or special characters from an IP address PROCESS I know how to validate an IP address no … Continue reading

Posted in Command Line FU, Linux | Tagged , , , , , | Leave a comment

Using AWK to print N lines up until the FIRST MATCH of a string and then exit

Often you are looking for a keyword within a log file but you need to print out X lines BEFORE the first match of a string, THEN exit the search. There are many ways to skin a cat, and here … Continue reading

Posted in Command Line FU | Leave a comment

Telnet to a port on a remote machine without ncat or telnet, or nmap

There are situations where you may be working on Linux based system, and telnet, ncat or nmap does not exist. In Linux, you can route a test thru the protocol, destination IP address, and destination  port using the “/dev” linux … Continue reading

Posted in Command Line FU, Networking | Tagged , , , , | Leave a comment

sed print only line AFTER string match

File Example

Posted in Command Line FU | Tagged , , | Leave a comment

Remove Leading and Trailing Whitespace using gsub in AWK

Posted in Command Line FU | Tagged | Leave a comment

Cut all characters after last match using SED

Output

Posted in Command Line FU | Tagged , , | Leave a comment

Increment a variable name within a BASH loop

Example

Posted in Command Line FU | Tagged , , | Leave a comment