[英]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.