7个不是经常用但很强大的Linux命令
来源:互联网 发布:网红用的相机软件 编辑:程序博客网 时间:2024/05/17 20:02
本文中文部分参考: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.
$ apt-get updateE: 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.
- 7个不是经常用但很强大的Linux命令
- 15个不起眼但非常强大的 Vim 命令
- 15个不起眼但非常强大的 Vim 命令
- 15个不起眼但非常强大的 Vim 命令
- 15个不起眼但非常强大的 Vim 命令
- Hadoop虽然强大,但不是万能的
- Hadoop虽然强大,但不是万能的
- Hadoop虽然强大,但不是万能的
- Hadoop虽强大,但不是万能的
- Hadoop虽强大,但不是万能的
- linux分析日志经常用的命令
- 动画演示10个有趣但毫无用处的Linux命令
- 动画演示10个有趣但毫无用处的Linux命令
- 动画演示10个有趣但毫无用处的Linux命令
- 动画演示10个有趣但毫无用处的Linux命令
- 动画演示10个有趣但毫无用处的Linux命令
- 动画演示10个有趣但毫无用处的Linux命令
- 动画演示10个有趣但毫无用处的Linux命令
- Java中关于json的转义字符解析
- 2.4 Python是如何进行类型转换的?
- ios 线程同步
- 股票学习24
- 2015SAAS服务图表
- 7个不是经常用但很强大的Linux命令
- #25 Reverse Nodes in k-Group
- java基础知识—Java中的反射机制
- HTML文档的常用标记
- iOS应用程序生命周期(前后台切换,应用的各种状态)详解 .
- 今天开通了ACM博客!
- django框架简介
- 使用self. 导致的内存泄露
- c++ 隐藏规则