![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
艾斯卡诺
这个作者很懒,什么都没留下…
展开
-
linux延长sudo的持续时间
有时候我们需要延长 sudo 的持续时间。因为重复提供密码很烦人。Ubuntu 默认sudo会话是15分钟(可能会随着版本的不同而改变),但我们可以更改它。运行并打开sudo visudo并更改行:Defaults env_reset至Defaults env_reset,timestamp_timeout=20如果这样做,20分钟内不会要求重新输入密码。0表示每次都会询问,-1表示永远不会提示输入sudo会话密码。参考资料UBUNTU-14..转载 2021-07-14 12:20:38 · 764 阅读 · 0 评论 -
如何在Linux中将终端打开到特定目录
By default, newTerminal windows open to your Home directory. However, if there’s another directory you use often that you want immediate access to when you open the Terminal, there’s an easy way to set this up.默认情况下,新的终端窗口会打开到您的主目录。 但是,如果打开终端时经常使用另一个要立即.转载 2021-07-14 10:05:49 · 3853 阅读 · 0 评论 -
linux shell下除了某个文件外的其他文件全部删除的命令
Linux反选删除文件最简单的方法是# shopt -s extglob (打开extglob模式)# rm -fr !(file1)如果是多个要排除的,可以这样:# rm -rf !(file1|file2)Linuxrm删除指定文件外的其他文件方法汇总一、Linux下删除文件和文件夹常用命令如下:删除文件:rmfile删除文件夹:rm-rfdir需要注意的是,rmdir只能够删除空文件夹。二、删除制定文件(夹)之...转载 2021-07-14 09:31:40 · 884 阅读 · 0 评论 -
TAB键== 4个空格并在VIM中使用花括号后自动缩进
使制表符键== 4个空格,并像Emacs一样在大括号块之后自动缩进代码?另外,如何保存这些设置,这样我就不必再次输入它们了。使用以下命令(在您的.vimrc中):filetype plugin indent on" show existing tab with 4 spaces widthset tabstop=4" when indenting with '>', use 4 spaces widthset shiftwidth=4" On pressing tab, i转载 2021-07-13 12:42:35 · 144 阅读 · 0 评论 -
如何在LINUX SHELL脚本中提示输入YES / NO / CANCEL输入
我想在shell脚本中暂停输入,并提示用户进行选择。标准Yes,No或Cancel类型问题。如何在典型的bash提示中完成此操作?该命令是在shell提示符下获取用户输入的最简单,使用最广泛的方法read。演示其用法的最佳方法是一个简单的演示:while true; do read -p "Do you wish to install this program?" yn case $yn in [Yy]* ) make install; break;;.转载 2021-07-13 12:39:14 · 2646 阅读 · 0 评论 -
LINUX-如何在FIND中排除目录
使用-prune开关。例如,如果要排除misc目录,只需将a添加-path ./misc -prune -o到您的find命令中:find . -path ./misc -prune -false -o -name '*.txt'这是带有多个目录的示例:find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -false -o -name '*.txt'在这里,我们排除./dir1,./dir2和./di.转载 2021-07-13 12:37:25 · 5716 阅读 · 0 评论 -
BASH-如何在LINUX中更改ECHO的输出颜色
可以使用以下ANSI转义码:Black 0;30 Dark Gray 1;30Red 0;31 Light Red 1;31Green 0;32 Light Green 1;32Brown/Orange 0;33 Yellow 1;33Blue 0;34 Light Blue 1;34Purple 0;35 Light Purple转载 2021-07-13 12:35:16 · 149 阅读 · 0 评论 -
如何在LINUX中对文件进行符号链接
要创建一个新的符号链接(如果符号链接已经存在,将失败):ln -s /path/to/file /path/to/symlink要创建或更新符号链接:ln -sf /path/to/file /path/to/symlink转载 2021-07-13 12:33:36 · 345 阅读 · 0 评论 -
在VIm中快速缩进多行
使用>命令。要缩进五行,5>>。要标记一行并缩进,Vjj>可以缩进三行(仅Vim)。要缩进大括号块,请将光标放在大括号之一上,然后使用>%或从块use中的任何位置使用>iB。如果要在周围复制文本块,并且需要在新位置对齐块的缩进,请使用]p代替justp。这会将粘贴的块与周围的文本对齐。此外,该shiftwidth设置还允许您控制要缩进多少个空格。...转载 2021-07-13 12:32:01 · 1518 阅读 · 0 评论 -
如何告诉GCC不要内联函数
假设在一个源文件中有这个小函数static void foo() {}构建一个优化版本的二进制文件,但不希望这个函数内联。可以按如下方法声明函数:void __attribute__ ((noinline)) foo() { ...}转载 2021-07-13 12:23:15 · 1571 阅读 · 0 评论 -
JAVASCRIPT-如何重定向到另一个网页
如果要模拟某人单击链接,请使用location.href如果要模拟HTTP重定向,请使用location.replace例如:// similar behavior as an HTTP redirectwindow.location.replace("http://stackoverflow.com");// similar behavior as clicking on a linkwindow.location.href = "http://stackoverflow.com".转载 2021-07-13 12:19:04 · 139 阅读 · 0 评论 -
解决 You are missing the following 32-bit libraries, and Steam may not run:libGL.so.1‘
最近为自己设置了 14.04 LTS,当我安装 Steam 并尝试运行它时,我在终端中收到此消息。Steam 需要安装这些额外的软件包:libgl1-mesa-dri:i386, libgl1-mesa-glx:i386, libc6:i386当为此输入密码时,在终端中收到这一系列事件:Reading package lists... DoneBuilding dependency tree Reading state information... DoneSome.转载 2021-07-13 12:16:50 · 8865 阅读 · 0 评论 -
BASH-从一个文件中删除另一个文件中的行
原文链接:https://www.it566.top/index.php/wenzhang/linux/2021/03/25/78396/转载 2021-03-27 09:57:19 · 301 阅读 · 0 评论