大数据Linux常用命令1

1.

[root@node1 ~]#

root 默认管理员 最大权限
node1 机器名称
~ 当前该用户的 家目录 /root

2.pwd 查看当前光标所在的目录 路径

[root@node1 ~]# pwd
/root

3.ls 查看

ls 显示文件夹 文件名称
ls -l 显示额外信息 权限 用户用户组 时间 大小
ls -l -a 也显示隐藏文件夹 文件
[root@node1 ~]# ls -l -a
total 40
dr-xr-x---. 6 root root 4096 Apr 15 21:51 .
dr-xr-xr-x. 17 root root 4096 Aug 8 2018 ..
-rw-------. 1 root root 3814 Apr 15 21:49 .bash_history
-rw-r--r--. 1 root root 18 Dec 29 2013 .bash_logout
隐藏文件夹 文件是以.开头

ls -l -h 仅仅查看文件的大小
ls -l -r -t 按时间排序如何快速找到哪些文件 更新了

ls -l ==》ll 等价
ll -a
ll -rt
ll -h

4.mkdir 创建文件夹

[root@node1 ~]# mkdir bigdata
[root@node1 ~]# 
[root@node1 ~]# ls
bigdata
[root@node1 ~]#

mkdir dir1 dir2 dir3 并
mkdir -p dir4/dir5/dir6 串 级联创建

5.cd 切换目录 路径

[root@node1 ~]# cd /
Linux系统 从根目录 标识 /

cd dir1 进入dir1文件夹
cd ../ 退上一层目录
cd ../../ 2层


root用户 家目录 /root
普通xx用户 家目录 /home/xx
家目录 是 ~ 表示 
如何进家目录:
cd /root
cd 直接回车 
cd ~

cd - 回退到上一次的目录
[root@node1 ~]# cd dir4
[root@node1 dir4]# cd dir5/dir6
[root@node1 dir6]# 
[root@node1 dir6]# cd -
/root/dir4
[root@node1 dir4]#

6.命令帮助 help

[root@node1 /]# ls --help
Usage: ls [OPTION]... [FILE]...

[]标识的 可选
... 多个参数

Usage: ls [OPTIONS]
Usage: ls XXX [OPTIONS]

List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
posted @ 2020-06-19 15:50  夏天换上冬装  阅读(225)  评论(0编辑  收藏  举报