linux-Small Command Tips

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.