linux個人操作習慣,linux個人習慣

來源:互聯網
上載者:User

linux個人操作習慣,linux個人習慣
編輯~/.bashrc檔案加入以下內容,定義別名# .bashrc # User specific aliases and functionsalias rm='rm -i'alias cp='cp -i'alias mv='mv -i'alias cls='clear'      #DOS下的清屏命令,也可以用Ctrl+L,簡單快速alias ls='ls -ltr --color=always'   #通過顏色辨別檔案類型alias vi=vim              #預設讓vim成為編輯器,vim有文法高亮功能,可以在編寫指令碼時發現錯誤alias ..='cd ..'            #輸入..直接斷行符號,回上級目錄更簡單快捷alias ..2='cd ../..'alias ..3='cd ../../..'alias ..4='cd ../../../..'alias ..5='cd ../../../../..'alias grep='grep --color=auto'    #通過grep搜尋出的檔案高亮顯示# Source global definitionsif [ -f /etc/bashrc ]; then    . /etc/bashrcfi 全部修改完後儲存退出,source   ~/.bashrc  使之生效 # .bash_profile # Get the aliases and functionsif [ -f ~/.bashrc ]; then    . ~/.bashrcfi # User specific environment and startup programs PATH=$PATH:$HOME/bin:/usr/bin/pythonexport CDPATH=.:~:/etc:/var:/root/Desktopexport PATHunset USERNAMEfunction mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; }  修改vim 的設定檔 設定行號,每次啟動時都自動顯示,vi  ~/.vimrc設定檔(Redhat)/etc/sysconfig/network-scripts/* : 網卡/etc/sysconfig/network-scripts/ifcfg-eth0/etc/resolv.conf: DNS配置命令列ifconfig [eth0]# ifconfig eth0 202.38.85.10 netmask 255.255.255.0 broadcast 202.38.85.255ifup [eth0]  啟動網卡ifdown [eth0] 禁用網卡IP轉寄:/proc/sys/net/ipv4/ip_forward為1/etc/sysconfig/networkFORWARD_IPV4=YES主機名稱設定設定檔 : /etc/sysconfig/network命令列:  #hostname [host]/etc/hosts 配置IP  long_name  short_name  alias127.0.0.1  localhost.localdomain localhost localhost  修改系統檔案之前要先備份一下,進入一個系統留意一下/boot/grub的內容,並且注意分區的資訊

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

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.