Results 1 to 4 of 4

Thread: How to get date and time displayed for each command

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    2014-Jun
    Posts
    3

    How to get date and time displayed for each command

    I came across a video where a guy had the date and time for each command he entered displayed
    command line time and date.PNG
    does anyone know how to do this?

  2. #2
    By the looks of it, thats ZSH (rather than bash), with a custom theme.

    You would need to change your shell to zsh (and I would highly recommend 'oh my zsh' afterwards too - too http://ohmyz.sh/).
    Reasons for ZSH/OhMyZSH - http://www.slideshare.net/jaguardesi...shell-16194692

    This is a Kali-Linux support forum - not general IT/infosec help.

    Useful Commands: OS, Networking, Hardware, Wi-Fi
    Troubleshooting: Kali-Linux Installation, Repository, Wi-Fi Cards (Official Docs)
    Hardware: Recommended 802.11 Wireless Cards

    Documentation: http://docs.kali.org/ (Offline PDF version)
    Bugs Reporting & Tool Requests: https://bugs.kali.org/
    Kali Tool List, Versions & Man Pages: https://tools.kali.org/

  3. #3
    Join Date
    2014-Jun
    Posts
    3
    thanks i will have a look, i believe i have managed to do it just using bash though.

  4. #4
    Join Date
    2013-Jun
    Posts
    125
    This was how i did mine in bash

    root@ocalhost:~#leafpad .bashrc

    once leafpad is opened I browse to the condition
    if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi


    in this condition i commented out the line (this is the default primary prompt string) below
    # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

    this will ignore the line and leave it as a backup just in case you want to revert back. a new line was added just below the above line:

    PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h[\d \T]\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]#'

    logout of linux and then login..thats it ...open a terminal..you will see the primary prompt string as
    root@localhost[Wed Jun 18 11:50:09]:

Similar Threads

  1. Replies: 2
    Last Post: 2023-04-12, 02:23
  2. date date format in command history
    By Capitob in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2023-04-04, 23:53
  3. Problems With Wi-Fi and Date & Time
    By eddie@kali in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2021-05-10, 13:23
  4. Date Time change
    By AlacJ in forum General Archive
    Replies: 4
    Last Post: 2020-01-13, 18:53
  5. Date and time
    By martinii in forum ARM Archive
    Replies: 1
    Last Post: 2017-02-03, 20:38

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •