Results 1 to 4 of 4

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

  1. #1
    Join Date

    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
    Reasons for ZSH/OhMyZSH -

    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: (Offline PDF version)
    Bugs Reporting & Tool Requests:
    Kali Tool List, Versions & Man Pages:

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

  4. #4
    Join Date
    This was how i did mine in bash

    [email protected]:~#leafpad .bashrc

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

    in this condition i commented out the line (this is the default primary prompt string) below
    # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\[email protected]\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;\[email protected]\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\[email protected]\h[\d \T]\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]#'

    logout of linux and then login..thats it a will see the primary prompt string as
    [email protected][Wed Jun 18 11:50:09]:

Similar Threads

  1. Date and time
    By martinii in forum ARM Archive
    Replies: 1
    Last Post: 2017-02-03, 20:38
  2. kali-weekly not up-to-date
    By Sherminator in forum General Archive
    Replies: 2
    Last Post: 2017-01-11, 12:34
  3. Date --set command not working
    By x-corpion in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2016-05-30, 02:52

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