27 Nisan 2024 09:31

Anasayfa

undefined...

Linux terminalde her komutta tarih ve saati göstermek için .bashrc dosyasında ufak bir değişiklik yeterli.

 

Örnekler:

PS1="@\u \W \[\033[1;33m\]\T\n\\$\[$(tput sgr0)\]"

PS1="\e[1;31m\u@\h \e[1;97m$(date +'%d-%m-%Y %H:%M:%S') \e[1;93m\W : "
PS1="\e[1;31m\u@ \e[1;97m$(date +'%d-%m-%Y %H:%M:%S') \e[1;93m\W : "
PS1="\e[1;31m\u@\h \e[1;90m\W \e[1;97m\e[5m $(date +'%d-%m-%Y %H:%M:%S') \e[25m"
 

 

nano ~/.bashrc
 

NOT: Öncelikle aşağıdaki kodları yorum satırına çeviriyoruz.

#if [ "$color_prompt" = yes ]; then
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W \[\033[00m\]\$ '
#else
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ '
#fi
 

 

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:$(date +"%Y-%m-%d %H:%M:%S") \[\033[01;34m\]\W \[\033[00m\]\$ '
source ~/.bashrc
 

Yazı Listesi

Linux

hakkında diğer konular

Makdos Bilişim Teknolojileri 2015 - 2022