摘要: 1:使用sed命令打印出/etc/passwd文件中的奇数行内容。 sed -n '1~2p' /etc/passwd 2:使用 sed 命令将 /etc/passwd 文件从 2 到 10 行中的 bin 替换成 linux。 cat /etc/passwd.back | sed -n '2,10 阅读全文
posted @ 2020-06-15 15:40 尚小肆 阅读(299) 评论(0) 推荐(0)
摘要: 1:grep可以在档案中搜寻关键词。 2:tail -n100 filePath查看文件最后100行。 3:命令模式下输入:set number 查看文件行号。 4:grep -E "\b[[:alpha:]]+\b" /etc/fstab -o | sort | uniq -c | sort -n 阅读全文
posted @ 2020-06-08 11:45 尚小肆 阅读(142) 评论(0) 推荐(0)
摘要: 1:属性 d (1)rwx (2)rwx (3)rwx; d:文件;(1)所有者:读写执行;(2)所属组:读写执行;(3)其他:读写执行 2:linux添加用户 useradd user;修改用户密码 passwd user 3:查看root信息 id root ;uid=0(root) gid=0 阅读全文
posted @ 2020-06-02 10:48 尚小肆 阅读(226) 评论(0) 推荐(0)