In bash, check that the remote port is open:
echo >/dev/tcp/8.8.8.8./53 && echo "Open"
Suspend the process Ctrl + Z, is not omnipotent, there is a program to capture the signal. The pending process stops executing, letting its background execute with BG, recovering the foreground FG
Generates a random 16 binary number, n is the number of characters: OpenSSL Rand-hex n
You can also generate-base64 passwords
If you want to execute a command in a non-shell script, such as. Bashrc,bash_profile, you can use the source File.name
Extract the first 5 characters of a string: ${variable:0:5}
Use wget to get the full list of directories to local
Wget-r--no-parent--reject "index.html*" http://hostname/-p/home/user/dirs
Download wget-m ftp://username:[email protected] from FTP
Create multiple directories at the same time: mkdir =p/home/user/xxx{test,test1,test2}
Gets the MD5 value of the text: echo-n "text" |md5sum
Extract the tar.gz to the development directory: TAR-XZVF package-c dir
Get HTTP headers with Curl: Curl-i http://xxx
Modify the timestamp of a file or directory (YYMMDDHHMM): touch-t 0712250000 file
Generate random password (16 characters here)
Lang=c </dev/urandom tr-dc _a-z-a-z-0-9|head-c ${1:-16};echo;
Create a backup simple notation: CP FILE{,.BKP}
Update time from Ubuntu NTP server: Ntpdate ntp.ubuntu.com
Mount the root file system in read-write mode Mount-o REMOUNT,RW/
Recursively grep all directories, find file name: Grep-r "Name"/path
Prompt without permission when executing command, can sudo!!
Convert tab to spaces expand Test.txt > New.txt
Enter a command on the command line to find forgot to add sudo and so on, can uh, CTRL + A, move the cursor to the beginning, ctrl+d delete the character at the cursor, ctrl+e move to the tail
linux-Small Command Tips