Linux基本命令
Linux 常用命令
- man: an interface to the on-line reference manuals
- su [options] [username]: change user ID or become superuser
- useradd [options] LOGIN: create a new user or update default new user information
- userdel [options] LOGIN: delete a user account and related files
- passwd [options] [LOGIN]: change user password
- ps [options]: report a snapshot of the current process.
- kill [options]
[…]: send a signal to a process - fdisk [options] device: manipulate disk partition table
- mount: mount a filesystem
- chown [OPTION] … [OWNER]:[GROUP]] FILE …: change file owner and group
- chgrp [OPTION] … GROUP FILE …: change group ownership
- chmod [OPTION] … MODE[,MODE] … FILE …: change file mode bits
- grep [OPTION] PATTERN [FILE…]: print lines matching a pattern
- find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point…] [expression]: search for files in a directory hierarchy
- ln: make links between files
- gzip, gunzip, zcat: compress or expand files
- tar: an archiving utility
- diff [OPTION] … FILES: compare files line by line
- patch -pnum < patchfile: apply a diff file to an original
- ifconfig: configure a network interface
Linux文件及文件系统
文件类型
- 普通文件
- 目录文件
- 链接文件:类似 Windows 的快捷方式,分软链接和硬链接
- 设备文件:一般在/dev 目录下,一种是块设备文件,一种是字符设备文件
文件属性
-rwxrwxrwx
- r: read
- w: write
- x: execute
第一个字符:
- - : 普通文件
- d : 目录文件
- l : 链接文件
- c : 字符设备
- b : 块设备
- p : 命名管道,如 FIFO
- f : 堆栈文件,如 LIFO
- s : 套接字
之后的三个三位字符组:
- 第一组代表文件拥有者(u)对该文件的权限
- 第二组代表文件用户组(g)对该文件的权限
- 第三组代表系统其它用户(o)对该文件的权限
文件系统类型
- ext2 & ext3:ext3 是 ext2 的升级版本
- swap:交换分区使用
- vfat:DOS 中的系统(FAT12、FAT16 和 FAT32 等)
- NFS:网络文件系统
- ISO9660:光盘文件系统