• 一个简单的shell脚本


    ps -le | grep httpd    查看程序httpd所开启的进程 kill (pid)     就能杀死相应的进程。如果想杀死一个程序的所有进程,则需要杀死子进程的父进程。(速度快) [gxl@localhost ~]$ pstree init─┬─acpid ├─avahi-daemon───avahi-daemon ├─cupsd ├─daemondaemon ├─2*[dbus-daemon] ├─dbus-launch ├─dcopserver ├─gam_server ├─hald───hald-runner─┬─hald-addon-acpi │                    ├─2*[hald-addon-keyb] │                    └─hald-addon-stor ├─hcid ├─hidd ├─httpd───9*[httpd] ├─kded ├─kdeinit─┬─artsd │         ├─kio_file │         ├─klauncher │         ├─konqueror───kdesu───rfuser │         └─kwin ├─kdesktop ├─kicker ├─klipper ├─klogd ├─kmix ├─knotify ├─konqueror ├─korgac ├─ksmserver ├─6*[mingetty] ├─mysqld_safe───mysqld───{mysqld} ├─netconfiguistat ├─netd ├─powersaved ├─prefdm───kdm─┬─X │              └─kdm───startkde───kwrapper ├─scim-helper-man ├─2*[scim-launcher] ├─sdpd ├─shared ├─skim───{skim} ├─smbd───smbd ├─sshd───sshd───sshd───bash───su───bash───su───bash───pstree ├─start_kdeinit ├─syslogd └─udevd 一个简单的shell程 /root/Desktop/gg.sh       (`这是在桌面上的脚本) #!/bin/sh #This is to show what a example looks like. echo "Our first example" echo  # This inserts an empty line in output. echo "We are currently in the following directory." /bin/pwd echo echo "This directory contains the following files" /bin/ls 写入:vi /root/Desktop/gg.sh   写好之后  :wq! (保存退出)   ( :w gg001.sh   保存到一个新的文件中去) 执行shell脚本:  sh  /root/Desktop/gg.sh      接下来就会输出脚本功能执行的内容
  • 相关阅读:
    flock对文件锁定读写操作的问题 简单
    hdu 2899 Strange Fuction(二分)
    hdu 2199 Can you solve this equation? (二分)
    poj 3080 Blue Jeans (KMP)
    poj 2823 Sliding Window (单调队列)
    poj 2001 Shortest Prefixes (trie)
    poj 2503 Babelfish (trie)
    poj 1936 All in All
    hdu 3507 Print Article (DP, Monotone Queue)
    fzu 1894 志愿者选拔 (单调队列)
  • 原文地址:https://www.cnblogs.com/gxldan/p/4066679.html
Copyright © 2020-2023  润新知