June 1 Task
2.1/2.2 System directory Structure
2.3 ls Command
2.4 File types
2.5 alias Command
2.1/2.2 System directory Structure
LS list for listing files or directories
[[email protected] /]# lsbin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var[[email protected] /]#
If you want to use a normal user to log into the system with a key, you need to create a public key in the normal user home directory/hoem/user name/.ssh/authorized_keys public key storage location fixed, you can specify a custom location through the SSH service configuration
Tree-shaped display directory with all files in the branch structure,--HELP get help usage
Common Directory
Bin sbin/usr/bin//usr/sbin/saved common system commands, commands in the Sbin directory belong to the Super administrator to use the command
/boot directory system boot file
/dev System device files for hardware device drivers and use
/etc system configuration file, such as network card configuration file, sshd remote service file
/Home User House Directory
/lib/lib64 repository files, command dependent files, see which libraries the command depends on (such as LS) ldd/bin/ls
[[email protected] /]# ldd /bin/ls linux-vdso.so.1 => (0x00007ffe577fb000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f05dce75000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f05dcc70000) libacl.so.1 => /lib64/libacl.so.1 (0x00007f05dca66000) libc.so.6 => /lib64/libc.so.6 (0x00007f05dc6a5000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f05dc444000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f05dc23f000) /lib64/ld-linux-x86-64.so.2 (0x00007f05dd0a5000) libattr.so.1 => /lib64/libattr.so.1 (0x00007f05dc03a000)
32-bit and 64-bit system differences in support of memory size
/medir/mnt Media directory, empty directory, for mounting devices such as discs or disks
/proc process directory, system process run directory
/run Process PID directory, the directory at which the program runs when the shut-down opportunity is cleared
/sys System Kernel file directory
/tmp Temporary storage directory
/usr user's directory, such as installation, MySQL, Redis
/var storage log, location of all log stores
2.3 ls Command
Ls-l Listing Details
[[email protected] ~]# ls-l anaconda-ks.cfg rw-------. 1 root root 1464 May 22:25 anaconda-ks.cfgls-i List i node information [[email protected] ~]# ls-i anaconda-ks.cfganaconda- Ks.cfgls-lh-h display file size in a clearer, readable manner [[email protected] ~]# ls-lh anaconda-ks.cfg rw-------. 1 root root 1.5K May 22:25 anaconda-ks.cfgls-la-a Show hidden files or directories [[email protected] ~]# ls-la total usage 32dr-xr-x---. 3 root root 163 May 17:07. Dr-xr-xr-x. Root root 244 May 28 23:13.. RW-------. 1 root root 1464 May 22:25 anaconda-ks.cfgrw-------. 1 root root 2194 May 16:52. Bash_historyrw-r--r--. 1 root root 18 December bash_logoutrw-r--r--. 1 root root 176 December bash_profilerw-r--r--. 1 root root 176 December bashrcrw-r--r--. 1 root root 100 December cshrcdrwx------2 root root 61 May 17:07. Sshrw-r--r--. 1 root root 129 December tcshrcrw-------1 root root 1072 May 17:07. Viminfols-lta-t in chronological order, chronologically sorted [[email& Nbsp;protected] ~]# Ls-lta total dosage 32dr-xr-x---. 3 root root 163 May 17:07 drwx------2 root root 61 May 17:07. sshrw-------1 root root 1072 May 17:07. Viminforw-------. 1 root root 2194 May 16:52. Bash_historydr-xr-xr-x. Root root 244 May 28 23:13.. RW-------. 1 root root 1464 May 22:25 anaconda-ks.cfgrw-r--r--. 1 root root 18 December bash_logoutrw-r--r--. 1 root root 176 December bash_profilerw-r--r--. 1 root root 176 December bashrcrw-r--r--. 1 root root 100 December cshrcrw-r--r--. 1 root root 129 December tcshrcls-ld-d only lists the directory itself, using [[email protected]/]# ls-ld root/dr-xr-x for the directory only---. 3 root root 163 May 17:07 root/ls-l No-d display, list content under directory [[email protected]/]# ls-l root/total usage 4-rw---- ---. 1 root root 1464 May 22:25 anaconda-ks.cfg
2.4 File types
使用ls -l查看以字符开头的文件类别d 目录文件- 普通文件l 软连接文件c 字符串设备,如鼠标、键盘b 块设备文件,如光盘、硬盘s 通信文件,进程间通信使用的文件,通信两种方式,一种tcp/ip一种是文件间通信
2.5 alias Command
which command to view command aliases, such as [[email protected]/]# which lsalias ls= ' ls--color=auto '/usr/bin/ls view all alias commands [[email Protected]/]# aliasalias cp= ' cp-i ' Alias egrep= ' Egrep--color=auto ' Alias fgrep= ' Fgrep--color=auto ' Alias grep= ' grep-- Color=auto ' Alias l.= ' ls-d. *--color=auto ' Alias ll= ' Ls-l--color=auto ' Alias ls= ' ls--color=auto ' alias mv= ' Mv-i ' Alias RM = ' rm-i ' Alias Which= ' Alias | /usr/bin/which--tty-only--read-alias--show-dot--show-tilde ' PATH environment variable, commands in these directories are not effective to use [[email protected]/]# echo $PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin definition alias [[email protected]/]# alias linux= ' Ll-la ' [[email protected]/]# Linux uses the Linux alias to test the total usage 16dr-xr-xr-x. Root root 244 May 23:13. Dr-xr-xr-x. Root root 244 May 28 23:13.. -rw-r--r--1 root root 0 May 23:13. autorelabellrwxrwxrwx. 1 root root 7 May 22:16 bin--usr/bindr-xr-xr-x. 4 root root 4096 May 22:37 bootdrwxr-xr-x root root 3000 June 1 14:26 devdrwxr-xr-x. The root Root 8192 June 1 14:26 etcdrwxr-xr-x. 2 root root 6 November 5 homelrwxrwxrwx. 1 root root 7 May 22:16 Lib--usr/liblrwxrwxrwx. 1 root root 9 May 22:16 lib64-usr/lib64drwxr-xr-x. 2 root root 6 November 5 mediadrwxr-xr-x. 2 root root 6 November 5 mntdrwxr-xr-x. 2 root root 6 November 5 optdr-xr-xr-x root root 0 June 1 14:26 procdr-xr-x---. 3 root root 163 May 17:07 rootdrwxr-xr-x root root 620 June 1 14:26 runlrwxrwxrwx. 1 root root 8 May 22:16 sbin-usr/sbindrwxr-xr-x. 2 root root 6 November 5 srvdr-xr-xr-x root root 0 June 1 14:26 sysdrwxrwxrwt. 7 root root 132 June 1 15:29 tmpdrwxr-xr-x. Root root 155 May 22:16 usrdrwxr-xr-x. Root root 267 June 1 14:26 var[[email protected]/]# unalias linux cancel alias [[email protected]/]# Linux No this alias command-bash:linux: Command not found
Linux file type and alias settings