树莓派在 shell 下自动挂载 usb 移动存储设备 发表于2013-08-04由jgh004 2 新建usb存储脚本 Shell nano /etc/udev/rules.d/10-usbstorage.rules 1 nano /etc/udev/rules.d/10-usbstorage.rules 输入以下内容 Shell KERNEL!="sd*", GOTO="media_by_label_auto_mount_end" SUBSYSTEM!="block",GOTO="media_by_label_auto_mount_end" IMPORT{program}="/sbin/blkid -o udev -p %N" ENV{ID_FS_TYPE}=="", GOTO="media_by_label_auto_mount_end" ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}" ENV{ID_FS_LABEL}=="", ENV{dir_name}="Untitled-%k" ACTION=="add", ENV{mount_options}="relatime,sync" ACTION=="add", ENV{ID_FS_TYPE}=="vfat", ENV{mount_options}="iocharset=utf8,umask=000" ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", ENV{mount_options}="iocharset=utf8,umask=000" ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}" ACTION=="remove", ENV{dir_name}!="",… 阅读全文
Debian Linux shell 高亮显示 发表于2013-08-04由jgh004 回复 编辑登录用户的 ~/.bashrc 文件, 每个用户的 ~ 目录可能不同. 用 echo ~ 即可显示实际目录. Shell nano ~/.bashrc 1 nano ~/.bashrc Shell # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything [ -z "$PS1" ] && return # don't put duplicate lines or lines starting with space in the history.… 阅读全文