7个不是经常用但很强大的Linux命令
2015-07-19 16:53
561 查看
本文中文部分参考:http://www.oschina.net/translate/11-lesser-known-useful-linux-commands
本文英文部分参考:http://www.tecmint.com/11-lesser-known-useful-linux-commands/
1. sudo !!命令
没有特定输入sudo命令而运行,将给出没有权限的错误。那么,你不需要重写整个命令,仅仅输入’!!’就可以抓取最后的命令。
sudo !! command
Running the command without specifying sudo command will give you permission denied error. So, you don’t need to rewrite the whole command again just put ‘!!‘ will grab the last command.
2. python命令
下面的命令生产一个通过HTTP显示文件夹结构树的简单网页,可以通过浏览器在端口8000访问,直到发出中断信号。
python command
The below command generates a simple web page over HTTP for the directory structure tree and can be accessed at port 8000 in browser till interrupt signal is sent.
3.ss命令
“ss”表示socket统计。这个命令调查socket,显示类似netstat命令的信息。它可以比其他工具显示更多的TCP和状态信息。
ss Command
The “ss” stands for socket statistics. The command investigates the socket and shows information similar to netstat command. It can display more TCP and state informations than other tools.
4.last命令
“last”命令显示的是上次登录用户的历史信息。这个命令通过搜索文件“/var/log/wtmp”,显示logged-in和logged-out及其tty‘s的用户列表。
last Command
The “last” command show the history of last logged in users. This command searches through the file “/var/log/wtmp” and shows a list of logged-in and logged-out users along with tty’s.
5.pstree命令
这个命令显示当前运行的所有进程及其相关的子进程,输出的是类似‘tree’命令的树状格式。
pstree
This commands shows all the processes running currently along with associated child process, in a tree like format similar to ‘tree‘ command output.
6. tree命令
以树式的格式得到当前文件夹的结构。
tree command
Get the current directory structure in tree like format.
7. nl命令
“nl命令”添加文件的行数。一个叫做’one.txt’的文件,其每行的内容是(Fedora、Debian、Arch、Slack和Suse),给每行添加行号。首先使用cat命令显示“one.txt”的文件内容。
nl Command
The “nl command” number the lines of a file. Number the lines of a file say ‘one.txt‘ with lines say (Fedora, Debian, Arch, Slack and Suse). First list the content of a file “text.txt” using cat command.
本文英文部分参考:http://www.tecmint.com/11-lesser-known-useful-linux-commands/
1. sudo !!命令
没有特定输入sudo命令而运行,将给出没有权限的错误。那么,你不需要重写整个命令,仅仅输入’!!’就可以抓取最后的命令。
sudo !! command
Running the command without specifying sudo command will give you permission denied error. So, you don’t need to rewrite the whole command again just put ‘!!‘ will grab the last command.
$ apt-get update E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
$ sudo !! sudo apt-get update [sudo] password for server: … .. Fetched 474 kB in 16s (28.0 kB/s) Reading package lists... Done server@localhost:~$
2. python命令
下面的命令生产一个通过HTTP显示文件夹结构树的简单网页,可以通过浏览器在端口8000访问,直到发出中断信号。
python command
The below command generates a simple web page over HTTP for the directory structure tree and can be accessed at port 8000 in browser till interrupt signal is sent.
python -m SimpleHTTPServer
3.ss命令
“ss”表示socket统计。这个命令调查socket,显示类似netstat命令的信息。它可以比其他工具显示更多的TCP和状态信息。
ss Command
The “ss” stands for socket statistics. The command investigates the socket and shows information similar to netstat command. It can display more TCP and state informations than other tools.
4.last命令
“last”命令显示的是上次登录用户的历史信息。这个命令通过搜索文件“/var/log/wtmp”,显示logged-in和logged-out及其tty‘s的用户列表。
last Command
The “last” command show the history of last logged in users. This command searches through the file “/var/log/wtmp” and shows a list of logged-in and logged-out users along with tty’s.
5.pstree命令
这个命令显示当前运行的所有进程及其相关的子进程,输出的是类似‘tree’命令的树状格式。
pstree
This commands shows all the processes running currently along with associated child process, in a tree like format similar to ‘tree‘ command output.
6. tree命令
以树式的格式得到当前文件夹的结构。
tree command
Get the current directory structure in tree like format.
7. nl命令
“nl命令”添加文件的行数。一个叫做’one.txt’的文件,其每行的内容是(Fedora、Debian、Arch、Slack和Suse),给每行添加行号。首先使用cat命令显示“one.txt”的文件内容。
nl Command
The “nl command” number the lines of a file. Number the lines of a file say ‘one.txt‘ with lines say (Fedora, Debian, Arch, Slack and Suse). First list the content of a file “text.txt” using cat command.
相关文章推荐
- linux命令,系统安全相关命令--su
- 深刻理解Linux进程间通信(IPC)
- Centos系统sendmail发送邮件很慢的解决方法
- Linux学习与总结:-3Linux VIM文本编辑器的学习
- Linux HugePages
- Linux下变量的使用规则
- linux常用命令
- Linux学习与总结:-2Linux常用命令
- Python学习-centos7.0下matplotlib安装及问题解决
- linux下安装storm
- linux下的 一些常识
- Linux 磁盘管理
- 在linux下安装jdk
- vmware centOS 开机进度条 卡死 Determining IP Information for eth0...
- linux中运行一个二进制的文件
- LINUX中system()函数详解
- 在VMware下建立一个linux和Windows共享的文件夹
- LINUX中fork()函数详解
- Linux strace命令(转)
- 如何查看/修改Linux时区和时间