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. Linux kernel 同步机制

    Linux kernel同步机制(上篇) https://mp.weixin.qq.com/s/mosYi_W-Rp1-HgdtxUqSEgLinux kernel 同步机制(下篇) https:// ...

  2. 线上nginx的一次“no live upstreams while connecting to upstream ”分析

    线上nginx的一次"no live upstreams while connecting to upstream "分析 线上nginx的一次"no live upst ...

  3. C++ Primer Plus读书笔记(九)内存模型和名称空间

    1.作用域和链接 int num3; static int num4; int main() { } void func1() { static int num1; int num2; } 上边的代码 ...

  4. sql,关键字使用

    select instr('dds万','万',1) from dual --判断万关键字是否存在 select to_single_byte('9') from dual --全角数字转为半角数字 ...

  5. mysql创建和使用数据库

    mysql连接和断开 mysql -h host -u user -p******** /*建议不要在命令行中输入密码,因为这样做会使其暴露给在您的计算机上登录的其他用户窥探*/ mysql -u u ...

  6. Codeforces Round #682 (Div. 2)【ABCD】

    比赛链接:https://codeforces.com/contest/1438 A. Specific Tastes of Andre 题意 构造一个任意连续子数组元素之和为子数组长度倍数的数组. ...

  7. Codeforces Round #633 (Div. 2)

    Codeforces Round #633(Div.2) \(A.Filling\ Diamonds\) 答案就是构成的六边形数量+1 //#pragma GCC optimize("O3& ...

  8. UVA 11475 Extend to Palindrome (kmp || manacher || 后缀数组)

    题目链接:点击打开链接 题意:给你一个串,让你在串后面添加尽可能少的字符使得这个串变成回文串. 思路:这题可以kmp,manacher,后缀数组三种方法都可以做,kmp和manacher效率较高,时间 ...

  9. Codeforces Round #668 (Div. 2) B. Array Cancellation (思维,贪心)

    题意:有一个长度为\(n\)并且所有元素和为\(0\)的序列,你可以使\(a_{i}-1\)并且\(a_{j}+1\),如果\(i<j\),那么这步操作就是免费的,否则需要花费一次操作,问最少操 ...

  10. 【ybt金牌导航1-2-5】【luogu P3287】优美玉米 / 方伯伯的玉米田

    优美玉米 / 方伯伯的玉米田 题目链接:ybt金牌导航1-2-5 / luogu P3287 题目大意 有一个数组,你可以每次给一个区间里面的值加一,要你使得最后剩下的最长单调不下降子序列最长. 思路 ...