简体   繁体   English

隐藏(或不常见)的Windows和Unix命令?

[英]Hidden (or not commonly known) windows and unix commands?

What is that one not usually known command in unix and windows that you know? 在您知道的UNIX和Windows中,一个通常不为人知的命令是什么?

It is heard that windows contains several hidden applications which sometimes may be very useful. 听说Windows包含几个隐藏的应用程序,这些应用程序有时可能非常有用。

linux: history (history of command line) linux:历史记录(命令行历史记录)

mogrify (for all image needs/operations) 抱怨(针对所有图像需求/操作)

screen (for running programs after logging off via ssh) 屏幕(用于通过ssh注销后运行的程序)

In widows XP if you have ever tried to do somthing like this 在寡妇XP中,如果您曾经尝试做过这样的事情

cd \\pc\c$

You will have recieved the error 您将收到错误

CMD does not support UNC paths as current directories.

Well you can use UNC paths as long as you map them to a temp drive letter like so. 好吧,只要将它们映射到临时驱动器号,就可以使用UNC路径。

pushd \\pc\c$

Then when you want to return simply... 然后,当您只想返回...

popd

Windows: 视窗:

fdisk /mbr

Saved my life (and system) after a Linux partition went berserk. Linux分区发疯之后,挽救了我的生命(和系统)。

Linux: Linux:

strace

Came handy getting passwords with classmates running a telnet from a shell I was logged in ;-) 与我从登录的shell上运行telnet的同学轻松获取密码;-)

我不确定这是否算作未知数,但是rsync是无价的。

In older versions of Windows (XP, in particular), I found the shutdown command invaluable. 在旧版本的Windows(尤其是XP)中,我发现shutdown命令非常有用。 For example: 例如:

shutdown /s /t 3600

will shut down the computer in an hour. 将在一小时内关闭计算机。 Linux, of course, has a similar command (I'd say the majority of Linux users are intimately familiar with "shutdown -h now"), but the Windows equivalent is less well known. 当然,Linux具有类似的命令(我想说大多数Linux用户都非常熟悉“ shutdown -h now”),但是Windows的等效语言却鲜为人知。

The reason I mentioned older versions of Windows is that in newer ones (Vista I know for sure, don't know about Windows Server 200x) the functionality of shutdown has been hobbled a bit. 我之所以提到Windows的较早版本,是因为在较新的Windows版本中(我肯定知道的Vista,而不是Windows Server 200x),关机功能有些混乱。 For example, you can only set a maximum wait time of ten minutes, which makes it useless if you want your computer to shut down in an hour or two, when a download is done. 例如,您只能将最大等待时间设置为十分钟,如果您希望在下载完成后一两个小时内关闭计算机,这将使其无用。

主机文件可用于过滤在线广告。

In bash's ~/.bashrc file: 在bash的〜/ .bashrc文件中:

set -o vi

and in ~/.inputrc 并在〜/ .inputrc中

set editing-mode vi
set keymap vi

Also, Using !$ to avoid retyping: 另外,使用!$避免重新键入:

ls long/dir/name/i/dont/want/to/repeat/file.txt
rm !$

In Unix: apropos (rough idea of what you want) | 在Unix中:apropos (对所需内容的大致了解) | less

On Windows XP+: 在Windows XP +上:

  • fsutil , the file system utility. fsutil ,文件系统实用程序。 I use this when I have to create test files of a specific size ( fsutil file createnew <filename> <length> ). 当我必须创建特定大小的测试文件( fsutil file createnew <filename> <length> )时,会使用此文件。
  • netstat , Displays protocol statistics and current TCP/IP network connections. netstat ,显示协议统计信息和当前的TCP / IP网络连接。
  • netsh , the network services shell; netsh ,网络服务外壳; command line hook into all sorts of network info. 命令行钩入各种网络信息。
  • reg , the registry shell, for working with the registry from the command line. reg (注册表外壳),用于从命令行使用注册表。

on windows i used to like gpedit.msc but i think its only on certain versions of xp 在Windows上,我曾经喜欢gpedit.msc,但我认为它仅在某些XP版本上

and regedit of course 当然要注册

mmc.exe 可执行文件

you can do amazing things with the bare-bone version of the management console, given admin access to some machines in a network. 如果管理员可以访问网络中的某些计算机,则可以使用管理控制台的裸机版来完成出色的工作。

在PowerShell中,您可以:

cd \\server\c$\

In Windows, I use SET alot to get the basic information of the computer easily. 在Windows中,我可以使用SET alot轻松获取计算机的基本信息。 There's also: IPCONFIG /FLUSHDNS, IPCONFIG /REGISTERDNS (to clear and reload dns entries), TRACERT (used to trace a path between your location and another on the network/internet), NETSTAT -s -p tcp (for network statistics), and PATHPING (like ping but better!) 还有:IPCONFIG / FLUSHDNS,IPCONFIG / REGISTERDNS(用于清除和重新加载dns条目),TRACERT(用于跟踪您的位置与网络/互联网上另一个位置之间的路径),NETSTAT -s -p tcp(用于网络统计),和PATHPING(像ping但更好!)

I find that findstr is relatively unknown, at least I didn't know about it. 我发现findstr相对未知,至少我不知道。 It's a rough equivalent to grep , nice when you're not necessarily wanting or needing to install something like mingw or cygwin or even a natively built grep . 这与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.

I just thought to put this in as I used it today about on 5 windows XP machines. 我只是想把它放入今天在5台Windows XP机器上使用的时候。

systeminfo

Gives you a list of your system details including os, hotfix/updates, hardware and network information. 为您提供系统详细信息的列表,包括操作系统,修补程序/更新,硬件和网络信息。 Sure you can get all this information in a lot of other places, either with commands or in the GUI but this is a great command to find out a lot about a machine very quickly. 当然,您可以在其他许多地方(通过命令或在GUI中)获得所有这些信息,但这是一个很好的命令,可以非常快速地找到有关机器的大量信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM