Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page



 

Linux / Unix ln command

Quick links

About ln
Syntax
Examples
Related commands
Linux / Unix main page

About ln

Creates a link to a file.

Syntax

ln [-f] [-n] [-s] existingfile newname

-fLink files without questioning the user, even if the mode of target forbids writing. This is the default if the standard input is not a terminal.
-nDoes not overwrite existing files.
-sMakes it so that it does not create a symbolic link (not on System V.) existingfile - The file that you want to create a new link.
existingfileSpecifies file(s) that you want to create a link to.
newnameThe new name of the file.
directoryThe directory were you want the new link.

Examples

ln public_html/myfile.txt

Would create a hard link to myfile.txt in the current directory assuming that it is not public_html. Note: A link cannot be created to a file if currently in the directory where the file exists.

ln -s file1 file2

Creates a symbolic link to file1 with the name of the file2. 

Related commands

chmod
link
ls

Index

Category:
Linux / Unix

Companies:
Click here

Related Pages:

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope