12-17-2001
link and unlink , urgently...
Hi all
I did something incorrectly about link command.
I try to make a link from a sub-dir to root dir, but I use the following command:
link / zzz
the result is sub-dir "zzz" was linked to "/"
Then I want to remove the "zzz" by using unlink command:
unlink zzz
It say that "Device busy"
I cannot rm nor rmdir. I can only rename it but cannot move it to any directory.
I try to boot to single user mode and try to unlink it again but it still device busy.
What happen to "zzz"
How can I delete the "zzz" without lost any content in my root dir?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello all,
I have a script which runs every 15 minutes and moves all but latest 10 files from a directory (A) to Directory (B).
Most of the times this job runs fine but sometimes it is giving "mv: cannot unlink {Target Directory name } : Permissions denied."
Any help about this error msg... (1 Reply)
Discussion started by: super_duper_guy
1 Replies
2. Shell Programming and Scripting
Hi,
I have a two lines of code both intend to perform the same task.
unlink $CtrFile;
system ("rm $CtrFile");
Both of which try to delete a certain file. However when I use the unlink command the file does not get deleted. When I use the "rm" system... (2 Replies)
Discussion started by: jerardfjay
2 Replies
3. Solaris
I was trying to remove a symbolic link of /etc/hosts to /etc/inet/hosts
well i forgot the command and in the /etc directory i did unlink inet and now i can not get into inet and it does not exist in /etc
1) what do i do to fix the inet directory
2) how do i link /etc/hosts to... (1 Reply)
Discussion started by: deaconf19
1 Replies
4. Solaris
We are using Solaris 10 on tiny box. My issue is after server panic cron is not coming up, I've tried to manually restart cron but no luck.
# cron stop
cron could not unlink FIFO: no such file or directory
! cannot create fifo queue Thu Dec 17 11:20:17 2009
! ******* CRON ABORTED *******... (5 Replies)
Discussion started by: patidarv
5 Replies
5. Shell Programming and Scripting
I had a directory like A/B/C and these are all what I did.
cd A/B/C
ln -s some_path/some_sub_dir/C/* .
After this, I have around say 1000 files linked to my A/B/C directory. How can unlink all those files at one shot? The unlink command requires filename as an argument but what I need is to... (1 Reply)
Discussion started by: dahlia84
1 Replies
6. Shell Programming and Scripting
Hello,
I have a set of directories, which has inside them, symbolic links to some files. What i would like to do is to covert the links into actual files, i.e. remove the link and copy the actual file here...
I tried to see unlink command but i think all it does is delete the link, is... (2 Replies)
Discussion started by: prasbala
2 Replies
7. Programming
Hello All,
I've encountered a strange behaviour from g++ that doesn't make sense to me. Maybe you can shed some light on it:
I have a bunch of source files and want to compile them and link them with a static library liba.a located in /usr/local/lib64 into an executable
Approach 1 works... (0 Replies)
Discussion started by: magelord
0 Replies
8. Shell Programming and Scripting
I wish to unlink multiple links, but man pages shows
unlink - call the unlink function to remove the specified file
let's linked are in number sequence and I'm doing
unlink `echo {1..500}`
This fails..
Is their any other command to execute it or I need to call the unlink function that... (1 Reply)
Discussion started by: posix
1 Replies
9. Solaris
Hi All
I am facing an issue with our new solaris machine.
in /var/adm/messages
Apr 22 16:43:05 Prod-App1 in.routed: interface net0 to 172.16.101.1 turned off
Apr 22 16:43:33 Prod-App1 mac: NOTICE: nxge0 link up, 1000 Mbps, full duplex
Apr 22 16:43:34 Prod-App1 mac: NOTICE: nxge0 link... (2 Replies)
Discussion started by: javeedkaleem
2 Replies
10. Shell Programming and Scripting
Hi,
I have a dir and some files as below (all have full perm)
drwxrwxrwx 2 sam sam 4096 Aug 8 04:31 /home/sam/test
$ ll /home/sam/test
-rwxrwxrwx 1 sam sam 0 Aug 8 04:31 b1_2013_file.txt
-rwxrwxrwx 1 sam sam 0 Aug 8 04:31 c1_2014_file.txtI want to go to this directory and delete the... (2 Replies)
Discussion started by: sam05121988
2 Replies
link(1M) System Administration Commands link(1M)
NAME
link, unlink - link and unlink files and directories
SYNOPSIS
/usr/sbin/link existing-file new-file
/usr/xpg4/bin/link existing-file new-file
/usr/sbin/unlink file
DESCRIPTION
The link and unlink commands link and unlink files and directories. Only super-users can use these commands on directories.
Use link to create a new file that points to an existing file. The existing-file and new-file operands specify the existing file and
newly-created files. See OPERANDS.
link and unlink directly invoke the link(2) and unlink(2) system calls, performing exactly what they are told to do and abandoning all
error checking. This differs from the ln(1) command. See ln(1).
While linked files and directories can be removed using unlink, it is safer to use rm(1) and rmdir(1) instead. See rm(1) and rmdir(1).
/usr/xpg4/bin/link
If the existing file being hard linked is itself a symbolic link, then the newly created file (new-file) will be a hard link to the file
referenced by the symbolic link, not to the symbolic link object itself (existing-file).
OPERANDS
The following operands are supported:
existing-file Specifies the name of the existing file to be linked.
file Specifies the name of the file to be unlinked.
new-file Specifies the name of newly created (linked) file.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of link: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
/usr/xpg4/bin/link
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWxcu4 |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
ln(1), rm(1), link(2), unlink(2), attributes(5), environ(5), standards(5)
SunOS 5.10 9 Oct 2002 link(1M)