Kinds Of Links In Linux And Use Of Unlink

Hello, I am learning about file types in Linux, and i see there are hard and symbolic links, also I saw that unlink function in C deletes a link to a file and decrements the intern link counter. The problem is that i don't understand what link is deleted when unlink is called. Is it the parents link to that file?


Similar Content



How Do I Know If A File Has A Hard Link To It?

ok I know when I create a soft link, it shows a ----> in a long listing and is colored (if ls --color) in aqua.

But hard links don't do this. How can I tell if a file/dir has a hard link to it or if it points to another file?

Possible To Create Symbolic Link On Live USB For Main System?

Hello all,

I was going through LFS yesterday and planned to change the symbolic link from "{bin/sh}{dash}" to "{bin/sh}{bash}". Unfortunately, I disconnected from bin/sh but forgot to create another link. Now the system won't boot and failed to shutdown. Wondering if I can make a symbolic link for it on the Live USB or is there another solution? The Distro is Linux Mint 17.1.

Thanks.

The Behaviour Of Single & Double Quotes In Writing & Running Aliases?

This isn't a problem, more a how or a why:

I have always written an alias (alias ln="ln -sv") which changes the instruction for a "hard" link into one for a "soft". This worked fine until I needed a hard link, so, as part of the alias, I decided to give myself a reminder of what I was doing. After a bit of a struggle, I ended up with this (which I stuffed into my .bash_aliases file):

alias ln="echo -e 'Symbolic (soft) Link (use \033[1;36mhln\033[0m for Hard Link)\nuse \033[1;36m-f\033[0m for force'; ln -sv "

and it works:

Symbolic (soft) Link (use hln for Hard Link )
use -f for force
ln: missing file operand
Try 'ln --help' for more information.

(OK, no operand was supplied here, but the stuff we're talking about works fine).

Recently, however, I needed to look at the construction of the alias, ran "alias ln" & got:

alias ln='echo -e '\''Symbolic (soft) Link (use \033[1;36mhln\033[0m for Hard Link)\nuse \033[1;36m-f\033[0m for force'\''; ln -sv'

Now, I can (sort of) understand the logic of what's going on here, but not entirely - viz:

..1...'...............Open 'protected' mode (was double quote)
........echo -e....Command: invoke "echo -e"
..2...'...............matches 1: Closes 'protected' mode
........\.............invoke newline(\)? Or is this simply an scape character? (Yes it is see http://www.linuxquestions.org/questi...-quote-861714/)
..3...'...............Reopen 'protected' mode (or an escaped single quote - if so why?)
..4...'...............0pens 'protected' mode for "message" code
........Symbolic (soft) Link (use \033[1;36mhln\033[0m for Hard
........Link)\nuse \033[1;36m-f\033[0m for force
..5...'...............5 matches 4 (closes message code),
........\.............invoke newline(\) - or see above
..6...'...............6 matches 3 & closes the section started @ 'reopen'
..7...'...............Reopens 'protected' mode
........; ln -sv......New command[ ; ], creates link
..8...'...............8 matches 7 - the end (or is it?)

I would guess that the "alias" command has some built built in function that does all this - I have saved the the modified version as an alias & it works fine - but although I have read the excellent post:

http://www.linuxquestions.org/questi...-quote-861714/

I don't understand why the system has both double & single quotes. I have always felt that as long as the command line was explained & demonstrated in simple language it was easier to work with that than any point & click system. I grew up with CPM, DOS, Qemm, Desqview, WP5.1, DbII and these were great programs with great (especially WP51) manuals - but, ahh! - those days have gone

Any suggestions gratefully received

dmk

Zorin Dock Launch (ie Quick Launch) Instalation And Use

Hello Linux users. I'm described as a newbie (which i am) but you've never seen a newbie as new as I am I'll wager.

I installed Zorin 9 OS core as an alternative to Microsoft crap that I'm really tired of, (cost as well as never vending bugs). Yes I know I'll still have bugs with linux but at least the patches and fixes in any Linux distro is for the benefit of Linux users and not to sell more Microsoft crap.

I have evidently been reasonably successful to install the latest Zorin 9 with my desktop environment choice. However I'm used to (and like) the MS so called quick launch bar at the bottom of the XP desktop installation, from which I can place links of any app or web link to instantly go there. Correct me if I'm wrong but Linux has basically the same quick launch function which I can choose from the software center and I've tried to select and install at least 2 named Cairo-dock and Docky for example. I did choose and install those according to the Linux prompts but I notice no change in the "Avant Window Navigator" at the bottom of my desktop, and when i try to drag a web link or app to that bar it either flips back to the link spot i saved on the desktop, or there's no action at all. In other words I am not able to put a link or app on the AWN, which AWN does not serve as a dock launcher at all (except for my Firefox browser icon WHICH IS INSTALLED at the left bar location and does work to quick launch Firefox when I left click on it.

So how do I not only properly install that notorious quck launch app in linux Zorin 9 OS and finally drag or otherwise install my links there?

thanks for any advice or replies.

How To Patch OSPF In Ns2.34

Hi mates,

I am trying to patch ospf in ns-2.34 i have downloaded the patch file from link:

http://sourceforge.net/projects/ospf...s/ospf4ns2.34/

$ cd ns-allinone-2.34/
$ patch -p0 < 20-ospf4ns2.34-examples.patch

Using : $ cd ns-2.34/
# make install

$ cd tcl/ex/ospf/
$ mkdir out_ospf0 out_ospf1 out_ospf2 out_ospf3 out_ospf4 out_ospf5 out_ospf6 out_ospf7 out_ospf8 out_ospf9
$ ns ospf0.tcl

i followed the procedure from below LQ link post no #3

http://www.linuxquestions.org/questi...-a-4175492253/

it is successfully patchinf file but it is showing error when i execute ospf0.tcl file



Quote:
(TCL) Creating simulator & trace files...
(TCL) Setting up nodes and links...
(TCL) Configuring traffic objects...
(TCL) Configuring routing protocol...
invalid command name "Agent/rtProto/OSPF"
while executing
"Agent/rtProto/OSPF set helloInterval 1"
(file "ospf0.tcl" line 132)



pls anyone suggest me ideas to get rid of this err.

Thanks in Advance,

Pon

In A Cpp Application I Am Deleting A File On A Partition, But Space Is Not Freeing..

1) deleting file using remove() call
2) no other hard link for the file
3) tried to close file descriptor using following scripts then remove() call
-------
for fd in $(ls /proc/$$/fd); do
case "$fd" in
0|1|2|255)
;;
*)
eval "exec $fd>&-"
;;
esac
done
-------

But space not freed

4) I tried with truncate() and then remove() call Now files deleted and space freed

Is it the only and right way to do this?

How To View Only Hard Links

Hi All,

Is there any command or shell scripting to view only the link files under / .

Is There A Current Active Linux Mint Sub-forum. Please Indicate Its Link

I found a link dated. From 2010. Is there an active one now?

Thank you

The Problem Of Learning Linux

They say there are no secrets in Linux. I am finding that learning about Linux is becoming a life long experience. I have just started using a Debian distribution that is behind the Raspberry pi. My first problem was that the display would go to sleep after about 15 mins when not used. I wanted to turn this feature off. That is I wanted the display to be on all the time.
After some web searching I came across a way to do this. It involved a file in the root area called "lightdm" which stands for light display manager (I think).
Then under this as a file called the lightdm.conf file. Just one line in the config file gets modified. Now doing this via the monkey see monkey do method works. But trying to find out how this works and exactly what the cryptic commands do, ends up being a frustrating endless search. I tried to find the source code for lightdm buts its documentation is certainly not for beginners.
I tried finding out what a "greeter" was once again huge amounts of time spent trying to make sense of endless terminology.

It seems that nowadays trying to learn about the details of any software system is just so hard. Like try and find good documentation on drivers.
Don't get me wrong I love the fact that at least Linux is open source but I wish there was an easy way to learn about it.

Installtion Error For Ns 2.27 On Ubuntu 12.04

following error shown when i tried the command:
cd ns-allinone-2.27/ &&export CC=gcc41 CXX=g++41 && ./install


============================================================
* Testing for Cygwin environment
============================================================
Cygwin not detected, proceeding with regular install.
============================================================
* Build XGraph-12.1
============================================================
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... missing
checking if malloc debugging is wanted... no
checking for gcc... gcc41
checking whether the C compiler (gcc41 ) works... no
configu error: installation or configuration problem: C compiler cannot create executables.
make: *** No targets specified and no makefile found. Stop.
Can not create xgraph; But xgraph is an optional package, continuing...
============================================================
* Build CWeb
============================================================
Making cweb
gcc -g -c -o ctangle.o ctangle.c
ctangle.w:75:12: warning: conflicting types for built-in function ‘strlen’ [enabled by default]
gcc -g -DCWEBINPUTS=\"/usr/local/lib/cweb\" -c common.c
common.w:1409:12: warning: conflicting types for built-in function ‘strlen’ [enabled by default]
common.w: In function ‘fatal’:
common.w:1176:1: warning: format not a string literal and no format arguments [-Wformat-security]
gcc -g -o ctangle ctangle.o common.o
gcc -g -c -o cweave.o cweave.c
cweave.w:79:12: warning: conflicting types for built-in function ‘strlen’ [enabled by default]
cweave.w: In function ‘print_cat’:
cweave.w:1739:1: warning: format not a string literal and no format arguments [-Wformat-security]
gcc -g -o cweave cweave.o common.o
ln: failed to create symbolic link `cweave': File exists
ln: failed to create symbolic link `ctangle': File exists
============================================================
* Build Stanford GraphBase
============================================================
Making sgb
gcc41 -g -I/usr/local/sgb/include -DDATA_DIRECTORY=\"/usr/local/sgb/data/\" -c gb_io.c
make: gcc41: Command not found
make: *** [gb_io.o] Error 127
Unable to create sgb library, but it's optional, so continuing...
============================================================
* Build GT-ITM
============================================================
sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing..
============================================================
* Build zlib
============================================================
Building static library libz.a version 1.1.4 with gcc41.
Checking for unistd.h... No.
Checking for errno.h... No.
Checking for mmap support... No.
gcc41 -O -DNO_ERRNO_H -c -o example.o example.c
make: gcc41: Command not found
make: *** [example.o] Error 127
Zlib make failed, but it's optional Continue ...
============================================================
* Build tcl8.4.5
============================================================
loading cache ./config.cache
checking whether to use symlinks for manpages... no
checking compression for manpages... no
checking for gcc... gcc41
checking whether the C compiler (gcc41 ) works... no
configu error: installation or configuration problem: C compiler cannot create executables.
tcl8.3.2 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.



please help