1.if-then语句 #!/bin/bash username="root" if grep $username /etc/passwd then echo "there is root" fi 2.if-then-else #!/bin/bash username="hahaha" if grep $username /etc/passwd then echo "there is hahaha" else echo &q
test命令用法.功能:检查文件和比较值 shell中test命令方法详解 原文:https://www.cnblogs.com/guanyf/p/7553940.html 1)判断表达式 if test (表达式为真) if test !表达式为假 test 表达式1 –a 表达式2 两个表达式都为真 test 表达式1 –o 表达式2 两个表达式有一个为真 2)判断字符串 test –n 字符串
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long)
Linux下shell 的 ls 命令 ls -d 显示当前目录的上层目录,不显示子目录 ls -a 显示当前目录下的所有子目录,包括隐藏的文件 ls -l 显示当前目录下所有文件的所有信息(除隐藏文件夹外)文件名 子目录的权限 使用者 文件大小 等 ls -s 在每个文件后面显示文件的大小(我觉得-s 表示的是size的意思) ls -k 树上说以k字节的形式表示文件的大小(我未曾直观的看到怎样以k 字节表示) ls -u 以文件上次访问的时间排序(我试出来的结果是倒序) ls -t 以时间排