Some basic homework of linux operating system (3)

1. The command alias that takes effect permanently for the current user

1. Write a command called hello, and the function realized is that every time the hello command is input, there will be hello, and everyone will be written into the file /file.txt.

insert image description here

2. Write a command alias named shuaxin, and the realized function is that every time the command is entered, all the time in the file.txt file will be updated to the current time.

insert image description here

2. Command aliases effective for all users

1. In the third-level title, write a command alias named hh that is effective for all users. After each user enters this command, a file1 file can be created in the user's home directory.

Enter vim /etc/bashrc to enter read-write mode, then enter alias hh='touch /file1'
insert image description here

insert image description here

3. Command history: view the command history and call the tenth line command

insert image description here

insert image description here

Guess you like

Origin blog.csdn.net/Zombie_QP/article/details/127542884