如何从 Windows 的命令行翻录音频 CD?
我注意到Linux下有很多程序,但在Windows下,所有的CD rippers都是图形界面。
auto作为--colorswitch的选项在 grep 中有什么影响?grep 什么时候决定为匹配的字符串着色,什么时候不呢?
我有一个包含至少 15000 个文件的缓存文件夹。
我试过这个:
find cache* -mtime +30 -exec rm {} \;
Run Code Online (Sandbox Code Playgroud)
但这让我的服务器负载飞上了天!
有没有更快/更好的解决方案?
或者我可以限制此命令的速度或迭代次数吗?
在 Windows 下,使用 PowerShell,是否可以使文件名建议(使用Tab密钥)像 Linux 下的 bash 一样工作?
假设一个目录包含 3 个目录:example1,example和examination.
在 Windows 上(默认情况下),如果您键入cd ex和Tab,它将自动建议cd .\examination。的后续使用Tab将在example1、example和之间轮换建议examination。
使用 bash(通常在 Linux 下),如果您键入cd ex和Tab,它将自动完成,直到文件名开始不同的字符:cd exam. Tabthen 的另一种用法表明哪些目录可用:
$ cd exam
examination/ example1/ example2/
Run Code Online (Sandbox Code Playgroud)
然后,如果您键入pand Tab,它将自动完成为example,依此类推(此处提供example1和之间的选择example2)。
有没有办法让文件名建议在像这样的树状搜索中工作,而不是在名称中旋转?
(我主要对文件名感兴趣。Bash 还可以根据文件类型细化这个选择,例如只有目录 for cd,这会很好,但是选择文件名本身就足够了。)
当我的批处理脚本运行时,我希望在命令提示符上显示任何错误,以便用户立即看到它,同时抑制显示的所有标准输出。
但我希望所有内容都输出到日志文件中。我该怎么做呢?
换句话说,
+---------+
| | --- stderr ---------> Console
| Program |
| | --- stdout/err -----> Log file
+---------+
Run Code Online (Sandbox Code Playgroud) 使用zsh(和oh-my-zsh),是否可以始终在某个其他命令之后运行一个命令?我想总是对目录运行lsafter cd,而不是cd example; ls每次都运行。
我试过了:
function cd {
cd $1
ls
}
Run Code Online (Sandbox Code Playgroud)
但它似乎zsh在运行时退出,没有任何输出(堆栈溢出?)。更改函数的名称使其按预期工作,但我宁愿仍然使用该cd命令。
alias cd='cd $1;ls'
Run Code Online (Sandbox Code Playgroud)
列出指定的目录,但实际上并不更改工作目录。
是否有可能做到这一点,如果有,如何做到?
是否可以通过任何方式从 Windows Vista 中卸载 PowerShell?
我需要删除它的原因是因为 Windows Vista 安装程序要求我先删除 PowerShell,然后才能对 Windows 进行修复安装。
(点击图片查看大图。)
卸载 KB968930 aka Management Framework Core aka PowerShell
我显然尝试从控制面板中的程序和功能窗口卸载它。但它实际上只能作为来自已安装更新窗口的更新访问。
这并没有解决问题。
注册表更改,取得文件夹的所有权和重命名
接下来,我尝试更改以下注册表项。
FROM THIS:
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1
Value: Install
Type: Reg_Dword
Data: 0
TO THIS:
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1
Value: Install
Type: Reg_Dword
Data: 1
Run Code Online (Sandbox Code Playgroud)
然后我开始提升 cmd 提示符并用它来获得 PowerShell 目录的所有权。
C:\Windows\system32>takeown /f %windir%\system32\windowspowershell
SUCCESS: The file (or …Run Code Online (Sandbox Code Playgroud) 我起初尝试使用 xcopy 和 del 的组合,但 del 一直失败。
如果目录尚不存在,则 xcopy 创建目录。
另一种选择是使用 MKDIR 但它在批处理文件中不起作用?
MKDIR "C:\stuff"
Run Code Online (Sandbox Code Playgroud)
任何想法为什么这在 .bat/.cmd 文件中不起作用?
它在命令提示符下工作正常。
I have found a very useful script here that will parse in arguments to a batch file and process them as follows:
BatchFile.btm /a /b:22 /longopt Parm1 Parm2 /quotedArg:"long quoted arg"
- OPTION_a will equal 1.
- OPTION_b will equal 22
- OPTION_quotedArg will equal "long quoted arg"
- OPTION_longopt will eqal 1.
- PARAM_1 will equal Parm1
- PARAM_2 will equal Parm2
- PARAM_0 will be set to the number of parms, so 2 in this case
Run Code Online (Sandbox Code Playgroud)
However, this …
我正在(尝试)开发一个程序来通过 ShellExecute() 操作 7-zip 控制台程序 (7z.exe) 并将其传递给计算机生成的文件列表。
现在我想做的是:
我想向它传递一个命令行,告诉它包含和排除文件:即
include these :
c:\path\path2\path
c:\path\path2\path__\
.... more files
exclude these :
c:\path\path2\path\data\files\foo\bar\fish.dat
c:\path\path2\path__\data\slug.mp3
.... more files
Run Code Online (Sandbox Code Playgroud)
所以我做了一个这样的命令行:
7z a -t7z -i!"...file to include" -x!"file to exclude" ... etc etc
Run Code Online (Sandbox Code Playgroud)
我只是从记忆中重复,所以我知道命令行可能不准确
但是我输入的不起作用。我只是在 path 和 path__ 中获取所有内容。我想要的是一个里面看起来像这样的档案:
.\
path\
data\
files\
foo\
bar\
<everything in path\data\files\foo\bar except for foo.dat>
path__\
data\
<everything in path__\data\ except for slug.mp3>
Run Code Online (Sandbox Code Playgroud)
我能帮我得到这个结果吗?谢谢