Details

Added by on 2013-03-15

This week we are checking out your viewership feedback tips.

Download HD Download MP4

I've gotten tons of feedback on recent HakTips and here are some of my favorite tips and tricks from you guys:

Robert says: I like to use, jobs -l and, kill -9 *PID number* to kill any stopped jobs.

Brian says: You can spice up your history with nifty time stamping :]

1) open terminal

2) type: sudo gedit /etc/bash.bashrc

3) Underneath shopt -s and or HISTSIZE Add the following line: export HISTTIMEFORMAT="%a %b %d - %r "

4) Save file in Gedit, then exit gedit.

5) Close your terminal, Then re open a new terminal window,

Type history :) Your history will now save and look like this:

1 †Sat Feb 16 - 07:19:04 PM ping google.com2 †Sat Feb 16 - 07:28:02 PM history

Nick says: I got tired of having to cd - ls cd /blah/blah/blah so I made an alias to change into my last directory made. type latest: alias latest="cd `ls -ltr | tail -n 1 | awk '{print $9}'`" be careful with your †" † ' † and ` †they are all different. This is so nice cause you just type latest... and it goes into your last directory you were working in!

Mr-Protocol wrote in with this tip: Know what device a disk is mapped to with lshw. It needs to be run as root or sudo to display accurate results.

lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).

Just running sudo lshw shows a lot of information but in a sort of messy layout. For my purpose I only needed to see storage devices so I can pick the correct one to manage.

This command gives a more manageable set of data.
sudo lshw -short

This displays a nice view of the hardware and system specs.

To take this even further, "sudo lshw -short | grep dev" will show an even shorter list of devices and a quick description.

Make sure to email me tips@hak5.org with your thoughts. And be sure to check out our sister show, Hak5 for more great stuff just like this. I'll be there, reminding you to trust your technolust.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

2 Comments

  • Oliver Kuster 2 months ago

    No need for jobs -l and writing pid to kill, just type kill %

    example:
    $sleep 30m &
    [1]
    $kill %1 #this kills the job 1…

  • Arold 2 months ago

    “lshw” is very nice. If you look at the man page you will notice that you can produce a html report with it. Just run this command :

    sudo lshw -html > hw.html

    Now, the html report is easier to read than looking at the output directly from the command line, but it is still not that friendly.

    If you want something more readable, install “hardinfo” (it is in most linux repositories). It is a GREAT tool to know everything about your machine. You can launch it as a GUI, but, in the command line, it can also produce a very clean html report. Just run this command :

    sudo hardinfo -r -f html > hw.html

    Thank for putting together all those nice bash tutorial!

    Regards.