linux系统管理学习笔记1-初始linux

当文本模式下登入系统或在图形界面下打开终端,首先将看到的是一个提示符(prompt)。例如

[stu@localhost~]$

其中,'Stu'为登录用户名,'localhost'为登录主机名,’~’ 表示当前用户正处在stu用户的家目录中,’$’则表示当前登录用户为普通用户
下面使用几个简单到命令与linux进行交互

命令:whoani

用法:whoami [选项]...
 
显示与当前的有效用户ID 相关联的用户名。
 
¨       --help         显示此命令帮助信息并退出
 
¨       --version     显示命令版本信息并退出

举例:

[dxw@localhost ~]$ whoami
dxw
[dxw@localhost ~]$ whoami --version
whoami (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard Mlynarik.
[dxw@localhost ~]$ whoami --help
Usage: whoami [OPTION]...
Print the user name associated with the current effective user ID.
Same as id -un.

      --help     display this help and exit
      --version  output version information and exit

Report whoami bugs to [email protected]
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'whoami invocation'
命令:echo

用法:/bin/echo [选项]... [字符串]... 或:/bin/echo 长选项
 
将 STRING 回显到标准输出。
 
¨        -n       不尾随换行符
¨        -e       启用解释反斜杠的转义功能
¨        -E       禁用解释反斜杠的转义功能(默认)
¨        --help  显示此帮助信息并退出
¨        --version   显示版本信息并退出
若-e可用,则以下序列即可识别:
¨        \\    反斜杠
¨        \a    响铃声
¨        \b    退格
¨        \c    不再产生新的输出
¨        \e    转义符
¨        \f    换页
¨        \n    新行
¨        \r    回车
¨        \t    水平制表符
¨        \v    竖直制表符
¨        \0NNN    字节数以八进制数 NNN (1至3位)表示
¨        \xHH     字节数以十六进制数 HH (1至2位)表示
 
注意:BASH中可能内含自己的echo 程序版本,它会覆盖这里所提及的相应版本,可能在命令具体行为上有些许区别。

[dxw@localhost ~]$ echo -e hello,linux.\\nhello,world
hello,linux.
hello,world
[dxw@localhost ~]$ echo hello,linux
hello,linux
[dxw@localhost ~]$ echo -E hello,linux.\\nhello,world
hello,linux.\nhello,world

命令:nano

用法:nano是一个文本编辑工具,ano命令与上面两个命令不太一样,这个命令有自己的界面,我们在命令行下输入nano, 回车,就来到了nano界面中,这时我们就可以在光标处输入文本了,我们可以用箭头键来移动光标,也可以按Alt+M打开鼠标支持来移动光标:按Ctrl+G 可以查看nano的帮助文档,在帮助文档中可以查看nano各种命令快捷键的详细用法。接着,按Ctrl+X可以退出当前查看或编辑的文档


扫描二维码关注公众号,回复: 4941279 查看本文章

猜你喜欢

转载自blog.csdn.net/qq_36134369/article/details/78638141
今日推荐