17

In Linux you can use the ln command to make links.

$ touch foo
$ ln -s foo foo_link
$ ls -l
lrwxrwxrwx  1 cklein cklein         3 May 29 16:11 foo_link -> foo

I assume that the 'l' in ln stands for "link", but what does the 'n' stand for?

What does ln stand for?

Cory Klein
  • 18,391
  • 26
  • 81
  • 93

1 Answers1

44

All the ln means "link", not just the "l". Just the same as ls meaning "list", cp means "copy" and mv means "move".

They are part of the "two letter commands", for example:

  • ar — ARchive
  • as — ASsembler
  • bc — Basic Calculator
  • cc — C Compiler
  • cp — CoPy files and directories
  • dc — Desk Calculator
  • dd — Data Description: convert and copy a file
  • df — Disk Free: report file system disk space usage
  • du — Disk Usage
  • ed — EDitor
  • ld — Link eDitor
  • ln — make LiNks between files
  • lp — Line Printer
  • ls — LiSt directory contents
  • mv — MoVe (rename) files
  • nl — Number Lines of file
  • nm — NaMe list
  • od — Octal Dump
  • pg — PaGinate
  • pr — (PRetty) PRint
  • ps — Process Status: report a snapshot of the current proceses.
  • rm — ReMove files or directories
  • sh — SHell
  • su — run a command with Substitute User and group ID / originally Super User
  • vi — VIsual editor
  • wc — Word Count
Cory Klein
  • 18,391
  • 26
  • 81
  • 93
J. A. Corbal
  • 1,727
  • 1
  • 12
  • 15
  • I think that `su` comes from 'super user' instead – Frederik Deweerdt May 29 '13 at 22:33
  • 6
    Maybe, or just "switch user". – J. A. Corbal May 29 '13 at 22:35
  • 22
    Actually, checking in the UNIX PROGRAMMER’S MANUAL, Seventh Edition, Volume 1, January, 1979. It says 'substitute user'. – Frederik Deweerdt May 29 '13 at 22:43
  • @FrederikDeweerdt Thanks for the clarification. It's good to know those details. – J. A. Corbal May 29 '13 at 22:45
  • 1
    I think your description for `su` is a bit misleading. `su` runs a command with a substitute user and group ID. It doesn't change the current user's UID or make the current user a superuser. –  May 29 '13 at 23:05
  • @EvanTeitelman I disagree. I took that description of `su` from `man su`. My manual was written on 2011-02-16 (may be not the last update --I'm using Gentoo Linux--, but definitely the `su` manual itself.) – J. A. Corbal May 29 '13 at 23:19
  • util-linux added a manpage for `su` in May of 2012 based on the GNU coreutil 'su invocation' info page. It is possible that the manpage you are looking at was created by a third party (i.e. somebody other than a util-linux or GNU developer). Third party manpages are not always subject to the sort of careful inspection that project-provided manpages are subject to. That may explain why the manpage you are looking contains a potentially-misleading description. –  May 29 '13 at 23:49
  • @EvanTeitelman It's possible. I'm updating the answer using the definition in [GNU Coreutils](http://www.gnu.org/software/coreutils/manual/html_node/su-invocation.html). Thanks. – J. A. Corbal May 29 '13 at 23:52
  • Besides that, your answer is excellent, so here's a +1 from me. –  May 29 '13 at 23:55
  • 4
    The [Unix First Edition man pages](http://man.cat-v.org/unix-1st/1/) are available on the Internet. – Gilles 'SO- stop being evil' May 30 '13 at 00:21
  • 1
    "Switch/substitute user" may be more accurate now, but historically, the oldest available implementation of `su`, in Unix v5 (1974), could only switch to super-user: http://pthree.org/2009/12/31/the-meaning-of-su/ – Plutor May 30 '13 at 14:12
  • Read somewhere `ls` is an acronym for List Segments... archaic clearly jlwallen https://www.brighthub.com/computing/linux/articles/14459.aspx I get a feeling you made a lot of these up lol. Also, "grep" is an acronym for Global Regular Expression Print – Ray Foss Oct 11 '19 at 16:45