Current location - Music Encyclopedia - Chinese History - In which file are linux historical commands recorded? Linux history command.
In which file are linux historical commands recorded? Linux history command.
How to delete the historical operation command of Linux system?

History-c can clear the history in the current echo >; /root/。 Bash_history can permanently delete all history and close it. HISTSIZE= 1000 can be found in vim/etc/profile. Change 1000 to 0, and there will be no more historical commands.

How to delete historical records under Linux system?

1, modify /etc/profile to change HISTSIZE= 1000 to 0 or 1 to clear the user's home path. Bash _ history

2. Immediately clear the record of the current historical command in History-C..

3. When bash executes a command, it will not immediately write the command name into the history file, but store it in the internal buffer. When bash exits, they will be written together.

However, you can call the' history-w' command to ask bash to update the history file immediately.

History -w

The delete command of subsequent operations will only delete the operation command of the current user, and will not affect other users.

Enter the command history at the prompt to view the historical operation commands of the current user.

Enter the command history-c at the prompt to delete the historical operation command.

Check the historical command again and find that the historical operation command has been deleted.

If you want the system to stop saving historical operation commands, you must change the profile in the profile directory.

First, open the file with vi editor.

Find the value of HISTSIZE. By default, the history command will save 1000 items. You can change this value to 0, then save and exit, and finally restart the system for the profile to take effect.

After the restart is completed, the command history is used to check again, and it is found that the system no longer records commands.

Linux basic operation command?

What are the operating instructions in linux system? The following is a detailed introduction:

There are many operating instructions in linux system, and the most commonly used operating instructions are: cd command, cd command, grep command, find command, cp command, mv command, rm command, ps command, kill command, killall command, file command, tar command, cat command, chgrp command, chown command, chmod command, pwd command, vim command, gcc command and time command.

1, cd command

This is very basic, it is used to switch the current directory. Its parameter is the path of the directory to switch to, which can be an absolute path or a relative path.

2.ls command

This is a very useful command to view files and directories.

3.grep command

This command is usually used to analyze a line of information. If there is any information we need, the line will be displayed. This command is usually used with the pipeline command to filter the output of some commands, etc.

Step 4 Find the command

Find is a very powerful command based on search. Relatively speaking, its use is more complicated and there are many parameters.

5.cp command

This command is used to copy files, that is, copy. It can also copy multiple files into one directory at a time.

6.mv command

This command is used to move or rename a file or directory.

7.rm command

This command is used to delete files or directories between deletions.

8.ps command

This command is used to select the process operation at a certain point in time and output the meaning of the process.

9. Killing orders

This command is used to send a signal to a job (%jobnumber) or PID (number). It is usually used with the ps and jobs commands.

10, killall command

This command is used to send a signal to the process started by the command.

1 1, file command

This command is used to judge the basic data of the file after the file command.

12, tar command

This command is used to package files. By default, it is not compressed. If the corresponding parameters are specified, it will also call the corresponding compression programs (such as gzip and bzip) for compression and decompression.

13, Caterpillar Command

This command is used to view the contents of a text file, followed by the file name to view. Usually you can use more and less through the pipeline, so you can view the data page by page.

14, chgrp command

This command is used to change the user group to which a file belongs.

15, chown command

This command is used to change the owner of a file, and its usage is the same as the chgrp command, but the modified file attributes are different.

16, chmod command

This command is used to change the permissions of a file.

Pwd command

Function: displays the absolute path of the current working directory.

18, vim command

This command is mainly used for text editing. It accepts one or more file names as parameters. If the file exists, it will be opened. If the file does not exist, it will be created with the file name.

19, gcc command

This command is very important for a person who uses Linux to develop C programs. Used to compile source program files of C language into executable programs.

20, time command

This command is used to measure the execution time of the command (that is, the program).

Linux query command?

1. Find

Find is the most common and powerful search command. You can use it to find any file you want.

Step 2 locate

The locate command is actually another way to write find-name, but it is much faster than the latter because it does not search a specific directory, but a database.

3. where is it

The whereis command can only be used to search program names, and only binary files (parameter -b), man description files (parameter -m) and source code files (parameter -s) are searched.

which

Which command is used to search the location of the system command in the PATH specified by the path variable and return the first search result.

5. Types

In fact, the type command is not a search command. It is used to distinguish whether the command is provided by the shell itself or by a separate binary file outside the shell.

Complete works of common linux commands?

Check the top of the machine load

Check the free memory usage.

View process information ps-ef|grep process number

Edit vim

Change permission mode

Change directory user permissions