Seven secrets about Linux systems that you may not know yet
Linux is a free-to-use and freely disseminated Unix-like operating system. It is a multi-user, multi-task, multi-thread and multi-CPU operating system based on POSIX and UNIX. It can run major UNIX software tools, applications and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits the network-centric design philosophy of Unix and is a multi-user network operating system with stable performance.
One of the coolest parts of using Linux is gaining new knowledge over time. Every day, you might come across a new utility, or, perhaps, an unfamiliar flag that does something useful. These small details may not always be life-changing, but they are the building blocks of expertise.
Even the experts don’t know it all. No matter how experienced you are, there's always more to learn, so here are seven things you may not know about Linux systems.
Historical commands have interactive mode
You may be familiar with the command history of Linux systems. This command can provide a standard list of bash input commands. However, this list may not be very useful if you are looking for a specific URL among many "curl" commands.
Using substitution, Linux provides an interactive reflection search function to help you deal with the above troubles. You can press the "Crtl r" key to activate the command history query function, you can interactively enter the command content, and press the "Crtl r" key to cycle through the command history containing the input content. After finding it, press the Enter key to execute it again, or you can use the arrow keys to select it, and the command will be entered again and wait for execution.
Cron is not the only way to schedule tasks
The cron command is extremely useful for users at the task level. Whether they are beginners or experienced experts, they can use this command to formulate task plans for system execution. But if you only develop a task once, then the "at" command allows you to achieve the goal without touching the crontab table.
Enter "at" at the command prompt and follow the task plan execution time. The command supports a variety of time formats, which can be specific execution time and delayed time nodes. Here are some specific examples:
"at 12:00 PM September 30 2017"
“at now 1 hour”
"at 9:00 AM tomorrow"
After the input is completed, you can enter the tasks to be performed. After all tasks are entered, start a new line and press "Ctrl D" again. "EOF" will be displayed to indicate that the input is completed. Now you have completed setting up a task plan. Furthermore, you can use the "atq" command to query your unexecuted task list; you can also use "atrm" plus the task number to cancel the task plan.
You can search for commands by function, not just by command name
Remembering each command name can be a bit difficult, especially for beginners. Fortunately, Linux comes with a man tool that searches by function description and command name. Next time, if you have trouble remembering the name of a command you want to use, you can try looking up the command you want with an appropriate description. For example, a command about building a filesystem would return a list of names and descriptions for the tool, including "build" or "filesystem". Now, you can enter "manbuild filesystem" and the man tool will display the corresponding commands based on your input.
man will receive one or more strings as arguments, but it also has the option -R, which allows you to search by regular expressions.
An alternative system allows you to manage versions
If you have ever been involved in software development, then you will know the importance of cross-project version management. Many Linux distributions have tools to handle the different versions built-in.
Executable files like java are often symbolically linked to /etc/alternative. This directory, in turn, stores symbolic links to binary files and provides an interface for managing these links. Java is the most commonly used language replacement, but with a little configuration, it can also be used as an application replacement like NVM and RVM (e.g. NodeJS, Ruby).
On Debian-based systems, you can create and manage these link update scenarios. In CentOS, tools are so-called replacements. By changing the link in the replacement file, you can install multiple language versions and use different binaries in different situations. Of course, this isn't limited to programming languages. This alternative system also supports any executable you might want to run from the command line.
"shred" command
Most people use the "rm" command to delete files, but are the files actually deleted? In fact, the system does not do what you expect. The system only creates a hard link between the file system and the disk file. delete. These "0" and "1" values persist until they are overwritten by another application, which is very unsafe for sensitive data.
The "shred" command is the absolute form of "rm". When you "shred" a file, the physical data of this file is overwritten randomly multiple times. There is even an option to overwrite the original data with a string of zeros after deleting the file.
The command to completely delete a file and overwrite it with zeros is:
shred -u -z [file name]
You can also add the n option with a number as a parameter. This option allows you to specify the number of iterations to randomly overwrite the data.
"AutoCorrect" function to avoid errors when entering long file paths
How many times have you entered an absolute file path, only to get the "No such file or directory" message? Everyone doesn't want to experience the pain of facing a long list of wrong paths. Fortunately, Linux has a simple solution.
The built-in "shopt" command allows you to set various options to change the behavior of your shell. Setting the cdspell option to "on" can avoid the headache of file path problems caused by a single incorrect letter. You can enable this option using the "shopt-s cdspell" command. Once activated, file paths are automatically corrected to the closest match when you try to enter the directory.
Theshell option is a great way to save time (not to mention trouble), and there are many others. To see a complete list of shell options, run shopt without arguments. Be aware that this is a feature of bash, so if you are using another shell, you may not be able to use this command.
Quickly return to the current directory
If you have configured a moderately complex system, you may find yourself changing directories frequently, making it difficult to keep track of where you are. Wouldn’t it be nice if you automatically returned to your current location after running a command?
Linux actually provides a solution to this problem, and it's very simple. If you go into another directory to do something and then return to the current working directory, enclose the command in parentheses. Here's an example you can test yourself. Make a note of your current directory and run:
(cd /etc && ls -a)
This will display the contents of the /etc/ directory instead of the contents of your current directory.
The above is the detailed content of Seven secrets about Linux systems that you may not know yet. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



There are many questions that Linux beginners often ask, "Does Linux have a Task Manager?", "How to open the Task Manager on Linux?" Users from Windows know that the Task Manager is very useful. You can open the Task Manager by pressing Ctrl+Alt+Del in Windows. This task manager shows you all the running processes and the memory they consume, and you can select and kill a process from the task manager program. When you first use Linux, you will also look for something that is equivalent to a task manager in Linux. A Linux expert prefers to use the command line to find processes, memory consumption, etc., but you don't have to

Zabbix's support for Chinese is not very good, but sometimes we still choose Chinese for management purposes. In the web interface monitored by Zabbix, the Chinese under the graphic icon will display small squares. This is incorrect and requires downloading fonts. For example, "Microsoft Yahei", "Microsoft Yahei.ttf" is named "msyh.ttf", upload the downloaded font to /zabbix/fonts/fonts and modify the two characters in the /zabbix/include/defines.inc.php file at define('ZBX_GRAPH_FONT_NAME','DejaVuSans');define('ZBX_FONT_NAME'

Did you know, how to check the creation date of an account on a Linux system? If you know, what can you do? Did you succeed? If yes, how to do it? Basically Linux systems don't track this information, so what are the alternative ways to get this information? You may ask why am I checking this? Yes, there are situations where you may need to review this information and it will be helpful to you at that time. You can use the following 7 methods to verify. Use /var/log/secure Use aureport tool Use .bash_logout Use chage command Use useradd command Use passwd command Use last command Method 1: Use /var/l

System-wide installation If you install a font system-wide, it will be available to all users. The best way to do this is to use RPM packages from the official software repositories. Before starting, open the "Software" tool in Fedora Workstation, or other tools using the official repository. Select the "Add-ons" category in the selection bar. Then select "Fonts" within the category. You'll see the available fonts similar to the ones in the screenshot below: When you select a font, some details will appear. Depending on several scenarios, you may be able to preview some sample text for the font. Click the "Install" button to add it to your system. Depending on system speed and network bandwidth, this process may take some time to complete

1. Find the fonts wingdings, wingdings2, wingdings3, Webdings, and MTExtra from the Internet. 2. Enter the main folder, press Ctrl+h (show hidden files), and check if there is a .fonts folder. If not, create one. 3. Copy the downloaded fonts such as wingdings, wingdings2, wingdings3, Webdings, and MTExtra to the .fonts folder in the main folder. Then start wps to see if there is still a "System missing font..." reminder dialog box. If not, just Success! Notes: wingdings, wingdin

Experimental environment: OS: LinuxCentos7.4x86_641. View the current server time zone & list the time zone and set the time zone (if it is already the correct time zone, please skip it): #timedatectl#timedatectllist-timezones#timedatectlset-timezoneAsia/Shanghai2. Understanding of time zone concepts: GMT, UTC, CST, DSTUTC: The entire earth is divided into twenty-four time zones. Each time zone has its own local time. In international radio communication situations, for the sake of unification, a unified time is used, called Universal Coordinated Time (UTC). :UniversalTim

How to use one network cable to connect two ubuntu hosts to the Internet 1. Prepare host A: ubuntu16.04 and host B: ubuntu16.042. Host A has two network cards, one is connected to the external network and the other is connected to host B. Use the iwconfig command to view all network cards on the host. As shown above, the network cards on the author's A host (laptop) are: wlp2s0: This is a wireless network card. enp1s0: Wired network card, the network card connected to host B. The rest has nothing to do with us, no need to care. 3. Configure the static IP of A. Edit the file #vim/etc/network/interfaces to configure a static IP address for interface enp1s0, as shown below (where #==========

Different CPU architectures mean that running DOS on the Raspberry Pi is not easy, but it is not much trouble. FreeDOS may be familiar to everyone. It is a complete, free and well-compatible operating system for DOS. It can run some older DOS games or commercial software, and can also develop embedded applications. As long as the program can run on MS-DOS, it can run on FreeDOS. As the initiator and project coordinator of FreeDOS, many users will ask me questions as an insider. The question I get asked most often is: "Can FreeDOS run on a Raspberry Pi?" This question is not surprising. After all, Linux runs very well on the Raspberry Pi
