对于大多数 Linux 命令,都可以通过在输入命令后加上选项 --help 来获得这个命令的作用、用法以及它的一些相关信息。除了 man 命令之外, --help 选项可以让你在不使用所有扩展选项的情况下获取到所需要的内容。
$ mkdir --help Usage: mkdir [OPTION]... DIRECTORY... Create the DIRECTORY(ies), if they do not already exist. -
Mandatory arguments to long options are mandatory for short options too. -m, --mode=MODE set file mode (as in chmod), not a=rwx - umask -p, --parents no error if existing, make parent directories as needed -v, --verbose print a message for each created directory -Z set SELinux security context of each created directory to the default type --context[=CTX] like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX --help display this help and exit --version output version information and exit -
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Full documentation at: <http://www.gnu.org/software/coreutils/mkdir> or available locally via: info '(coreutils) mkdir invocation'
谨慎删除文件
如果要谨慎使用 rm 命令,可以为它设置一个别名,在删除文件之前需要进行确认才能删除。有些系统管理员会默认使用这个别名,对于这种情况,你可能需要看看下一个技巧。
$ rm -i <== 请求确认
关闭别名
你可以使用 unalias 命令以交互方式禁用别名。它不会更改别名的配置,而仅仅是暂时禁用,直到下次登录或重新设置了这一个别名才会重新生效。
$ unalias rm
如果已经将 rm -i 默认设置为 rm 的别名,但你希望在删除文件之前不必进行确认,则可以将 unalias 命令放在一个启动文件(例如 ~/.bashrc )中。
使用 sudo (编辑:西安站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|