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/

  1. sharing

  1. 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 发布文章使用:只允许注册用户才可以访问!


Linux & change username & computer name & .bashrc的更多相关文章

  1. change username on ubuntu.

    Below tutorial will show you how to change username in ubuntu 12.04 precise.First,we need login as r ...

  2. Linux 启动时profile、bashrc、~/.bash_profile、~/.bashrc、~/.bash_profile执行顺序以及文件说明

    Linux 启动时profile.bashrc.~/.bash_profile.~/.bashrc.~/.bash_profile执行顺序以及文件说明 一.执行顺序 登录linux时,/etc/pro ...

  3. linux下/etc/profile /etc/bashrc /root/.bashrc /root/.bash_profile这四个配置文件的加载顺序

    目录 一.关于linux配置文件 二.验证四个配置文件的加载顺序 三.结论 一.关于linux配置文件 1.linux下主要有四个配置文件:/etc/profile ./etc/bashrc ./ro ...

  4. linux /etc/profile和/etc/bashrc

    /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行,并从/etc/profile.d目录的配置文件中搜集shell的设置,/etc/bashrc:为每一个运 ...

  5. change Username for SVN(Subclipse) in Eclipse

    Subclipse does not own the information about users and passwords (credentials), so there is no way f ...

  6. Linux下配置环境变量—— .bashrc 和 /etc/profile

    转载:https://blog.csdn.net/sun8112133/article/details/79901527 首先简单说一下什么是环境变量?环境变量简单的说就是当前环境下的参数或者变量.如 ...

  7. Linux Change The I/O Scheduler For A Hard Disk

    ow do I change the I/O scheduler for a particular hard disk without rebooting my Linux server system ...

  8. 数据仓库002 - 复习Linux shell命令 - echo bash_profile bashrc which命令的理解 alias history

    1.echo 打印 . echo 的作用是在屏幕上打印输出内容,与文件和持久化可以理解为没有丝毫关联.如:在屏幕上打印“ echo 的作用是打印文字! ” 实例1:输出系统的环境变量名称 $PATH ...

  9. Linux的环境变量.bash_profile .bashrc profile文件

    Shell变量有局部变量.环境变量之分.局部变量就是指在某个Shell中生效的变量,只在此次登录中有效.环境变量通常又称“全局变量”,虽然在Shell中变量默认就是全局的,但是为了让子Shall继承当 ...

随机推荐

  1. Spark底层原理详细解析(深度好文,建议收藏)

    Spark简介 Apache Spark是用于大规模数据处理的统一分析引擎,基于内存计算,提高了在大数据环境下数据处理的实时性,同时保证了高容错性和高可伸缩性,允许用户将Spark部署在大量硬件之上, ...

  2. 微博CacheService架构浅析 对底层协议进行适配

    https://mp.weixin.qq.com/s/wPR0j2bmHBF6z0ZjTlz_4A 麦俊生 InfoQ 2014-04-21 微博作为国内最大的社交媒体网站之一,每天承载着亿万用户的服 ...

  3. 从零开始学Java (一)环境配置

    1.下载jdk Oracle官网 2.配置环境变量 JAVA_HOME:指明JDK安装路径,如C:\Program Files\Java\jdk1.7.0Path:变量中添加 %JAVA_HOME%\ ...

  4. 代理模式详解:静态代理+JDK/CGLIB 动态代理实战

    1. 代理模式 代理模式是一种比较好的理解的设计模式.简单来说就是 我们使用代理对象来代替对真实对象(real object)的访问,这样就可以在不修改原目标对象的前提下,提供额外的功能操作,扩展目标 ...

  5. CF1209A

    所谓染色,并使同颜色数都能被当前颜色中最小的数整除 也就是说,把能被某个数整除的所有数放在一起为一组,问共有几组 开始我想写个并查集但是很懒,看数据范围小的可怜,那我们写个暴力看看 因为每组的共因数都 ...

  6. python ---strip()方法,split()方法,删除字符串开头或结尾,字符串分隔

    本文介绍了strip()方法,split()方法, 字典的按键值访问的方法, 1.Python strip() 方法用于移除字符串头尾指定的字符(默认为空格)或字符序列. 注意:该方法只能删除开头或是 ...

  7. JVM类加载与双亲委派机制被打破

    前言 前文已经讲了虚拟机将java文件编译成class文件后的格式:JVM虚拟机Class类文件研究分析 java文件经过编译,形成class文件,那么虚拟机如何将这些Class文件读取到内存中呢? ...

  8. eclipse中Tomcat修改项目名称

    1.打开你的项目目录,找到一个.project文件,打开后修改<name> test</name>中的值,将test修改成你要修改的名字: 2.在项目目录下,打开.settin ...

  9. BGP( Border Gateway Protocol)---边界网关协议

    摘自: https://blog.csdn.net/weixin_43751619/article/details/84954755 一,BGP协议原理与配置 边界网关协议( Border Gatew ...

  10. Java开发中POJO和JSON互转时如何忽略隐藏字段

    1. 前言 在Java开发中有时候某些敏感信息我们需要屏蔽掉,不能被消费这些数据的客户端知道.通常情况下我们会将其设置为null或者空字符 "",其实还有其它办法,如果你使用了Ja ...