linux基础命令学习之一-ls

ls命令:
      -l:长格式
例:[root@localhost ~]# ls -l
总计 64
-rw------- 1 root root  1101 03-10 23:01 anaconda-ks.cfg
drwxr-xr-x 2 root root  4096 03-10 23:06 Desktop
-rw-r--r-- 1 root root 28240 03-10 23:00 install.log
-rw-r--r-- 1 root root  3672 03-10 22:59 install.log.syslog
-rw-r--r-- 1 root root    15 03-22 22:30 sort.test

          文件类型:
               -:普通文件(f)
                 例:
               d:目录文件
               b:块设备文件(block)
               c:字符设备文件(character)
               l:符号链接文件(symbolic link file)
               p:命令管道文件(pipe)
               s:套接字文件(socket)
          文件权限:9位,每3位一组,每一组:rwx(读、写、执行),r--
          文件硬件链接的次数
          文件属主(owner)
          文件属组(group)
          文件大小(size),单位是字节
          时间戳(timestamp),最近一次被修改的时间
                访问:access
                修改:modify,文件内容发生了改变
                改变:change,metadata,元数据
          例:[root@localhost ~]# ls -l
              总计 64
               -rw------- 1 root root  1101 03-10 23:01 anaconda-ks.cfg
               drwxr-xr-x 2 root root  4096 03-10 23:06 Desktop
               -rw-r--r-- 1 root root 28240 03-10 23:00 install.log
               -rw-r--r-- 1 root root  3672 03-10 22:59 install.log.syslog
               -rw-r--r-- 1 root root    15 03-22 22:30 sort.test
    -h:做单位转换
        例: [root@localhost ~]# ls -lh
             总计 64K
             -rw------- 1 root root 1.1K 03-10 23:01 anaconda-ks.cfg
             drwxr-xr-x 2 root root 4.0K 03-10 23:06 Desktop
             -rw-r--r-- 1 root root  28K 03-10 23:00 install.log
             -rw-r--r-- 1 root root 3.6K 03-10 22:59 install.log.syslog
             -rw-r--r-- 1 root root   15 03-22 22:30 sort.test
    -a:显示所有文件包含隐藏文件及.和..文件
       .表示当前目录
       ..表示父目录
       例:[root@localhost ~]# ls -a
            .                .bashrc   .gconf           .gtkrc-1.2-gnome2   .redhat    .Xauthority
            ..               .chewing  .gconfd          .ICEauthority       .scim      .xsession-errors
            anaconda-ks.cfg  .cshrc    .gnome           install.log         sort.test
            .bash_history    Desktop   .gnome2          install.log.syslog  .tcshrc
            .bash_logout     .dmrc     .gnome2_private  .metacity           .Trash
            .bash_profile    .eggcups  .gstreamer-0.10  .nautilus           .viminfo

    -A:显示所有文件包含隐藏文件,但不包含“.和..文件”
        例:[root@localhost ~]# ls -A
            anaconda-ks.cfg  .chewing  .gconf           .gstreamer-0.10     .metacity  .tcshrc
            .bash_history    .cshrc    .gconfd          .gtkrc-1.2-gnome2   .nautilus  .Trash
            .bash_logout     Desktop   .gnome           .ICEauthority       .redhat    .viminfo
            .bash_profile    .dmrc     .gnome2          install.log         .scim      .Xauthority
            .bashrc          .eggcups  .gnome2_private  install.log.syslog  sort.test  .xsession-errors

    -d:显示目录自身属性
       例:[root@localhost ~]# ls -ld /root
           drwxr-x--- 16 root root 4096 03-24 09:53 /root
    -i:inode(index node)文件索引节点号
        例:root@localhost ~]# ls -i
            643519 anaconda-ks.cfg  383618 install.log         384231 sort.test
            672018 Desktop          383619 install.log.syslog
    -r:逆序显示文件
       例:[root@localhost ~]# ls -r
            sort.test  install.log.syslog  install.log  Desktop  anaconda-ks.cfg

    -R:递归(recursive)显示
       例:[root@localhost ~]# ls -R
            .:
            anaconda-ks.cfg  Desktop  install.log  install.log.syslog  sort.test
            ./Desktop:

cd命令:change directory
       例:[root@localhost ~]# cd /usr
           [root@localhost usr]#
        cd ~USERNAME:进入指定用户的家目录
        cd -:在当前目录和前一次所在的目录之间来回切换

命令类型:
    内置命令(shell 内置)
    外置命令:在文件系统的某个路径下有一个与命令名称相应的可执行文件
环境变量:命令的内存空间
     例:[root@localhost ~]# printenv
         HOSTNAME=localhost.localdomain
        TERM=xterm
        SHELL=/bin/bash
        HISTSIZE=1000
        SSH_CLIENT=192.168.100.19 52481 22
        SSH_TTY=/dev/pts/1
        USER=root
        LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
        MAIL=/var/spool/mail/root
        PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
        INPUTRC=/etc/inputrc
        PWD=/root
        LANG=zh_CN.UTF-8
        SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
        SHLVL=1
        HOME=/root
        LOGNAME=root
        SSH_CONNECTION=192.168.100.19 52481 192.168.100.104 22
        LESSOPEN=|/usr/bin/lesspipe.sh %s
        DISPLAY=localhost:10.0
        G_BROKEN_FILENAMES=1
        _=/usr/bin/printenv
        OLDPWD=/usr
            
type:显示命令属于哪种类型
    例:[root@localhost ~]# type cd
         cd is a shell builtin
        [root@localhost ~]# type su
         su is /bin/su
which:显示命令路径
     例:[root@localhost ~]# which ls
         alias ls='ls --color=tty'
                   /bin/ls
hash:查看缓存
    例:[root@localhost ~]# hash
        hits    command
        1    /usr/bin/whereis
        1    /usr/bin/printenv
        14    /bin/ls
### S32K3 Microcontroller DMA Configuration Tutorial #### Overview of DMA on the S32K3 Series The Direct Memory Access (DMA) feature within the S32K3 series allows data transfer between memory and peripherals without CPU intervention, improving system efficiency. The eDMA module supports multiple channels with flexible arbitration mechanisms to manage concurrent requests effectively[^1]. #### Key Components Involved in DMA Setup For configuring DMA operations specifically involving ADC interfaces: - **Hardware Units**: Two hardware units can be configured as `ADC0` and `ADC1`. Users should configure these based on their specific circuit requirements[^3]. - **Channel Management**: When using multiple ADC channels, only the last channel triggers a DMA request upon completion. After one major loop finishes executing, it automatically loads the next Transfer Control Descriptor (TCD)[^2]. #### Step-by-step Guide for Configuring DMA with ADC To set up DMA transfers from an ADC peripheral: 1. Initialize the ADC modules (`ADC0`, `ADC1`) according to project needs. 2. Configure TCD settings including source address, destination address, block size, etc., ensuring proper alignment with the desired buffer structure. 3. Set up interrupt handlers if necessary to handle events such as end-of-conversion or error conditions. 4. Enable DMA requests by setting appropriate bits in control registers associated with each ADC instance used. 5. Ensure that after completing a major loop, subsequent minor loops are correctly initialized via preloaded TCD entries. ```c // Example C code snippet showing basic setup steps void init_DMA_for_ADC(void){ // Assuming initialization functions exist for simplicity /* Initialize ADC */ ADC_Init(ADC0); /* Prepare TCD structures */ edma_config_t dmaConfig; EDMA_GetDefaultConfig(&dmaConfig); EDMA_Init(DMA_BASE_ADDR, &dmaConfig); /* Create and configure TCDs */ uint8_t tcdIndex = 0; // Choose available index EDMA_CreateHandle(&g_edmaHandle[tcdIndex], DMA_BASE_ADDR, tcdIndex); } ``` This example demonstrates initializing DMA alongside ADC configurations but does not cover all possible scenarios or optimizations which may vary depending on application specifics. --related questions-- 1. How do different types of DMA modes affect performance when interfacing with ADC? 2. What considerations must be taken into account while designing buffers for storing ADC samples through DMA? 3. Can you explain how priority levels influence DMA operation among competing peripherals like UART vs SPI? 4. In what ways could interrupts play a role during continuous acquisition mode enabled by DMA?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值