Linux學習中的一些Q A

2021-10-18 22:29:46 字數 613 閱讀 7344

#adduser amy

//新增乙個名為amy的使用者

#passwd amy //修改密碼

changing password for user amy.

new unix password:

//在這裡輸入新密碼

retype new unix password:

//再次輸入新密碼

passwd:

all authentication tokens updated successfully.

(2)賦予root許可權

修改 /etc/sudoers 檔案,找到下面一行,把前面的注釋(#)去掉

## allows people in group wheel to run all commands
%wheel all=

(all) all

然後修改使用者,使其屬於root組(wheel),命令如下:

#usermod -g root amy
修改完畢,現在可以用amy帳號登入,然後用命令 su – ,即可獲得root許可權進行操作。

Linux的一些學習筆記

linux記憶體管理 實體地址是虛擬位址的子集 64位cpu定址64tb mmu將cpu發出的虛擬位址變為實體地址,交給記憶體匯流排 段式位址轉換,頁式位址轉換 記憶體申請和釋放,kmalloc和kfree static void malloc int size 要申請size位元組大小的記憶體空間...

Linux中的一些命令

touch 檔名稱已經存在 更新時間 檔名不存在,建立空檔案 mkdir make directory 建立空目錄 如 mkdir dir 1 新增使用者 出現的目錄非空 r r 遞迴 mv 轉移檔案或重新命名 檔案許可權中 表示檔案型別的位置 d 目錄 藍色 檔案 綠色 紅色 黑色 l 鏈結檔案 ...

學習中的一些筆記

取得某字元最後出現處起的字串。語法 string strrchr string haystack,string needle 返回值 整數 函式種類 資料處理 內容說明 本函式用來尋找字串 haystack 中的字元 needle 最後出現位置,並將此位置起至字串 haystack 結束之間的字串返...