zoukankan      html  css  js  c++  java
  • Linux命令使用

    • 命令行创建设置用户密码
    $ sudo useradd -m -r username
    $ cat "username:password" | sudo chpasswd -m
    
    • 查询usb设备信息
    $ lsusb
    # 查询详细信息
    $ lsusb -v
    
    • 查询usb设备对应的/dev文件
    # 获取usb设备总线信息
    $ lsusb
    Bus 002 Device 004: ID 413c:2107 Dell Computer Corp. 
    Bus 002 Device 003: ID 0461:4d81 Primax Electronics, Ltd Dell N889 Optical Mouse
    Bus 002 Device 015: ID 05ac:12a8 Apple, Inc. iPhone5/5C/5S/6
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    $ ls /dev/bus/usb/002/
    001  002  003  004  015
    
    • 查询文件或者设备进程占用情况
    $ sudo fuser /dev/bus/usb/002/015
    /dev/bus/usb/002/015:  3036
    $ ps -ef|grep 3036
    
    • 查询磁盘使用情况
    ### 查询磁盘使用情况
    # df -h
    ### 查询目录大小
    # du -h
    
    • find多文件名匹配
    # find /etc/ansible/roles -name "ubuntu-16.04.yml" -o -name "debian.yml"
    
    • 文本输出去重
    # sort -u file.txt
    
    • 连接/监听端口
    ### 使用netcat工具
    # nc 127.0.0.1 80
    # nc -l 80
    
    • 下载文件
    # curl -o <file> <url>
    
  • 相关阅读:
    Ultra-QuickSort(归并排序求逆序对数)
    Power Network (最大流增广路算法模板题)
    Sorting It All Out
    Asteroids(二分图最大匹配模板题)
    昂贵的聘礼
    Borg Maze(bfs+prim)
    Currency Exchange(判断是否有正环)
    Children of the Candy Corn (bfs+dfs)
    Tautology
    Flip Game
  • 原文地址:https://www.cnblogs.com/silvermagic/p/7665818.html
Copyright © 2011-2022 走看看