最近一直在使用Linux操作系统,也熟知一些简单的命令,那么下面我将介绍几个不为人知却十分有用的命令:
1.mtr命令,查看mtr运行的主机和某个网站的直接网络连接,如下
mtr google.com
显示一下内容
My traceroute [v0.75] localhost.localdomain (0.0.0.0) Sun May 18 19:32:36 2014 Keys: Help Display mode Restart statistics Order of fields quit Packets Pings Host Loss% Snt Last Avg Best Wrst StDev 1. 103.31.240.129 0.0% 42 0.5 0.5 0.5 0.6 0.0 2. 118.126.0.9 0.0% 42 0.3 0.3 0.2 0.4 0.0 3. 210.245.144.37 0.0% 42 2.9 3.6 2.9 22.1 3.0 4. 113.10.231.125 0.0% 42 3.1 3.8 2.7 40.2 5.8 5. irb9.10g-tc2.wpc.nwtgigalink.com 0.0% 42 2.9 3.1 2.9 5.1 0.4 6. ae2.10g-pp2.wpc.nwtgigalink.com 0.0% 42 3.2 3.0 2.9 3.2 0.1 7. google3-10G.hkix.net 0.0% 42 4.6 4.5 4.3 4.6 0.1 8. 209.85.248.62 0.0% 42 5.0 5.3 4.8 13.7 1.6 9. 209.85.241.171 0.0% 42 5.3 5.2 5.1 5.7 0.1 10. hkg03s16-in-f8.1e100.net 0.0% 41 4.8 4.9 4.7 5.0 0.1
2.nl命令,给所查看的文本加上行号,如下
cat a.log aa nl a.log 1 aa
3.shuf命令,随机从一个文件或者一个文件夹中选取行或者文件
[root@localhost mwq]# ls | shuf -n1 a.log [root@localhost mwq]# ls | shuf -n1 a.log [root@localhost mwq]# ls | shuf -n1 a.log [root@localhost mwq]# ls | shuf -n1 20140512.sql [root@localhost mwq]# ls | shuf -n1 20140512.sql [root@localhost mwq]# ls | shuf -n1 a.log [root@localhost mwq]# vim a.log [root@localhost mwq]# cat a.log | shuf -n1 aa [root@localhost mwq]# cat a.log | shuf -n1 dd [root@localhost mwq]# cat a.log | shuf -n1 aa [root@localhost mwq]# cat a.log | shuf -n1 ff
当然你也可以改变参数如cat a.log | shuf -n2获取两行内容。
4.last命令,查看上次登录或者登出的用户
root pts/4 xxxxxxxxxxx Sun May 18 19:12 still logged in root pts/4 xxxxxxxxxxx Fri May 16 09:39 - 15:17 (05:38) root pts/4 xxxxxxxxxxx Wed May 14 17:13 - 18:01 (00:48) root pts/4 xxxxxxxxxxx Mon May 12 10:50 - 13:38 (02:47) root pts/4 xxxxxxxxxxx Mon May 12 10:48 - 10:50 (00:02) root pts/1 xxxxxxxxxxx Fri May 9 11:58 still logged in
5.pstree以树的结构显示当前的进程节点
init─┬─abrt-dump-oops ├─abrtd ├─acpid ├─atd ├─auditd───{auditd} ├─avahi-daemon───avahi-daemon ├─console-kit-dae───63*[{console-kit-da}] ├─crond ├─dbus-daemon───{dbus-daemon} ├─hald───hald-runner─┬─hald-addon-acpi │ └─hald-addon-inpu ├─irqbalance ├─java───330*[{java}] ├─master───qmgr ├─6*[mingetty] ├─mysqld_safe───mysqld───11*[{mysqld}] ├─rhsmcertd───rhsmcertd ├─rsyslogd───3*[{rsyslogd}] ├─sshd─┬─4*[sshd───bash] │ └─sshd───bash───pstree ├─stap-serverd ├─udevd───2*[udevd] └─vsftpd
好了,今天就先介绍这么多,稍后会继续。。。。
相关推荐
主要介绍了关于shell的几个不为人知却十分有用的命令,需要的朋友可以参考下
shell命令shell命令shell命令shell命令shell命令shell命令shell命令shell命令shell命令shell命令shell命令shell命令shell命令shell命令
在这个shell中,可以使用shell命令 或声明变量,也可以创建并运行shell脚本程序。运行shell脚本程序时,系统将创建一个子shell。 此时,系统中将有两个shell,一个是登录时系统启动的shell,另一个是系统为运行脚本...
Shell 既是一种命令语言,又是一种程序设计语言。 Shell 是指一种应用程序,这个应用程序提供了一个界面,用户通过这个界面访问操作系统内核的服务。 Ken Thompson 的 sh 是第一种 Unix Shell,Windows Explorer 是...
LINUX SHELL命令练习 题
主要给大家介绍了关于shell中长命令的换行处理方法,文中通过示例代码介绍的非常详细,对大家学习或者使用shell具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
shell命令解释器 ,linux shell 命令解释器通俗易懂 功能完整可用于操作系统课程设计
放在Post Steps 的shell命令 ,一键自动部署(2021最新版)
shell命令大全(linux下很有用的命令规范)
在计算机科学中,Shell俗称壳(用来区别于核),是指“提供使用者使用界面”的软件(命令解析器)。它类似于DOS下的command和后来的cmd.exe。它接收用户命令,然后调用相应的应用程序。基本上shell分两大类: 一:...
Shell基本命令.rar
详细记录了vxworks的shell命令,对于初学vxworks的是极好的资料
VC++关于对SHELL命令的操作,VC++关于对SHELL命令的操作,VC++关于对SHELL命令的操作,VC++关于对SHELL命令的操作,
shell 命令的讲解,以及代码示例的展示,各个命令的用法。
本单元实现了一个伪的Shell,可以用于在Android程序中执行Shell命令,如果需要Root权限,则在执行前,调用AskForRoot方法来获取用户的Root授权,如果不再需要在Root账号下执行命令,则调用ExitRoot方法来退出Root...
常用shell命令常用shell命令常用shell命令常用shell命令常用shell命令
shell 命令参考手册 reference
1.开发中实用的各种adb大全 ,附带例子讲解 2.各种不常见但是也会很有用的adb shell命令