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. 使用Jmeter对SHA1加密接口进行性能测试

    性能测试过程中,有时候会遇到需要对信息头进行加密鉴权,下面我就来介绍如何针对SHA1加密鉴权开发性能测试脚本1.首先了解原理,就是需要对如下三个参数进行SHA1加密,(AppSecret + Nonc ...

  2. Netty之Unpooled_Bytebuf

    前言 计算机存储基本单位是字节(byte),传输基本单位是bit(位),JAVA NIO提供了ByteBuffer等七种容器来提升传输时的效率,但是在使用时比较复杂,经常要进行读写切换,主要缺点如下: ...

  3. ArchLinux安装后所需要的环境和工具

    ArchLinux安装后所需要的环境和工具 工具: Dolphin 文件管理器 ntfs-3G 移动硬盘挂载 octopi 实时检查更新 KDE Connect 手机电脑远程连接 DBeaver Co ...

  4. Go Code Review Comments

    Go Code Review Comments https://golang.org/wiki/CodeReviewComments

  5. SELECT ... FOR UPDATE or SELECT ... FOR SHARE Locking Reads session

    小结: 1.注意使用限制 Locking reads are only possible when autocommit is disabled (either by beginning transa ...

  6. all header field names in both HTTP requests and HTTP responses are case-insensitive.

    https://tools.ietf.org/html/rfc6455#section-4.2.1 Please note that according to [RFC2616], all heade ...

  7. 一文带你看遍 JDK9~14 的重要新特性!

    Java9 发布于 2017 年 9 月 21 日 .作为 Java8 之后 3 年半才发布的新版本,Java 9 带 来了很多重大的变化其中最重要的改动是 Java 平台模块系统的引入,其他还有诸如 ...

  8. MarkDown学习笔记 Typora

    快捷方式篇 新建 ctrl + N 新建窗口 ctrl + shift + N 打开md文件 ctrl + O 快速打开 ctrl + P 保存 ctrl + S 另存为 ctrl + shift + ...

  9. string知识

    因为历史原因以及为了与C语言兼容,字符串字面值与标准库string类型不是同一种类型.这一点很容易引起混乱,编程时一定要注意区分字符串字面值和string数据类型的使用,这很重要. 额~~~C字符串是 ...

  10. web.xml启动时调用java类方法

    <listener> <listener-class>com.test</listener-class> //该类为java类路径标示要执行的接口 需在web.xm ...