คำสั่งพื้นฐาน CentOS ที่ถูกใช้งานบ่อยๆ
แสดงไฟล์ที่อยู่ part นั้น
$ ls $ ls -R $ ll
ลบไฟล์
$ rm -r filename.xx $ rm -rvf folder
ย้ายไฟล์
$ mv home newfile $ mv workplace testfile1 Downloads
คัดลอกไฟล์
$ cp filename Directoryname $ cp testfile2 testfile3 Downloads
สร้างโฟลเดอร์
$ mkdir Samreenatasks
สร้างไฟล์
touch filename touch index.php
Create Symlinks – using ln command
$ ln -sf ~/bin/topprocs.sh topps.sh $ ls -l topps.sh
ให้สิทธิ์กับโฟลเดอร์
$ chmod 777 -R directory_name
ค้ณหาไฟล์
locate -i hello
apt-get
sudo apt-get [options] [command] sudo apt-get update sudo apt-get install vlc
Creating a new group
# groupadd common_group
Map group to user
usermod -aG common_group user1
Adding User Accounts
$ adduser [new_account] $ useradd [new_account]
Deleting a group
groupdel [group_name]
Check groups
$ groups
Removing user accounts */etc/passwd
$ userdel -r [username] $ userdel --remove [username] #แบบนี้จะลบสิทธิ์ที่เคยเพิ่มในไฟล์ต่างๆออกด้วย
Understanding */etc/passwd
[username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell]
Understanding /etc/group
[Group name]:[Group password]:[GID]:[Group members]
Check Port เครื่องปลายทาง
Single port:
$ nc -zv 127.0.0.1 80
Multiple ports:
$ nc -zv 127.0.0.1 22 80 8080
Range of ports:
$ nc -zv 127.0.0.1 20-30
nslookup
$ yum install bind-utils $ nslookup
list network services using netstat
sudo yum install net-tools netstat -pnltu netstat -pnltu | grep $port
ข้อมูลอ้างอิงจาก https://explainshell.com/
Uninstalling Using the RPM Installer
To uninstall a Micro Focus product:
rpm -qa | grep Micro_Focus
rpm -e [ PackageName ]
Uninstalling several installation packages simultaneously
If you installed the same package more than once on the same machine using the --nodeps --prefix command line options, to remove all of these installations execute the following command:
[ as root ] rpm -e --allmatches [ package name ]