Linux系統命令歸納

2021-09-20 08:02:48 字數 1750 閱讀 4504

常規操作命令:

# ntsysv    圖形化網路設定頁面

# openssl passwd -1 -salt `openssl rand -hex 4`

# createrepo redhat/

新增fstab掛載:/192.168.1.250:/file/abc nfs defaults,_netdev 0 0

# fuser -kv /rhome      # fusermount -u -z /mnt/         強制乾掉

# cat /etc/sysctl.conf ==>net.ipv4.ip_forward=1     開啟路由**

# stty -echo   隱藏輸入字元 stty echo 恢復

# yum provides */sbin/powertop # yum provides */bin/powertop

# ps aux|grep mysql|xargs kill -9

# setfacl -m -r u:tom:rw dir 不能執行 # setfacl -r -m u:tom:rw dir

能執行

技能操作命令:

1.刪除目錄下所有,只保留指定檔案:

# find /xx -type f ! -name "file10"|xargs rm -f

2.檢視伺服器資訊:

# dmidecode |grep 「product name」

# grep name /proc/cpuinfo

# grep mentotal /proc/meminfo

# uname -r

# env

# more /etc/redhat-release

磁碟相關資訊:

# df -lh

# du -lh

# free -m

# fdisk -l |grep dev

3.修改時間

date命令將日期設定為2023年6月18日

# date -s 06/18/14

將時間設定為14點20分50秒

# date -s 14:20:50

4.centos7忘記root密碼

grub介面---》按e---》vmlinuz行尾新增init=/bin/sh ---》ctrl+x ---》

#mount -o remount,rw / ---》刪除密碼---》exec /sbin/init

注:7.3版本進入緊急模式後需要關閉selinux,否則無法重啟。

5.history記錄檢視

6.centos7修改主機名

# hostnamectl status

# hostnamectl set-hostname "master"

# hostnamectl master

重新登入,主機名生效

# logout

注:

1.通過sysctl.conf檔案修改的核心引數不會立刻生效,要用sysctl -p 啟用

羅穆瑞出處:

linux命令歸納

自己也在學習過程中,常用的命令,一點一點積累。一 ls 常用組合如下 ls alt 按修改時間排序 ls sort time la 等價於 ls alt ls alc 按建立時間排序 ls alu 按訪問時間排序 以上均可使用 r實現逆序排序 ls alrt 按修改時間排序 ls sort time...

Linux部分命令歸納

一.diff 1.作用 用於兩個檔案之間的比較,並指出兩者的不同,它的使用許可權是所有使用者。2.格式 diff opptions 原始檔 目標檔案 3.舉例 diff home 1 2 比較檔案1和檔案2 二.top 1.作用 用來顯示執行中的程式程序,使用許可權是所有使用者 2.格式 top d...

Linux基礎命令歸納大全

linux發行版本 基於linux核心提供桌面環境及辦公套件的作業系統 linux核心只有乙個 1.啟動終端的快捷鍵 ctr alt t 2.終端字型放大 ctr shift 3.終端字型縮小 ctr 4.ls 檢視當前目錄的檔案資訊 4.1 ls 路徑 檢視指定目錄的資訊 5.pwd 檢視目錄所在...