Create a soft link command in linux-ln-s

Source: Internet
Author: User
Create a soft link command in linux-ln-s this is a very important command in linux, please be familiar with it. Its function is to create a non-same link for a file in another location. The most common parameter of this command is-s. The specific usage is the target file of the ln-s source file. When you create a soft link command in... linux-ln-s, this is a very important command in linux. please be familiar with it. Its function is to create a non-same link for a file in another location. The most common parameter of this command is-s. The specific usage is the target file of the ln-s source file. When we need to use the same file in different directories, we do not need to put a file that must be the same under each required Directory. we only need to put it in a fixed directory, put the file, and then use the ln command link in other directories to link it, without occupying disk space repeatedly. For example, ln-s/bin/less/usr/local/bin/less-s indicates the symbol (symbolic. Note: First, the ln command will keep the synchronization of each link file. that is to say, no matter where you change it, other files will change the same. second, there are two types of ln links: soft link and hard link. the soft link is ln-s *****. it will only generate a file image at your selected location, it does not occupy disk space. the hard link ln *** has no parameter-s. it will generate a file of the same size as the source file at the selected position, both soft links and hard links are synchronized. If you use ls to view a directory, you will find that some files are followed by a @ symbol, that is, a file generated using ln command, and you can use ls-l command to view it, the link path is displayed. ========================================================== ====================================================== Demonstrate a practical example: bash: sqlplus: command not found solution environment variables have been configured, but the error is still reported: [oracle @ dg1 ~] $ Vi. bash_profile #. bash_profile # Get the aliases and functionsif [-f ~ /. Bashrc]; then .~ /. Bashrcfi # User specific environment and startup programsPATH = $ PATH: $ HOME/binexport PATHunset USERNAME export EDITOR = viexport ORACLE_SID = dg1export ORACLE_BASE =/u01/app/oracleexport ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1export release = $ ORACLE_HOME/lib: /usr/libexport PATH =/u01/app/oracle/product/10.2.0/db_1/bin:/usr/sbin: /usr/local/bin:/usr/X11R6/binexport PATH = $ ORACLE_HO ME/bin: $ PATHumask 022 solution: [oracle @ dg1 ~] $ Sqlplus/nologbash: sqlplus: command not found [oracle @ dg1 ~] $ Ln-s $ ORACLE_HOME/bin/sqlplus/usr/binln: creating symbolic link '/usr/bin/sqlplus' to '/bin/sqlplus ': permission deni ed [oracle @ dg1 ~] $ Su-rootPassword: [root @ dg1 ~] # Ln-s $ ORACLE_HOME/bin/sqlplus/usr/bin [root @ dg1 ~] # Su-oracle [oracle @ dg1 ~] $ Sqlplus/nologSQL * Plus: Release 10.2.0.1.0-Production on Mon May 11 12:51:24 2009 Copyright (c) 1982,200 5, Oracle. all rights reserved. SQL> conn/as sysdbaConnected to an idle instance. SQL> startupORACLE instance started. total System Global Area 167772160 bytesFixed Size 1218316 bytesVariable Size 79694068 bytesDatabase Buffers 83886080 bytesRedo Buffers 2973696 bytesDatabase mounted. database opened. SQL>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.