嵌入式linux学习笔记(一)
发布日期:2021-05-10 06:42:36 浏览次数:18 分类:精选文章

本文共 8890 字,大约阅读时间需要 29 分钟。

Ubuntu������ - ���������������������������

������������������������������������Ubuntu���������������������Linux���������������������������������������������������������������������Linux���������������������������������Ubuntu������������������������������������������������������������������������������������������������������������������������

1.������������

���Ubuntu���������������������������������������������������������������������������������������������������������������������������������������������������������������

  • ���������������rm -r /path

    ���������������������������������������������������������������������

  • ���������������sudo reboot

    ������������������������������������

  • ���������sudo poweroff

    ������������������������������������

  • ���������������������man

    ���������������������������������������������������������������������man������������������������������������man ls ���������ls������������������������

  • ���������������������������sync

    ���������������������������������������������������������������������sync������������������������������������������������������������������������������

  • ���������������find

    ������find������������������������������������������������������������������find -name test.c ������������������test.c������������

  • ���������������grep

    grep������������������������������������������������������������������grep -irn ���ubuntu��� /������������������������������������ubuntu���������������

  • ���������������������du

    ������du���������������������������������du -sh������������������������������������du -k���������������KB���������������������������

  • ���������������df

    df������������������������������������������������������df -h������������-readable������������������������������������

  • ������������gedit

    Ubuntu������������������������������������������������������������������������

  • ���������������������������top

    ���������������������������������������������������������������top���������������������������������������������������������������������������������������

  • ���������������������file

    ������file���������������������������������������������������������������������������������

  • ���������������������cat���echo���more���tail

    ���������������������������������������������������������������������������������������������������������


2.������������

���Ubuntu������������������������������������������������������������������������apt-get������������������������������������������������������������������������������������������������������������������������������

  • ������apt-get���������������sudo apt-get install software-package���

    Ubuntu���������������������������������������������������������������������������

  • ������������deb���������

  • ���������������������������������.deb������������
  • ������sudo dpkg -I xxxx.deb���������������������������
  • ������.deb���������������������������������������������sudo dpkg -i xxxx.deb���
  • ���������������������������

    ���������������������������������������������������������������������������������

  • ������������������
  • ������make���������������
  • ������make install���������������
  • ���������������������������

    Ubuntu���������������������������������������������������������������������������������������


3.Ubuntu������������������

Ubuntu������������������������������Linux������������������������������������������

  • /bin������������������������������������
  • /boot���������������������������������
  • /etc������������������������������
  • /dev������������������������
  • /home���������������������������������
  • /lib���������������������
  • /media������������������������������U������SD���������
  • /mnt������������������������������
  • /opt������������������������������������
  • /root���������������������������������������
  • /usr���������������������������������������������
  • /proc���������������������������������������������������
  • /var���������������������������������������������������

4.������������

���Linux������������������������������������������������������������������������������������������������������������������

  • ���������������������������df���du���������������������������������������������������df -h������������������������������������������

  • ������������������������������mount���umount������������������������������������������������ /mnt���������������������umount���������

  • ���������������������������������fdisk���������������������������������������������������������������������������������������������������1GB������������������������

  • ������������������������������������������������������������������������������������������������mount /dev/sdb1 /mnt������/dev/sdb1���������������������������������


5.������������������������

���Linux���������������������������������������������������������������������������������������������������������������������������

  • ���������������������adduser username������������������������������������������������useradd������������������������

  • ���������������������������finger username������������������������������������������

  • ���������������������deluser username������������������������������������������������������������������������������������������������������������

  • ������������������������������������������������������������������������������������������������addgroup groupname������������������delgroup groupname������������������


6.������������������

���Linux���������������������������������������������������������������������������������������������������������������������������������������������rwx���������������������������������������������������������������������������

  • ���������������������chmod������������������������������������

    • chmod 777 file������������������������������
    • chmod 600 file������������������������������������������
  • ���������������������������������������chown���������������������������������������������������������

    • chown user file������������������������������������������������
    • chown group file������������������������������������

7.������������

���Linux���������������������������������������������������������������������

  • ������������ln file1 file2���������������������������������ln -f file1 file2������������������������������

    • ������������������������������������������������������������������������������������������������������������������������������������������
    • ������������������������������������������
  • ���������������ln -s file1 linkfile������������������������������������������������������������������������������������������������������������

    • ���������������������������������������������������������
    • ���������������������������������������������������������������������������
  • ���������������������cp -d���������������������������������������������������������


8.Vim��������� Basics

Vim ������������������������������������������������������������������������������������������������������

  • ���������������

    • i������������������������������������
    • I������������������������������
    • a������������������������������������
    • A������������������������������
  • ���������������

    • dd���������������������
    • ndd���������������������������n-1������
    • u���������������������������
  • ���������������Vim���������������������������������������������������������������������������


9.Linux������������

���Linux������������������������C���������������������������������������������������������������������������������

  • ������C���������

    ���������������������������������������������.c������������������

    #include 
    int main() {
    printf("Hello, World!\n");
    return 0;
    }
  • ������C���������������gcc���������������������

    • ���������������������������gcc filename.c -o outputfilename���������������������������
  • ������Makefile������������������������������������������Makefile������������������������������������������������Makefile���������

    obj-m += main.o input.o
    all:
    make -C . obj
    make -C . install
    clean:
    make -C . clean

    ������������������������Makefile���������$(<)���������������������$(>))���������������������

  • ���������������������./outputfilename������������������������������


  • 10.Shell������������

    _shell_���������������������Shell������������������������������������������������������������������������������������������������������������������������

    • ���������shell���������

      #!/bin/bash
      echo "Hello, World!"

      ���������������������./script.sh���������������

    • ������������������

      read -p "���������������������������������" name age
      echo "���������������$name������������$age"
    • ���������������

      total=$(($first+$second))
      echo "���������$total"
    • ���������������������

      if [ "$value" == "true" ]; then
      echo "������������"
      elif [ "$value" == "false" ]; then
      echo "������������"
      fi
    • ���������������

      for ((i=0; i<=count; i++)); do
      echo "���������������$i"
      done
    • ���������������

      function hello() {
      echo "���������"
      }
      hello

    ������������������������������������������������������Ubuntu���������������������������������������������������������������������������������������������������������������������������������������������������

    上一篇:C语言编译错误列表
    下一篇:MQTT协议学习

    发表评论

    最新留言

    关注你微信了!
    [***.104.42.241]2025年04月12日 08时58分50秒