Linux Learning Notes (i)--Beginner operations

Source: Internet
Author: User

The recent study of Hadoop, which requires Linux, has not been exposed before, so in the process of learning Hadoop, some basic knowledge of Linux has been accumulated, as follows:


1. Network Configuration

Ifconfig viewing network interface information;

Ping–c 4 192.168.0.144 Send a specified number of network test packages

Hostname Display the current host name

Setup invoke Settings interface

Service Network restart Restart networking service

Service iptables Status View firewall state

2. Turn off SELinux

Permanently valid:

Modify the Selinux= "" in the/etc/selinux/config file to Disabled, and then restart.

Immediate effect Setenforce 0

3. Turn off the firewall

Permanent effect

Open: Chkconfig iptables on

OFF: Chkconfig iptables off

Immediate effect, fail after reboot

Open: Service iptables start

Close: Service iptables stop

4. Delete command

The command to delete the directory under Linux is "RM";

Some of the parameters we used are "-f-i-r-v";

-I ask for confirmation before deleting.

-F Even if the original file property is set to read-only, forced deletion, the system will not let us confirm each.

-R Delete the directory and the following files. Note: If RM does not have this parameter, the directory cannot be deleted.

-V or--verbose displays the result information after the instruction executes.

5. Host and IP bindings

Edit: vi/etc/hosts Add a line

Verify: Ping–c 4 host Name

6. Extracting files

*.tar Unzip with tar xvf

*.gz extract with gzip-d or gunzip

*.tar.gz and *.tgz unzip with tar XZVF

*.BZ2 with bzip2-d or with BUNZIP2 decompression

*.TAR.BZ2 Unzip with tar XJF

*. Z Extract with Uncompress

*.tar. Z Unzip with tar Xzf

*.rar with Unrar e decompression

*.zip decompression with unzip

7. Modify the current host name

Immediate EFFECT: hostname XXX modifies the current host name

Permanently valid: Vi/etc/sysconfig/network

8. Set up SSH

SSH-KEYGEN-T RSA generates secret key with RSA algorithm

cd. SSH into the. SSH directory

LS view files in this directory: Id_rsa id_rsa.pub

More Id_rsa.pub View key contents

CP id_rsa.pub Authorized_keys copy secret key

SSH localhost login verification

9. View and set the time

Clock--show viewing hardware time

Clock--set--date= "05/09/15 23:25" Set hardware time

Date View system time

Clock--hctosys synchronizing system clocks with hardware clocks

NOTE: HC represents hardware time, SYS represents system time

10. Error logging

1.q:error,some other host already uses address;

A: Edit the file/etc/sysconfig/network-scripts/ifup-eth and comment out the following text:

if! Arping-q-C 2-w ${arping_wait:-3}-d-i ${realdevice} ${ipaddr}; Then

Net_log $ "Error, some other host already uses address${ipaddr}."

Exit 1

Fi

Restart Network Service



Linux Learning Notes (i)--Beginner operations

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.