Linux & change username & computer name & .bashrc
Linux & change username & computer name
ubuntu change username and computer name
https://askubuntu.com/questions/817452/i-need-to-change-terminal-name
solution
https://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/
# backup
$ cp ~/.bashrc ~/.bashrc.bak
~/.bashrc
/home/xgqfrms
$ cd ~/.
$ pwd
$ cat .bashrc
$ sudo vim .bashrc
# i
# Esc :wq
OK
computer name
https://askubuntu.com/questions/9540/how-do-i-change-the-computer-name
$ pwd
$ ls -al
$ whoami
$ cd ~/
$ cat hostname
$ vim hostname
# i
# Esc :wq
# Esc :wq!
# Esc :wqa!
# Esc :qa!
change username
https://askubuntu.com/questions/34074/how-do-i-change-my-username
$
.bashrc & rename hostname & rename username
$ pwd
$ cd ~
$ pwd
$ cat .bashrc
$ vim .bashrc
# sudo vim .bashrc
# i
# ESC + :wq!
macOS
todo...
xgqfrms@mbp2019
macOS terminal change hostname
https://www.howtogeek.com/tips/how-to-change-your-computer-name-on-mac-os-x/
- sharing
sudo scutil --set HostName [NewHostNameHere]
OK
Linux $PS1
PS1 (Prompt String 1)
$ echo $PS1
https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
https://www.linuxnix.com/linuxunix-shell-ps1-prompt-explained-in-detail/
https://linuxconfig.org/bash-prompt-basics
Linux 如何一次切换到 home 目录
相对路径 & 绝对路径
cd ./ 代表当前目录
cd ../ 代表上级目录
cd ~ 当前用户的根目录
cd / 系统的根目录
$ cd ~
$ pwd
# /Users/xgqfrms-mbp
$ cd /
$ ls
# Applications Users cores home sbin var Library Volumes dev opt tmp System bin etc private usr
# etc, usr, home, Users
# 切换到 etc 并打开 hosts 文件
$ cd ../../etc
$ cd /etc && cat hosts
$ cd /etc && code hosts
$ cd /etc && sudo vim hosts
# :wq!
# php, nginx (created: 2020.08.08)
127.0.0.1 www.webfullstack.xyz
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
最新文章
- Maven命令行使用:mvn clean install(安装)
- 利用jemalloc优化mysql
- DLL库
- IIS性能相关的配置、命令
- maven 环境的配置 JAVA_HOME not found in your envirnment
- PHP 自制日历
- 重复点击主界面(TabBar)按钮刷新界面--点击状态栏回到顶部
- uploadify IO Error/http error 413
- xCode如何导入自定义的snippets文件
- [置顶] Android开发实战记录(三)---HelloWorld
- [bzoj2301: [HAOI2011]Problem b] 乞讨
- Net MVC微信扫码支付
- Extjs学习----------动态载入js文件(减轻浏览器的压力)
- [cocos2d-x] --- CCNode类详解
- php 运行的四种模式
- hdu4780 最小费用最大流
- python---初始sqlite3
- pairs 和 ipairs区别
- K:顺序表和链表的比较
- javascript 理解对象--- 定义多个属性和读取属性的特性
热门文章
- vue.esm.js?efeb:628 [Vue warn]: Invalid prop: type check failed for prop ";defaultActive";. Expected String with value ";0";, got Number with value 0.
- CobalStrike 4.0 生成后门几种方式 及 主机上线后基础操作
- 排查golang的性能问题 go pprof 实践
- CSS3 Flex Box 弹性盒子、弹性布局
- Spark 将DataFrame所有的列类型改为double
- 提高 Kafka 吞吐量
- 将将List json 转成List<;?>;实体
- CentOS7.X安装英伟达显卡采坑之路
- Codeforces Round #626 Div2 D,E
- P1073 最优贸易(最短路)