Latest Updates: tips

  • When Did You Last Reboot Your Microsoft Windows 7 Machine? (Check Uptime)

    13:50 on June 5, 2010 | 0 Comments Tweet This! | Digg This!
    Tags: tips,

    Finding out when you last rebooted your Windows 7 machine can be completed using the “systeminfo” command.

    Open a Command Prompt by going to Start and opening “cmd”. You will then be presented with a command prompt window, where you need to type the systeminfo command below:

    C:\> systeminfo | find "System Boot Time"
    System Boot Time:          05/06/2010, 12:55:07

    You will then be shown the date and time the server was booted (as seen in the example above).

    You can just run “systeminfo” on it’s own (with no ‘| find “System Boot Time”‘), and you will be presented with a lot of other information such as Hotfixes, Network Connections, etc.

     
  • Installing the Telnet Client on Windows 2008 using a Command Prompt

    22:47 on June 2, 2010 | 0 Comments Tweet This! | Digg This!
    Tags: tips,

    Like Windows 7 and Windows Vista, the Telnet client isn’t installed by default.

    In Windows Server 2008, you can install it via the Server Manager GUI tool, but it is often quicker to install it via a command prompt/terminal.

    So, open a cmd.exe session and run the following:

    servermanagercmd -install telnet-client

    And that’s it – once the command has completed, telnet.exe will be available from a command prompt.

     
  • Using grep to Exclude Lines Containing Certain Characters/Text

    04:37 on January 10, 2010 | 0 Comments Tweet This! | Digg This!
    Tags: , , tips

    I like to watch Apache log files using tail -f but they often get filled up with data I don’t want/need to see – like, when I access the web site.

    grep is a great tool to search for certain information in text files – but it can also exclude certain pieces of information which can be equally as useful.

    So, for example, if I want to watch a log file using tail -f, but exclude any information relating to the IP address “192.168.1.101″ then we can use the grep -v switch:

    tail -f access.log | grep -v "192.168.1.101"

    What this will do is show everything, apart from a line with that IP address in.

    Of course, this works with any other command with text being piped into grep:

    cat file.txt | grep -v "heh"

    This would output the contents of file.txt but remove any lines with “heh” in them.

    You can find out more about the various grep options in it’s man page (man grep from the command line)