20180503 Morning class record 02-Linux

1. What is the command to move a file or folder

mv

2. What is the command parameter to copy the file or folder

cp

3. Command parameters for forced deletion of files

rm -r

4. Command parameters to force delete a folder

rm -rf

5. Is it possible to execute rm -rf / on production

can not

6. Switch the command parameters of the user to execute the environment variable file and enter the home directory

su - xxx

7. Ordinary users want to temporarily obtain the maximum authority of root, which file to modify

/etc/sudoers

8. View command help

--help or man xxx

9. View history commands and execute 55 lines

history !55

10. Create an empty file command

touch xxx

11. Commands to create folders

mkdir

12. What are the parameters for creating a cascaded folder

mkdir -p

13. Commands to view processes running in the background

ps -ef

14. Kill a process

kill -9 pid

15. View the port number command of the process 955

netatat -nlp | grep 955

16. How to set up a temporary alias

alias

17. Set the variable key=value, is this right?

No, no spaces

18. The environment variable files are divided into global and personal, so where are they located and how do they take effect?

Global: /etc/profile Execute source /etc/profile to take effect
Personal: ~/.bash_profile or ~/.bashrc Execute source ~/.bash_profile to take effect

19. What are the commands to view the contents of the file

cat
more
less
tail

20. What do hidden files start with

.

21. What is the difference between tail -f and -F

tail -f is equivalent to --follow=descriptor, track by file descriptor, stop tracking when a file is renamed or deleted
tail -F is equivalent to --follow=name --retry, track by file name, and keep repeating Try, that is, after the file is deleted or renamed, if the same file name is created again, it will continue to track

22. If a certain xxx wants to kill all processes related to xxx, what should we do in the first step? How should we do in the second step?

The first step ps -ef|grep xxx view
the second kill -9 pid kill

23. Create a user command

useradd

24. The command to create a user group

groupadd

25. What are the configuration files of users and user groups?

/etc/passwd
/etc/group

26. Generally check the user's situation and use the id ruoze, then how to add the bigdata user group to ruoze

usermod -a -G bigdata ruoze

27. Command to set password

passwd xxx

28. What is the symbol of the pipe character?

|

29. View the IP command of the current machine (Linux)

ifconfig

30. Talk about vi, how to edit the input content of a file, then save and exit

i -- enter edit mode
esc -- quit editing
: wq -- save and exit

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325206420&siteId=291194637