/etc/profile and ~ /. Bashrc are not available to other users. /etc/profile and ~ /. Bashrc are not available to other users. The last, and most deadly, operation is comparable to rm-rf *.” Sudo CHGRP -r panda/”, disables all sudo commands.

Fault operation

Sudo failure

The system can only enter the recovery mode. The system cannot enter the root mode because the root mode is not set. The system can only be reinstalled because the backup mode is not set.

It all returns to nothing.

The difference between etc/profile and ~ /.bashrc

(1) the/etc/profile:

When a user logs in to the operating system, this file sets environment information for each user. When the user logs in to the operating system for the first time, this file is executed. That is, this file is available to every shell and is used to get information about the environment of the system. You can run the source /etc/profile command to take effect immediately

② ~/.bash_profile or ~/.profile:

Each user can use this file to enter shell information dedicated to the current user, and when the user logs in, the file is executed only once! By default, he sets some environment variables to execute the user’s.bashrc file. This file is similar to /etc/profile and takes effect only after a restart. /etc/profile takes effect for all users, and ~/.bash_profile takes effect for the current user only.

/etc/bashrc /bashrc:

This file is executed for every user running bash shell, and is read when the bash shell is opened. That is, when the user shell executes bash, this file is run. Changing this file does not require a restart; re-opening bash takes effect.

(4) ~ /. Bashrc:

This file stores information that is specific to a person’s bash shell and is executed at login and each time a new shell is opened. In this file, you can customize personal information that is specific to the user. Bashrc (each user has a.bashrc file in the user directory) Can be executed by running the source ~/.bashrc command.

What is the order in which the files are executed when the user logs in to the system? When you login to Linux, start the /etc/profile file first, and then start one of the ~/.bash_profile, ~/.bash_login, or ~/.profile files in the user directory in the order: ~/.bash_profile, ~/.bash_login, and ~/.profile. The ~/.bashrc file is also executed if the ~/.bash_profile file exists.

Common Commands

The w command is used to display information about the current users who have logged in to the system.

Execute this command to find out who is currently logged in to the system and what programs they are executing.

w
Copy the code
  • -f Enables or disables the display of where the user logs in to the system.
  • -h Does not display the header column of each column.
  • -l Uses the detailed format list, which is the default value.
  • -s uses a concise list format and does not show user login time, terminal stage jobs, and CPU time consumed by the program.
  • -u ignores the name of the executing program and information about the CPU time consumed by that program.
  • -v Displays the version information.

Htop is the next basic text-mode, interactive process viewer for Linux. It is primarily used in the console or shell and can replace top, or an advanced version of top.

htop

Copy the code
  • Quickly view key performance statistics such as CPU (multi-core layout) and memory/swap usage;
  • You can scroll through the process list horizontally or vertically to see all the processes and the full command line;
  • When killing a process, it can be selected without the need to enter a process number.
  • Operate items with the mouse;
  • Starts faster than top;

Ls | grep [string or regular expression] ps - ef | grep [string or regular expression]Copy the code

Unpack the

unzip
Copy the code
Tar -xvf -c Directory containing the decompressed fileCopy the code

Vim command

Press I to enter input mode (also known as edit mode) to start editing text Press ESC button to return to general mode

i
Copy the code

If :wq! Is forced to leave after storage (common)

:wq
Copy the code

If you have modified the file, and do not want to save, use! Do not save files for forced leave.

: q!Copy the code

Refer to the blog

Blog.csdn.net/wackycrazy/…

www.cnblogs.com/lizhenghn/p…

www.cnblogs.com/peida/archi…

www.howtoing.com/18-tar-comm…