<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ls &#8211; 张三太爷</title>
	<atom:link href="https://www.somedoc.net/tag/ls/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.somedoc.net</link>
	<description>看前面，黑洞洞</description>
	<lastBuildDate>Tue, 18 Feb 2020 03:55:03 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>

<image>
	<url>https://www.somedoc.net/wp-content/uploads/2016/12/cropped-dandycheung-1-32x32.jpg</url>
	<title>ls &#8211; 张三太爷</title>
	<link>https://www.somedoc.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ls for Windows</title>
		<link>https://www.somedoc.net/2020/02/18/ls-for-windows/</link>
					<comments>https://www.somedoc.net/2020/02/18/ls-for-windows/#respond</comments>
		
		<dc:creator><![CDATA[张三太爷]]></dc:creator>
		<pubDate>Tue, 18 Feb 2020 03:42:07 +0000</pubDate>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[电脑]]></category>
		<category><![CDATA[软件]]></category>
		<category><![CDATA[问题解决]]></category>
		<category><![CDATA[ls]]></category>
		<guid isPermaLink="false">http://www.somedoc.net/?p=4333</guid>

					<description><![CDATA[不得不说，随着使用 Linux 以及 WSL 的频度增加，* <a href="https://www.somedoc.net/2020/02/18/ls-for-windows/" class="more-link">[&#8230;]</a>]]></description>
										<content:encoded><![CDATA[<p>不得不说，随着使用 Linux 以及 WSL 的频度增加，*nix 的一些东西在逐步侵蚀我的大脑。比较烦的一件事就是，打开 cmd.exe 经常就习惯性输入 ls -l，然后才反应过来应该 dir。很多次以后，感觉还是一劳永逸解决掉比较好。</p>
<p>搜索得到这个么网址，<a href="https://u-tools.com/msls">https://u-tools.com/msls</a>，下载后发现挺好，还附赠了 grep。为了使用方便，你要么把包里的可执行文件都移动到 system 目录下，要么把所在目录放进 PATH 里。这两个命令都支持预设对应的环境变量来确定默认参数。LS_OPTIONS 的官方推荐值为 <code>-bhAC --more --color=auto --recent --streams</code>，而 GREP_OPTIONS 的则是 <code>--binary-files=text -d skip --color=auto</code>。</p>
<p>在此过程中，还发现了一个叫 sudo.vbs 的脚本，顺便抄录于下（原链接：https://www.jianshu.com/p/2a2639815c79）。sudo 的能力对我不是刚需，而且很久之前有人在 sf.net 上就有人做过（<a href="https://sourceforge.net/p/sudowin">https://sourceforge.net/p/sudowin</a>），后来还有人用 go 实现了一遍（<a href="https://github.com/mattn/sudo">https://github.com/mattn/sudo</a>）。</p><pre class="crayon-plain-tag">'ShellExecute 方法

'作用: 用于运行一个程序或脚本。

'语法
'      .ShellExecute "application", "parameters", "dir", "verb", window
'      .ShellExecute 'some program.exe', '"some parameters with spaces"', , "runas", 1

'关键字
'   application   要运行的程序或脚本名称
'   parameters    运行程序或脚本所需的参数
'   dir           工作路径，若未指定则使用当前路径
'   verb          要执行的动作 (值可以是 runas/open/edit/print)
'                   runas 动作通常用于提升权限
'   window        程序或脚本执行时的窗口样式 (normal=1, hide=0, 2=Min, 3=max, 4=restore, 5=current, 7=min/inactive, 10=default)


Set UAC = CreateObject("Shell.Application")
Set Shell = CreateObject("WScript.Shell")
If WScript.Arguments.count&lt;1 Then
    WScript.echo "语法: sudo &lt;command&gt; [args]"
ElseIf WScript.Arguments.count=1 Then
    UAC.ShellExecute WScript.arguments(0), "", "", "runas", 1
'    WScript.Sleep 1500
'    Dim ret
'    ret = Shell.Appactivate("用户账户控制")
'    If ret = true Then
'        Shell.sendkeys "%y"
'    Else
'        WScript.echo "自动获取管理员权限失败，请手动确认。"
'    End If
Else
    Dim ucCount
    Dim args
    args = NULL
    For ucCount=1 To (WScript.Arguments.count-1) Step 1
        args = args &amp; " " &amp; WScript.Arguments(ucCount)
    Next
    UAC.ShellExecute WScript.arguments(0), args, "", "runas", 5
End If</pre><p>还有个略显贪婪的需求就是能把 ~ 当成用户自主根目录。</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.somedoc.net/2020/02/18/ls-for-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
