Linux——Linux目录结构及命令提示符

2 篇文章 0 订阅
2 篇文章 0 订阅

一、Linux目录结构

设计哲学:

一切皆文件!!!

/			根目录
	/root		root用户的家目录/宿主目录
	/home		普通用户的家目录/宿主目录
	/etc		应用程序的配置文件
	/dev		存储设备文件(磁盘、分区)
	/boot		内核、启动配置文件
	/proc		动态文件,记录包括CPU、内存、网卡、进程的使用情况的文件
	/lib64		库文件、保证某应用程序可正常运行
	/opt		用户的工作目录,保存下载工具、软件、文档
	/tmp		临时目录
	

二、命令提提示符

调大字体:ctrl+shift+
调小字体:ctrl -

[root@localhost ~] #
		root:当前登陆系统的用户名
		localhost:默认的主机名
		~: 当前目录;~当前用户的家目录
		#:管理员		$:普通用户

三、文件目录基本管理指令

1、切换、查看目录

格式:

cd [目录名称]
[root@wtl ~]# cd /etc/sysconfig/
[root@wtl sysconfig]# pwd
[root@wtl ~]# pwd
/root

[root@wtl ~]# cd /etc/
[root@wtl etc]# pwd
/etc

[root@wtl etc]# cd
[root@wtl ~]# 
[root@wtl ~]# pwd
/root

[root@wtl ~]# cd /
[root@wtl /]# cd etc/
[root@wtl etc]# pwd
/etc/etc/sysconfig

[root@wtl ~]# pwd
/root
[root@wtl ~]# cd /etc/sysconfig/
[root@wtl sysconfig]# pwd
/etc/sysconfig
[root@wtl sysconfig]# cd 
[root@wtl ~]# pwd
/root
[root@wtl ~]# cd /etc/
[root@wtl etc]# cd sysconfig/
[root@wtl sysconfig]# pwd
/etc/sysconfig

[root@wtl ~]# cd /etc/sysconfig/
[root@wtl sysconfig]# pwd
/etc/sysconfig
[root@wtl sysconfig]# cd ..
[root@wtl etc]# pwd
/etc
[root@wtl etc]# cd ..
[root@wtl /]# pwd
/
[root@wtl /]# cd ..

2、查看目录下的文件

ls 	[选项]	[目录名称]

常用选项:

1) -a		查看目录下的所有文件
	[root@wtl ~]# ls -a 
	.   anaconda-ks.cfg  .bash_logout   .bashrc  .ssh     .viminfo
	..  .bash_history    .bash_profile  .cshrc   .tcshrc

2) -l		显示文件的详细信息
	[root@wtl ~]# ls -l
	total 4
	-rw-------. 1 root root 1420 Dec 29 10:24 anaconda-ks.cfg
	第一个字符:文件类型
		普通文件:  -
		目录:     d
		软连接文件:l
		块设备文件:b	(磁盘、分区)
		字符设备摁键:c	(键盘、显示器、打印机)
		1420	文件大小,单位Bytes字节
		Dec 29 10:24	最后一次修改时间
	[root@wtl ~]# ls -l /etc/passwd
	-rw-r--r--. 1 root root 886 Dec 29 10:23 /etc/passwd
	[root@wtl ~]# ls -l /etc/fstab 
	-rw-r--r--. 1 root root 465 Dec 29 10:17 /etc/fstab
 
3) -d		查看目录的详细信息	
	[root@wtl ~]# ls -ld /etc/
	drwxr-xr-x. 75 root root 8192 Jan 11 21:26 /etc/

4) -S		按文件大小排序显示
	[root@wtl ~]# ls -lhS /tmp/
	
5) -t		按文件修改时间排序
	[root@wtl ~]# ls -lht /tmp/
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

丶Seman

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值