History optimization and CD automatically display directory names during new directory

https://blog.51cto.com/amunlinux/2426478
The previous article described the deployment of nginx+vsftpd download and upload services

This chapter will write about history optimization and cd The directory name is automatically displayed when you go to a new directory
cat /etc/profile

export USER_IP=who -u am i 2>/dev/null| awk'{print $NF}'| sed -e's/[()]//g'
export HISTTIMEFORMAT=”[%F %T][whoami][${USER_IP}] “

alias cd=’cdp(){ cd $1;pwd;};cdp’

These are the main parameters, and other parameters can be added by themselves, such as how many history records can be saved Add it.

Demonstration:
history optimization and automatic display of directory name when cd to a new directory

Welcome to join my WeChat group
https://blog.51cto.com/amunlinux/2426485
history optimization and automatic display directory when cd to a new directory First name

Leave a Comment

Your email address will not be published.