"José Big data for the next day" Linux command basics

Source: Internet
Author: User
Tags touch iptables

Linux basic commands: View IP:
ifconfig 或者 hostname -i(需要配置文件之后才可以使用)ipconfig(Windows)
To turn off the firewall:
Service iptables statuschkconfig iptables off
To configure a static IP address:
vi /etc/sysconfig/network-scripts/ifcfg-eth0    ONBOOT=yes    NM_CONTROLLED=no    BOOTPROTO="static"    IPADDR=192.168.137.200    NETMASK=255.255.255.0    GATEWAY=192.168.137.2    DNS1=10.64.0.10Service network restart
View file contents in real time
flume课会去讲解http://blog.itpub.net/30089851/viewspace-2134067/tail -F xxx.logecho "1" > xxx.log echo "2" >> xxx.log >:覆盖(慎用) >>:追加 -F参数 ==> -f --retry
Rename:
mv xxx1  xxx2
Copy:
cp xxx1 xxx2 以前的文件不动,产生新的文件    提醒:        xxx.default xxx.xml cp xxx.xml xxx.xml20171205 (养成备份习惯)
Output printing:
echo "123"
Alias: Alias (*)
alias 查看有哪些别名临时:    alias jh=‘cd /home/jepson‘    设置jh别名    =前后没有空格    永久:    alias jh=‘cd /home/jepson‘ 配置到环境变量文件,执行生效命令 cd jh
Environment variable Configuration: (* * *) Configure the Software's home
全局:    /etc/profile个人:    ~/.bash_profile 或者 ~/.bashrc        1.假设没有.bash_profile,怎么办?        2.注意.bash_profile的权限问题        生效:    source /etc/profile    . .bash_profile 或者 source .bash_profile
To delete a file:
rm 删除时需要询问rm -f xxx强制删除文件,不询问rm -r -f 或者 rm -rf 递归,强制删除文件夹    慎用:rm -rf / (手工)
Shell script:
[[Email protected] ~]# mkdir/home/jepson/001[[email protected] ~] # jpath= "/home/jepson/001" [[email protected] ~]# echo $jpath/home/jepson/001[[email protected] ~]# Touch/home/jepson/001/xxx.log[[email protected] ~]# echo $jpath/home/jepson/001[[email protected] ~]# RM- RF $jpath/*[[email protected] ~]# ll/home/jepson/001/total 0#逻辑错误导致jpath复制为 "" [[email protected] ~]# Touch/home/jepson/001/xxx.log[[email protected] ~]# jpath= "" [[email protected] ~]# echo $jpath [[Email Protected] ~]# RM-RF $jpath/* ==>RM-RF/*            
How to view the history command:
history 查看!142 执行142行的命令
Pipe character:
    |
How to filter out
grep例如:history | grep xxx
VI Command:
三种模式:    命令行模式、编辑模式、尾行模式1、三种模式怎么切换2、在命令行模式,光标跳到第一行第一个字母                       最后一行第一个字母                       一行的最后一个字母                       删除当前行                       删除当前行及所在的以下行3、假如文件内容满满的,我需要重新覆盖文件    ctrl + a,Ctrl + c --> gg + dg -->i,右键粘贴 -->esc -->shift + : --->wq

Big Data Course Recommendations:

"José Big data for the next day" Linux command basics

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.