1、程序和进程; 程序是为了完成某种任务而设计的软件,比如OpenOffice是程序。什么是进程呢?进程就是运行中的程序。一个运行着的程序,可能有多个进程。比如 LinuxSir.Org 所用的WWW服务器是apache服务器,当管理员启动服务后,可能会有好多人来访问,也就是说许多用户来同时请求httpd服务,apache服务器将会创建有多个httpd进程来对其进行服务。 1.1 进程分类;进程一般分为交互进程、批...
在网上看到了下面这个命令: ps aux | grep [e]macs 运行如下: test@ubuntu:~$ ps -ef|grep vim test 2481 1797 0 18:35 pts/1 00:00:00 vim test 2507 1815 0 18:36 pts/0 00:00:00 grep --color=auto vim test@ubuntu:~$ ps -ef|grep [v]im test 2481 1797 0 18:35 pts/1 00:00:00 vim 请问为什么ps -ef|grep [v]im会滤掉grep命令对应的这个进程?
不知道大家有没有注意: ps aux|grep ssh root 2594 0.0 0.0 4936 1124 ? Ss Sep09 0:00 /usr/sbin/sshd root 5858 0.0 0.1 7496 2084 ? Ss 09:27 0:00 sshd: sszheng [priv] sszheng 5862 0.0 0.0 7660 1380 ? S 09:27 0:00 sshd: sszheng@pts/0 sszheng 5983 0.0 0.0 1648 512 pts/1 S+ 12:07 0:00 grep ssh 显示结果中,有sszheng 5983 0.0 ...
一、ls 对于ls输出,除了加上--color= auto这样的参数来接受系统默认的设置以外,我们可以为某种文件类型选择颜色。Fedora、Suse、Gentoo中一般都会有颜色的配置文件 /etc/DIR_COLORS 。在Debian/Ubuntu中如果没有的话,可以: # dircolors -p > /etc/DIR_COLORS 或者 # dircolors -p > ~/.dir_colors 但dircolors程序不会去主动识别配置文件,需要在~/.bashrc中写上: export LS_OPTIONS='-aCF --color=auto' eval "`dircolors ...
在redhat 9 下 ps -ef |grep xx 显示的都是完整信息,全屏幕显示正常 到在7.3下 ps -ef 也是正常的 但只要加了"|" 显示的结果就只显示到屏幕的几乎一半 ps -ef |grep xx 或ps -ef |awk '{if ($0~/com/) print $0 }'或ps -aux|awk '{if ($0~/com/) print $0 }' 以前没有注意到这个情况 比较 ps -ef 1633 1562 0 Apr16 ? 00:00:01 java -server -classpath /opt/j2sdk1.4.1_01/lib:/opt/j2sdk1.4.1_01/jre...
有类似下面的grep命令 其中user是普通用户名,系统suse 10,进程中不存在包含.ps -fu user得到所有行中不包含123 1.ps -fu user|grep -v grep|grep 123 2.ps -fu user|grep 123|grep -v grep 3.ps -fu user|grep 123 4.ps -fu root|grep 123 1和2执行后所得结果相同,什么都没得到 echo $? 输出1 3执行后会得到一个grep 123的进程 echo $? 输出0 4执行后什么都没得到 echo $? 输出1 问题: 1.grep -v grep放的前后位置对于所...