1, 一条命令删除某个文件夹及其子目录下的所有隐藏文件(.和..除外);
find -iname “.*” -exec rm -rf {} \;
dir
[[email protected] ~]$ cd dir
c
[[email protected] dir]$ ls -a
.  ..  .a  .b  c
[[email protected] dir]$ find -iname ".*"
.
./.a
./.b
[[email protected] dir]$ find -iname ".*" -exec rm -rf {} \;
rm: cannot remove directory: `.'
find: `./.a': No such file or directory
find: `./.b': No such file or directory
[[email protected] dir]$ ls -a
.  ..  c

2, 在自己的虚拟机里创建一个linux的组, 然后创建一个用户user并把这个用户放到
linux组里, 并设置user的密码; 并查看/etc/passwd, /etc/group, /etc/shadow文件的变
化; 完成之后删除刚创建的用户和组;
创建一个linux的组, 然后创建一个用户
Linux部分基本命令
[[email protected] a]#  cat /etc/passwd    (查看建立的用户)
Linux部分基本命令
设置用户的密码
Linux部分基本命令
[[email protected] a]# cat /etc/shadow      (查看该用户加密后的密码)
Linux部分基本命令
删除建立的组和用户
Linux部分基本命令Linux部分基本命令

3,   将hello.c 编译生成hello可执行程序, 然后用户在任何路径下都能直接输入hello命
令执行该程序;
[[email protected] local]$ hello
hello world!
两种方式实现:
1, 用sudo将hello拷贝到系统的可执行路径下(PATH环境变量指定)
2, 改变PATH环境变量, 指向hello所在的路径;
改变PATH环境变量, 指向hello所在的路径
Linux部分基本命令
配置sudo
Linux部分基本命令
Linux部分基本命令
用sudo将hello拷贝到系统的可执行路径下(PATH环境变量指定)
Linux部分基本命令

相关文章:

  • 2021-08-03
  • 2021-07-12
  • 2021-11-17
  • 2021-05-25
猜你喜欢
  • 2022-01-07
  • 2022-02-07
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-02-25
  • 2021-07-30
相关资源
相似解决方案