How To: List PCI Information From The Terminal (lspci)

PCI devices are the ones in the add-on slots in your computer. They’re typically internal devices, though you can get USB powered external devices with PCI-e slots, they kind of defeat the purpose. For this article, we’ll be using lscpi.

[code]sudo apt install pciutils[/code]

The PCI ID Repository and may actually not be accurate. Yup. You could get inaccurate results from this command, but we throw it around daily as though it’s infallible. And now you know…

[code]lspci[/code]

[code]lspci -v[/code]

[code]lspci -t[/code]

However you can easily put the two of those together and simply get a great verbose tree output with:

[code]lspci -vt[/code]

NOTE: Older versions required -vvv for verbose and -tree were needed to perform those operations. The current versions simply use the -v and -t switches. 

How To: List CPU Information From The Terminal (lscpu)

lscpu‘ and it does what you’d expect – ‘list CPU information’. It is defined as thus in the manual:

[code]lscpu[/code]

[code]Architecture: x86_64[/code]

NOTE: Pretty much all modern computer hardware supports the 64 bit instruction set, but there are still some 32 bit machines out there and being used.

 




How To: List Hardware From The Terminal (lshw)

lshw‘. The manual helpfully defines it as:

[code]sudo lshw[/code]

[code]sudo lshw -C cpu[/code]

You may even be asked to use grep with it, such as:

[code]sudo lshw | grep wireless[/code]

[code]sudo lshw -short[/code]

[code]/1 wlxe4beed0e5f5c network Wireless interface[/code]

Now, if you want to refine it even further, why not try this:

[code]sudo lshw -short | grep network[/code]

[code]man lshw[/code]

or

[code]info lshw[/code]

How To: Time a Command

Have you ever wanted to know how long it takes to complete a command that you entered in the Linux terminal? Well, wonder no more!

[code]ls -la[/code]

time‘ command before it. Time is simply described in the man page as:

[code]time ls -la[/code]

Note how it tells you the time beneath the results and, if you want to try something bigger, you can take a look at this command:

The output at the end is something like this:

real 0m0.566s
user 0m0.423s
sys 0m0.143s

How To: Make Ubuntu Show Asterisks When Typing Password

shoulder-surfing won’t be able to see the number of characters in your password. This is how to get some feedback when you enter your password in the terminal.

[code]sudo nano /etc/sudoers[/code]

Enter your password and hit enter, of course. (This will be the last time you enter your password in the terminal without some sort of visual feedback!)

Now it gets a little tricky. 

Use the down arrow until your at the start of the line that says:

[code]Defaults            mail_badpass[/code]

Press the ENTER button. This should move that line down and leave a blank line above it. Use the arrow button to move up to that blank line and enter:

[code]Defaults[/code]

Then press the TAB button on your keyboard. This will move the cursor to the right location. Add this text:

[code]pwfeedback[/code]

The entire line should look something like:

[code]Defaults            pwfeedback[/code]

Press CTRL + X, then Y, and then ENTER.

[code]sudo apt update[/code]

asterisk feedback in the terminal

See? Asterisks for feedback in the terminal.