📄 ex39.sh
字号:
#!/bin/bashROOT_UID=0 # Only users with $UID 0 have root privileges.E_NOTROOT=65E_NOPARAMS=66if [ "$UID" -ne "$ROOT_UID" ]then echo "Must be root to run this script." # "Run along kid, it's past your bedtime." exit $E_NOTROOTfi if [ -z "$1" ]then echo "Usage: `basename $0` find-string" exit $E_NOPARAMSfiecho "Updating 'locate' database..."echo "This may take a while."updatedb /usr & # Must be run as root.wait# Don't run the rest of the script until 'updatedb' finished.# You want the the database updated before looking up the file name.locate $1# Without the 'wait' command, in the worse case scenario,#+ the script would exit while 'updatedb' was still running,#+ leaving it as an orphan process.exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -