There is an in command in Linux. The in command is used to establish a synchronous link for a certain file in another location. When using the same file, you only need to put the file in a fixed directory and use the in command to connect it in other directories. Syntax is "ln [parameter][source file or directory][destination file or directory]".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Does Linux have an in command?
ln is another very important command in Linux. Its function is to establish a synchronized link for a certain file in another location. When we need to directory, when using the same file, we don't need to put a file that must be the same in every required directory. We only need to put the file in a fixed directory, and then use ln in other directories. You can just link it with the command without repeatedly occupying disk space.
1. Command format:
ln [参数][源文件或目录][目标文件或目录]
2. Command function:
In the Linux file system, there is a so-called link, which we can regard as an alias of a file, and links can be divided into two types: hard link Unlike soft links (symbolic links), hard links mean that a file can have multiple names, while soft links generate a special file whose content points to the location of another file. Hard links exist in the same file system, but soft links can span different file systems.
Soft link:
1. Soft link exists in the form of a path. Similar to shortcuts in the Windows operating system
2. Soft links can cross file systems, but hard links cannot
3. Soft links can link to a non-existent file name
4. Soft links can link directories
Hard links:
1. Hard links exist in the form of file copies. But it doesn't take up actual space.
2. It is not allowed to create hard links to directories
3. Hard links can only be created in the same file system
There are two points to note here:
First, the ln command will maintain the synchronization of each linked file, that is to say, no matter where you change, other files will have the same changes;
Second, ln The links are divided into soft links and hard links. The soft link is ln -s source file target file. It will only generate a mirror image of the file at the location you selected and will not occupy disk space. The hard link ln source file Target file, without parameter -s, it will generate a file with the same size as the source file at the location you selected. Whether it is a soft link or a hard link, the file will keep changing synchronously.
The ln command is used to link files or directories. If two or more files or directories are specified at the same time, and the final destination is an existing directory, all previously specified files or directories will be copied to in this directory. If multiple files or directories are specified at the same time, and the final destination is not an existing directory, an error message will appear.
3. Command parameters:
Required parameters:
-b Delete, overwrite previously established links
-d Allow super users to create hard links to directories
-f Forces execution of
-i interactive mode. If the file exists, the user will be prompted whether to overwrite it.
-n Treat symbolic links as general directories.
-s Soft links ( Symbolic link)
-v Display detailed processing
Select parameters:
-S “-S
-V “-V
- -help displays help information
--version displays version information
4. Usage example:
Example 1: Create a soft link to a file
Command:
ln -s log2013.log link2013
Output:
[root@localhost test]# ll -rw-r--r-- 1 root bin 61 11-13 06:03 log2013.log [root@localhost test]# ln -s log2013.log link2013 [root@localhost test]# ll lrwxrwxrwx 1 root root 11 12-07 16:01 link2013 -> log2013.log -rw-r--r-- 1 root bin 61 11-13 06:03 log2013.log
Instructions:
Create a soft link link2013 for the log2013.log file. If log2013.log is lost, link2013 will be invalid
Example 2: Create a hard link to the file
Command:
ln log2013.log ln2013
Output:
[root@localhost test]# ll lrwxrwxrwx 1 root root 11 12-07 16:01 link2013 -> log2013.log -rw-r--r-- 1 root bin 61 11-13 06:03 log2013.log [root@localhost test]# ln log2013.log ln2013 [root@localhost test]# ll lrwxrwxrwx 1 root root 11 12-07 16:01 link2013 -> log2013.log -rw-r--r-- 2 root bin 61 11-13 06:03 ln2013 -rw-r--r-- 2 root bin 61 11-13 06:03 log2013.log
Description:
Create a hard link ln2013 for log2013.log, log2013.log has the same attributes as ln2013
Related recommendations: "Linux Video tutorial》
The above is the detailed content of Does linux have the in command?. For more information, please follow other related articles on the PHP Chinese website!

Linux maintenance mode is entered by adding init=/bin/bash or single parameters at startup. 1. Enter maintenance mode: Edit the GRUB menu and add startup parameters. 2. Remount the file system to read and write mode: mount-oremount,rw/. 3. Repair the file system: Use the fsck command, such as fsck/dev/sda1. 4. Back up the data and operate with caution to avoid data loss.

This article discusses how to improve Hadoop data processing efficiency on Debian systems. Optimization strategies cover hardware upgrades, operating system parameter adjustments, Hadoop configuration modifications, and the use of efficient algorithms and tools. 1. Hardware resource strengthening ensures that all nodes have consistent hardware configurations, especially paying attention to CPU, memory and network equipment performance. Choosing high-performance hardware components is essential to improve overall processing speed. 2. Operating system tunes file descriptors and network connections: Modify the /etc/security/limits.conf file to increase the upper limit of file descriptors and network connections allowed to be opened at the same time by the system. JVM parameter adjustment: Adjust in hadoop-env.sh file

This guide will guide you to learn how to use Syslog in Debian systems. Syslog is a key service in Linux systems for logging system and application log messages. It helps administrators monitor and analyze system activity to quickly identify and resolve problems. 1. Basic knowledge of Syslog The core functions of Syslog include: centrally collecting and managing log messages; supporting multiple log output formats and target locations (such as files or networks); providing real-time log viewing and filtering functions. 2. Install and configure Syslog (using Rsyslog) The Debian system uses Rsyslog by default. You can install it with the following command: sudoaptupdatesud

When choosing a Hadoop version suitable for Debian system, the following key factors need to be considered: 1. Stability and long-term support: For users who pursue stability and security, it is recommended to choose a Debian stable version, such as Debian11 (Bullseye). This version has been fully tested and has a support cycle of up to five years, which can ensure the stable operation of the system. 2. Package update speed: If you need to use the latest Hadoop features and features, you can consider Debian's unstable version (Sid). However, it should be noted that unstable versions may have compatibility issues and stability risks. 3. Community support and resources: Debian has huge community support, which can provide rich documentation and

This article describes how to use TigerVNC to share files on Debian systems. You need to install the TigerVNC server first and then configure it. 1. Install the TigerVNC server and open the terminal. Update the software package list: sudoaptupdate to install TigerVNC server: sudoaptinstalltigervnc-standalone-servertigervnc-common 2. Configure TigerVNC server to set VNC server password: vncpasswd Start VNC server: vncserver:1-localhostno

Configuring a Debian mail server's firewall is an important step in ensuring server security. The following are several commonly used firewall configuration methods, including the use of iptables and firewalld. Use iptables to configure firewall to install iptables (if not already installed): sudoapt-getupdatesudoapt-getinstalliptablesView current iptables rules: sudoiptables-L configuration

The steps to install an SSL certificate on the Debian mail server are as follows: 1. Install the OpenSSL toolkit First, make sure that the OpenSSL toolkit is already installed on your system. If not installed, you can use the following command to install: sudoapt-getupdatesudoapt-getinstallopenssl2. Generate private key and certificate request Next, use OpenSSL to generate a 2048-bit RSA private key and a certificate request (CSR): openss

Configuring a virtual host for mail servers on a Debian system usually involves installing and configuring mail server software (such as Postfix, Exim, etc.) rather than Apache HTTPServer, because Apache is mainly used for web server functions. The following are the basic steps for configuring a mail server virtual host: Install Postfix Mail Server Update System Package: sudoaptupdatesudoaptupgrade Install Postfix: sudoapt


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version
Chinese version, very easy to use

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function