首页 > 数据库 > Oracle > ORACLE学习过程中常用的简单LINUX命令
|
1 |
useradd test1(创建用户) passwd oracle(密码) su -oracle(切换到oracle用户) su -test1(切换到test1用户) groupadd test_group(创建用户组test_group) id test1 useradd -g test_group test1(建用户时分配了组)(g是主组) usermod -g test_group test1;(修改)
useradd -a -G test_group1
test1(a 是增加附属组) |
||||||||||
|
2 |
运行指令 ls -l /etc/x11 ls (看当前目录下有什么东西) ls -tlr(查看排序之后反向的数据)
|
||||||||||
|
3 |
cp 命令 cp file2 test_dir/file222 cp /tmp/dir/file2 /tmp/dir/test_dir/(是否替换掉) cp -r dir/ /usr/ rm file(删除文件) rm -f file(直接删除不提示) rm - rf file(强制删除) |
||||||||||
|
4 |
重启: reboot shutdown -r now init 6 |
||||||||||
|
5 |
关机 shutdown -h now init 0 |
||||||||||
|
6 |
建立链接 硬链接--- ln file2 test_dir/file5 软连接--- ln -s file2 test_dir/file5 |
||||||||||
|
7 |
su -oracle pwd cd ..(退到上一级目录) cd /tmp/dir cd -(回到上一级目录) cd admin cd !$(记录上一条命令的最后一行) !490(查看以前所用过的命令)‘’ |
||||||||||
|
8 |
umask cd flash/ mkdir dir ll cd vim .bash_profile umask 002 source .bash_profile |
||||||||||
|
9 |
/bin 存储常用用户指令 /boot 存储核心、模块映像等启动用文件 /dev 存储设备文件 /etc 存储系统、服务的配置目录和文件 /home 存放个人主目录 /lib 存放库文件,诸如核心模块、驱动 /lost+found 回收站 /mnt 系统加载文件系统时用的常用挂载点 /opt 第三方工具使用的安装目录 /root root用户的主目录 /sbin 存储系统管理用指令 /tmp 临时文件的暂存点
|
||||||||||
|
10 |
find find / -name abcde -exec rm f {} \; |
||||||||||
|
|
cat /etc/passwd |grep oracle(管道) cat /etc/passwd |grep oracle |wc -l cat /etc/passwd |wc -l |
||||||||||
|
11 |
bash在用户登录时从四个文件中读取环境设定 ----全局设置文件(需要再次生效) /etc/profile ---su oracle vim bash_profile alias ee='ls -l' ..bash_profile(再次生效)或者source bash_profile ---用户设置变量(不需要再次生效) /etc/bashrc vim bashrc alias ee ='ls -l' ~/.bashrc ~/.bash_profile |
||||||||||
|
12 |
查看当前主机名:hostname vim /etc/sysyconfig/network 查看当前内存情况:free 查看当前系统的资源状态:top 查看进程的指令:ps ps -ef|grep ora_ kill -9(强制干掉进程) jobs |
||||||||||
|
13 |
运行shell脚本 Sh /路径/脚本名
|
||||||||||
|
14 |
cat /etc/redhat-release uname -r cat /etc/issue
|
||||||||||
|
15 |
RPM 安装与卸除 ---安装rpm -I --升级 rpm -U --更新 rpm -F --卸除 rpm -e 补充参数 --输出用:-v -h --预设条件: --nodeps ,---force --重定位:--root
|
||||||||||
|
16 |
exit(退到上一级用户) |
||||||||||
|
17 |
man |
||||||||||
|
18 |
q(退出) |
||||||||||
|
19 |
df -h (查看磁盘容量) du(查看文件大小) du -sh /u01(查看u01目录有多大) du -h du -s |
||||||||||
|
20 |
wc cat test | wc -l cat test |grep 000| wc -l |
||||||||||
|
21 |
tar -zcvf abc.tar.gz.abc(创建压缩包) tar -zxvf abc.tar.gz.abc -C /tmp -C(解压到什么地方) |
||||||||||
|
22 |
uname -a (查看内核版本)
uname -r(查看内核型号) |
||||||||||
|
|
|
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30606702/viewspace-1993221/ ,如需转载,请注明出处,否则将追究法律责任。