用户登录时显示 -bash-4.2$ 原创 涅槃x 2020-03-13 16:26:39 ©著作权 文章标签 记录;备忘; 文章分类 运维 ©著作权归作者所有:来自51CTO博客作者涅槃x的原创作品,请联系作者获取转载授权,否则将追究法律责任 cd /etc/skel/ cp .bash* /root/ 重启 赞 收藏 评论 分享 举报 上一篇:GIT 学习笔记 提问和评论都可以,用心的回复会被更多人看到 评论 发布评论 全部评论 () 最热 最新 相关文章 编写安全Bash脚本的建议 有一个shell脚本校验工具(linter),叫做 shellcheck 。使用它来使您的shell脚本更好!变量赋值在bash中变量赋值按照下面的方式:VARIABLE=2并且你可以使用$VARIABLE(变量名)来引用变量。需要注意的是不要在=运算符的两边放置空格符,比如VARIABLE= 2、VARIABLE = 2、或者VARIABLE =2,这并不是语法错误,但是将会做完全不需要的事情( bash 环境变量 Bash bash内置命令set引起的问题 问题背景最近在编译yocto工程,设置环境变量时,突然发现oe-init-build-env无法正常工作了,正常情况下BDIR="build",但莫名奇妙生成了一个x的目录,有点懵。# normaldir$ . oe-init-build-envdir/build$# abnormaldir$ . oe-init-build-envdir/x$scripts/oe-buildenv bash 环境变量 emacs 教你用10行bash shell脚本轻松监控Linux 监控我们的环境对于服务器运维来说至关重要,尤其是在部署新的应用程序时。如今,公司每天都使用开源解决方案来监控系统资源。但是,当出于测试的目的来监控一定时间时,bash 脚本会派上用场。在本教程中,我们将编写一个 bash shell 脚本,它将输出一个三列表,来显示我们机器上的内存、磁盘和 CPU 的百分比。让我们开始吧!该脚本基本上由三个主要部分组成:监控内存:free -m | awk 'NR bash 数据 Memory 登录显示-bash-4.2$ 登录显示-bash-4.2$ 问题解决!!! 环境变量 bash 文件处理 linux oracle bash-4.2 Linux操作系统是一种免费的开源操作系统,在IT领域有着广泛的应用。其中,红帽(Red Hat)作为一家知名的Linux发行版厂商,为用户提供了稳定、安全和可靠的操作系统平台。在红帽系统中,Bash-4.2是一个强大的命令行解释器,用户可以通过Bash-4.2来执行各种命令,进行系统管理和配置。除了提供操作系统平台外,红帽还提供了一些其他服务和软件,比如Oracle数据库。Oracle是一个 Bash x系统 系统管理 linux 登录异常--bash-4.2$故障 第1章 显示故障为: 登录系统显示为: -bash-4.2$故障第2章 如何解决:故障原因:当前用户的环境变量文件丢失或者损坏、 解决方案:复制正确的文件到用户的家目录下, &nbs linux 登录故障 解决llinux登录显示bash-4.2问题 解决bash-4.2问题在实际环境中,有时候会遇到登录的时候显示bash-4.2,无法正常进入系统,如下所示这是因为该登录用户缺少环境变量导致的,一般正常情况下家目录会有一些环境变量的隐藏文件,当这些文件被误删除后,就会显示这些![]故需要我们去/etc/skel目录下拷贝过去即可最好重新登录root即可 bash-4.2 无法登录 linux用户登录后显示bash-4.2$ 一般出现在新增用户后。解决方案:\cp /etc/skel/.bashrc /home/rd;\cp /etc/skel/.bash_profile /home/rd;\cp /etc/skel/.bash_logout /home/rd;重启登录即可。 linux bash ubuntu 解决方案 重启 用户登录时显示 -bash-4.2$ 问题 用户登录时显示 -bash-4.2$ 问题 用户 登录 显示 Linux/centos登录用户出现bash-4.2$ 原因是在用useradd添加普通用户时,有时会丢失家目录下的环境变量文件,丢失文件如下:1、.bash_profile2、.bashrc以上这些文件是每个用户都必备的文件。此时可以使用以下命令从主默认文件/etc/skel/下重新拷贝一份配置信息到此用户家目录下cp /etc/skel/.bashrc /home/user/cp /etc/skel/.bash_profile /home/user... linux linux配置 linux教程 SSH登陆会出现 -bash-4.2$ 的问题 https://blog.csdn.net/s_sunnyy/article/details/54171266普通用户在登录时,会出现-bash-4.2$的状态[root@dl2home]#sujebash-4.2$查看/etc/passwd文件,显示用户je的信息je:x:1002:1002::/home/hx:/bin/bash查看/home目录下没有用户je的目录原因:在linux下通过us -bash-4.2$ CentOS7 命令行变成-bash-4.2$ 操作系统:CentOS7问题:Last login: Thu Sep 6 08:05:34 2018 from 192.168.153.1Could not chdir to home directory /home/sky9890: No such file or directory-bash-4.2$ 原因:home目录下丢失了文件。解决方式:#cd /etc/skel/ Linux CentOS centos7终端显示-bash-4.2怎么办 登录linux系统过后,发现显示的是-bash-4.2#,而不是root@主机名+路径的显示方式,发生这种情况的原因可能是:1:根下缺少文件,从默认配置中复制过来,cp /etc/skel/.bashrc /root/cp /etc/skel/.bash_profile /root/2:检查系统防火墙设置systemctl status firewalld.service bash linux系统 主机名 linux 切换用户-bash-4.2问题解决 今天给虚拟机扩充磁盘,将磁盘挂载到oracle用户下后,连接不上oracle用户解决办法切换都root -bash-4.2 问题解决 oracle bash 文件拷贝 Centos 7 新用户登录出现-bash-4.2$ 解决 useradd 一个新用户test,切换到test用户发现控制台变成了-bash-4.2$而root用户状态为[root@localhost ******]#解决办法:在/home/目录新建test目录,当然可能出现 File exists切换root用户mkdir /home/testchown test:test /home/testchm linux 配置文件 用户登录 运维 | 解决 CentOS 终端主机名显示-bash-4.2 问题 运维 | 解决 CentOS 终端主机名显示-bash-4.2 问题问题描述登录 linux 系统过后,发现显示的是 -bash-4.2# 而不是 root@主机名 + 路径 的显示方式内容分析根目录缺少文件配置,如:.bashrc .bash_profile切换到有故障的用户导致解决办法检查当前用户是否存在 .bashrc 等相关配置文件ls -al ~ | grep . 运维 centos bash linux 命令终端提示符显示-bash-4.2 #解决方法 昨天在配置linux,突然发现root登录的CRT的终端提示符显示的是-bash-4.1# 而不是root@主机名 + 路径的显示方式。搞了半天也不知道为什么出现这种情况。今天终于搞定这个问题, 原因是root在/root下面的几个配置文件丢失,丢失文件如下: 1、.bash_profile 2、. bash 主机名 配置信息 Linux新用户登录时出现“-bash-4.2$”的解决办法 Linux服务器新建的用户在登录时显示“-bash-4.2$”,而不是“user@hostname”的显示方式,出现此问题的原因是在添加普通用户时,用户家目录下丢失了.bash_profile和.bashrc两个环境变量文件。解决办法:cp /etc/skel/.bashrc /home/usernamecp /etc/skel/.bash_profile /home/username之后退出终端 bash linux服务器 普通用户 -bash-4.2$ 【Linux使用及问题解决】用户登录时显示 -bash-4.2$ 问题 集群的普通用户在登录时,会出现 -bash-4.2$ 的状态[root@dl2 home]#su hx bash-4.2$ 查看 /etc/passwd 文件,显示用户 hx 的信息 hx:x:1002:1002::/home/hx:/bin/bash查看 /home目录下没有用户 hx 的目录 [root@dl2 home]#ls原因:在linux下通 bash html 配置文件 Linux下命令行变成-bash-4.2出现原因以及解决方法 出现原因:基本上是删除了 .bash_profile 这个隐藏文件或者改了这个.bash_profile 中的配置导致的解决方法:vi ~/.bash_profile在最后加上export PS1='[\u@\h \W]\$'然后 source ~/.bash_profile就可以了 bash