目录
Linux安装 基础命令 ls ll cd pwd mkdir rmdir touch cp mv rm vi/vim >和>> cat head less more tail echo clear which
进阶命令 其他命令
Linux安装
通过vmware设置模拟硬件环境 安装centos系统 进行相应的网络配置 安装xshell bin 存放二进制可执行文件 (ls,cat,mkdir等) boot 存放用于引导时 使用的各种文件 dev 用于存放设备文件 etc 存放系统配置文件 home 存放所有用户文件的根目录 lib 存放跟文件系统中的程序运行所需要的共享 及内核 模块 mnt 系统管理员安装临时文件 系统的安装点opt
基础命令
ls
ls /usr/local
ls -l /usr/local
ls -alh /usr/local
ll
ll /usr/local
cd
cd /
cd ..
pwd
pwd
mkdir
mkdir aa
mkdir -p /yy/zz
rmdir
rmdir aa
touch
touch a.txt b.txt
touch /test/aaa.txt
cp
cp a.txt b.txt
cp -r 复制目录
mv
mv aaa.txt /test/a3.txt
rm
rm -rf a.txt
rm -rf a.txt b.txt
vi/vim
vi /etc/profile
>和>>
> 输出重定向
> 覆盖输出
> 追加输出
cat
cat /test/aaa.txt
cat a.txt b.txt
head
head -10 a.txt
less
more
分页显示 按空格键显示下一页,ctrl+b返回上一页
v 调用vi编辑器
q 退出
tail
tail -10 aaa.txt
tail -f aaa.txt
echo
echo "hello world"
echo "hello java" > /test/a.txt
echo "hello java" >> /test/z.txt
echo -e "hellon"
clear
清空屏幕
ctrl+L
which
which is
进阶命令
du -sh /etc
df -h
free -m
free -g
wc -l 01.txt
wc -c 01.txt
wc -m 01.txt
wc -w 01.txt
date
date +"%Y-%m-%d %H:%M:%S"
date -d "1 month ago"
date -s "2024-06-24 15:01:52"
cal
cal 2024
cal 5 2025
cat /usr/local/01.txt | grep -i linux
grep linux 01.txt
ls / | grep 01.txt
cat a.txt | grep linux
cat a.txt | grep -v linux
find /test -name a.txt
find /test -name "a*"
find ./ -size +10c
find ./ -size -10k
find ./ -size -10M
find ./ -size -10G
find ./ -type
useradd user01
passwd user01
su user01
exit
userdel -rf user01
chmod 777 a.txt
chmod u-x a.txt
chown user01 a.txt
chgrp user01 a.txt
charp -R user01 test
ps -ef | grep mysql
top
tar -zcvf /test.tar.gz /test/
tar -zxvf /test.tar.ga -C /test
yum install bzip2
tar -jcvf /test.tar.gz /test/
kill -9 进程号
systemctl status firewalld
systemctl stop filewalld
systemctl start firewalld
rpm -qa | grep mysql
rpm -ivh
yum install **
yum remove **
yum update **
yum upgrade **
yum list
其他命令
ip addr
ifconfig
reboot
init 0
history
who
whoami
hostname
hostnamectl set-hostname hadoop
echo hello world | cut -d " " -f 1
cut -d ":" -f 1 -3 passwd
cut -d ":" -f -3 passwd
cat /etc/passwd | sort
cat /etc/passwd | sort -n
cat /etc/passwd | sort | uniq
yum install tree
tree /tmp/
yum install net-tools
netstat -tunlp