Linux skills that should be learned today

Source: Internet
Author: User
The Linux skills you should learn today-general Linux technology-Linux technology and application information. The following is a detailed description. Delete all files in the directory, including subdirectories
Rm-rf directory name

Set/delete environment variables in Character Mode
Under bash
Set: export variable name = variable value
Delete: unset variable name
Under csh
Set: setenv variable name variable value
Delete: unsetenv variable name

Unzip
Tar-imo-bunzip2command can decompress the. bz2 File
Tar xvfj example.tar.bz2
Tar xvfz example.tar.gz
Tar xvfz example. tgz
Tar xvf example.tar
Unzip example.zip
Tar-jvxf some. bz is to change zvxf of tar to jvxf.
Zip/tar rh8 has a graphical interface software file-roeller to do this. In addition, you can use unzip *. zip to unzip the file and unrar *. rar to unzip the rarfile. However, unrar is generally not provided by the system and must be downloaded from the Internet.
# Rpm2cpio example. rpm │ cpio-div
# Ar p example. deb data.tar.gz | tar zxf-
Alien provides conversion between compression formats such as. tgz,. rpm,. slp, And. deb:
Http://sourceforge.net/projects/alien
SEx provides decompression interfaces for almost all visible compression formats:
Http://sourceforge.net/projects/sex

Tar compression and decompression usage
Decompress: x
Compression: c
For gz: z
For bz2: j
Used to display: v

Decompress the instance
Gz file: tar xzvf xxx.tar.gz
Bz2 file: tar xjvf xxx.tar.bz2

Compressing an instance
Gz file: tar czvf xxx.tar.gz/path
Bz2 file: tar cjvf xxx.tar.bz2/path

Use dd for iso
Dd if =/dev/cdrom of =/tmp/aaa. iso

Use ssh to copy files
Assume that both A and B have the SSH service.
1. Copy B from A (pushed over)
Scp-rp/path/filename username @ remoteIP:/path
2. copy from B to A (pull)
Scp-rp username @ remoteIP:/path/filename/path
If one of them is not a LINUX system, you can use SecureFX on WINDOWS.

Change the Mixed Mode of eth0
Change the network adapter eth0 to the hybrid mode:
Ifconfig eth0 promisc
Disable the hybrid mode:
Ifconfig eth0-promisc

How to enable ssh to allow only specified users to log on
Method 1: add the/etc/pam. d/sshd File
Auth required pam_listfile.so item = user sense = allow file =/etc/sshusers onerr = fail
Create the sshusers file under/etc, edit the file, add the user name that you are allowed to use the ssh service, and restart the sshd service.
Method 2: pam rules can also be written as deny
Auth required pam_listfile.so item = user sense = deny file =/etc/sshusers onerr = succeed
Method 3: Set AllowUsers in sshd_config. The format is as follows:
AllowUsers a B c
To restart the sshd service, only a/B/c3 users can log on.
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.