Linux 基本命令

2022-02-13 02:45:14 字數 891 閱讀 4438

修改環境變數 vim ~/.bashrc  

儲存退出,輸入以下命令使之立即生效 source ~/.bashrc

/etc/profile:在登入時,作業系統定製使用者環境時使用的第乙個檔案,此檔案為系統的每個使用者設定環境資訊,當使用者第一次登入時,該檔案被執行.

/etc/environment:在登入時作業系統使用的第二個檔案,系統在讀取你自己的profile前,設定環境檔案的環境變數

~/.profile:在登入時用到的第三個檔案是.profile檔案,每個使用者都可使用該檔案輸入專用於自己使用的shell資訊,當使用者登入時,該檔案僅僅執行一次!預設情況下,他設定一些環境變數,執行使用者的.bashrc檔案.

/etc/bashrc:為每乙個執行bash shell的使用者執行此檔案.當bash shell被開啟時,該檔案被讀取.

~/.bashrc:該檔案包含專用於你的bash shell的bash資訊,當登入時以及每次開啟新的shell時,該該檔案被讀取.

通常設定環境變數有三種方法:

一、臨時設定

export path=/home/yan/share/usr/local/arm/3.4.1/bin:$path

二、當前使用者的全域性設定

開啟~/.bashrc,新增行:

export path=/home/yan/share/usr/local/arm/3.4.1/bin:$path

使生效source .bashrc 

三、所有使用者的全域性設定

$ vim /etc/profile 

在裡面加入:

export path=/home/yan/share/usr/local/arm/3.4.1/bin:$path

使生效source profile

測試 echo $path 

linux基本命令

linux常用命令 基礎 eg man ls 就可以檢視ls相關的用法 注 按q鍵或者ctrl c退出,在linux下可以使用ctrl c終止當前程式執行。2.ls 檢視目錄或者檔案的屬 列舉出任一目錄下面的檔案 eg ls usr man ls l a.d表示目錄 directory 如果是乙個 ...

《linux基本命令》

博主部落格 斷橋殘雪 uname 顯示版本資訊 同win2k的 ver dir 顯示當前目錄檔案,ls al 顯示包括隱藏檔案 同win2k的 dir pwd 查詢當前所在的目錄位置 cd cd 回到上一層目錄,注意cd 與.之間有空格。cd 返回到根目錄。cat 檔名 檢視檔案內容 cat abc...

LINUX 基本命令

檔案和目錄操作的基本命令 cat clear cmp cut diff du emacs fgrep file grep head ln less more pico pwd sort stat strings tail touch umask uniq vi wc whatis ls ls 選項 ...