[英]Hidden (or not commonly known) windows and unix commands?
在您知道的UNIX和Windows中,一个通常不为人知的命令是什么?
听说Windows包含几个隐藏的应用程序,这些应用程序有时可能非常有用。
linux:历史记录(命令行历史记录)
抱怨(针对所有图像需求/操作)
屏幕(用于通过ssh注销后运行的程序)
在寡妇XP中,如果您曾经尝试做过这样的事情
cd \\pc\c$
您将收到错误
CMD does not support UNC paths as current directories.
好吧,只要将它们映射到临时驱动器号,就可以使用UNC路径。
pushd \\pc\c$
然后,当您只想返回...
popd
视窗:
fdisk /mbr
Linux分区发疯之后,挽救了我的生命(和系统)。
Linux:
strace
与我从登录的shell上运行telnet的同学轻松获取密码;-)
我不确定这是否算作未知数,但是rsync
是无价的。
在旧版本的Windows(尤其是XP)中,我发现shutdown命令非常有用。 例如:
shutdown /s /t 3600
将在一小时内关闭计算机。 当然,Linux具有类似的命令(我想说大多数Linux用户都非常熟悉“ shutdown -h now”),但是Windows的等效语言却鲜为人知。
我之所以提到Windows的较早版本,是因为在较新的Windows版本中(我肯定知道的Vista,而不是Windows Server 200x),关机功能有些混乱。 例如,您只能将最大等待时间设置为十分钟,如果您希望在下载完成后一两个小时内关闭计算机,这将使其无用。
主机文件可用于过滤在线广告。
在bash的〜/ .bashrc文件中:
set -o vi
并在〜/ .inputrc中
set editing-mode vi
set keymap vi
另外,使用!$避免重新键入:
ls long/dir/name/i/dont/want/to/repeat/file.txt
rm !$
在Unix中:apropos (对所需内容的大致了解) | 减
在Windows XP +上:
fsutil
,文件系统实用程序。 当我必须创建特定大小的测试文件( fsutil file createnew <filename> <length>
)时,会使用此文件。 netstat
,显示协议统计信息和当前的TCP / IP网络连接。 netsh
,网络服务外壳; 命令行钩入各种网络信息。 reg
(注册表外壳),用于从命令行使用注册表。 在Windows上,我曾经喜欢gpedit.msc,但我认为它仅在某些XP版本上
当然要注册
可执行文件
如果管理员可以访问网络中的某些计算机,则可以使用管理控制台的裸机版来完成出色的工作。
在PowerShell中,您可以:
cd \\server\c$\
在Windows中,我可以使用SET alot轻松获取计算机的基本信息。 还有:IPCONFIG / FLUSHDNS,IPCONFIG / REGISTERDNS(用于清除和重新加载dns条目),TRACERT(用于跟踪您的位置与网络/互联网上另一个位置之间的路径),NETSTAT -s -p tcp(用于网络统计),和PATHPING(像ping但更好!)
我发现findstr
相对未知,至少我不知道。 这与grep
大致相当,当您不需要或不需要安装诸如mingw或cygwin甚至本机生成的grep
。
c:\Users\logan>findstr /?
Searches for strings in files.
FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
[/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
strings [[drive:][path]filename[ ...]]
/B Matches pattern if at the beginning of a line.
/E Matches pattern if at the end of a line.
/L Uses search strings literally.
/R Uses search strings as regular expressions.
/S Searches for matching files in the current directory and all
subdirectories.
/I Specifies that the search is not to be case-sensitive.
/X Prints lines that match exactly.
/V Prints only lines that do not contain a match.
/N Prints the line number before each line that matches.
/M Prints only the filename if a file contains a match.
/O Prints character offset before each matching line.
/P Skip files with non-printable characters.
/OFF[LINE] Do not skip files with offline attribute set.
/A:attr Specifies color attribute with two hex digits. See "color /?"
/F:file Reads file list from the specified file(/ stands for console).
/C:string Uses specified string as a literal search string.
/G:file Gets search strings from the specified file(/ stands for console).
/D:dir Search a semicolon delimited list of directories
strings Text to be searched for.
[drive:][path]filename
Specifies a file or files to search.
Use spaces to separate multiple search strings unless the argument is prefixed
with /C. For example, 'FINDSTR "hello there" x.y' searches for "hello" or
"there" in file x.y. 'FINDSTR /C:"hello there" x.y' searches for
"hello there" in file x.y.
Regular expression quick reference:
. Wildcard: any character
* Repeat: zero or more occurrences of previous character or class
^ Line position: beginning of line
$ Line position: end of line
[class] Character class: any one character in set
[^class] Inverse class: any one character not in set
[x-y] Range: any characters within the specified range
\x Escape: literal use of metacharacter x
\<xyz Word position: beginning of word
xyz\> Word position: end of word
For full information on FINDSTR regular expressions refer to the online Command
Reference.
我只是想把它放入今天在5台Windows XP机器上使用的时候。
systeminfo
为您提供系统详细信息的列表,包括操作系统,修补程序/更新,硬件和网络信息。 当然,您可以在其他许多地方(通过命令或在GUI中)获得所有这些信息,但这是一个很好的命令,可以非常快速地找到有关机器的大量信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.