MySQL, Oracle, Linux, 软件架构及大数据技术知识分享平台

网站首页 > linux / 正文

Linux常用工作目录切换命令

2024-11-26 16:46 huorong linux 6 ℃ 0 评论

pwd

显示当前工作目录

root@LAPTOP-158VEVJ1:/# pwd
/

cd

用于切换工作路径

  • cd.. 返回上一级目录
  • cd ~ 回到当前用户加目录
  • cd ~username 切换到其他用户家目录

ls

用于显示目录中的文件信息
-a 可查看所有文件(包含以.开头的隐藏文件)

root@LAPTOP-158VEVJ1:~# ls -a
.  ..  .bash_history  .bashrc  .config  .profile  .viminfo

-l 查看文件的属性、大小等详细信息

root@LAPTOP-158VEVJ1:~# ls -al
total 12
drwx------ 1 root root  512 Jun 29 21:08 .
drwxr-xr-x 1 root root  512 Jun 29 20:35 ..
-rw------- 1 root root  710 Jun 29 22:47 .bash_history
-rw-r--r-- 1 root root 3106 Dec  5  2019 .bashrc
drwx------ 1 root root  512 Jun 29 21:08 .config
-rw-r--r-- 1 root root  161 Dec  5  2019 .profile
-rw------- 1 root root 1426 Jun 25 10:52 .viminfo

-d用来查看目录的属性信息

root@LAPTOP-158VEVJ1:~# ls -ld /ronghe/home
drwxr-xr-x 1 root root 512 Jun 29 20:35 /ronghe/home

?

Tags:linux 上级目录

控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言