LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2011, 04:43 AM   #1
friuli
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Rep: Reputation: Disabled
Unhappy File deletion by accident


Hi guys

I am new on linux, but I deleted everythink on the /tmp dir (I thought I can delete them), but now I wana create /tmp/mapping-root which is a socket file, and I am haveing troubles doing so. How do I create em any1 can hellp me!?

Thank you

Friuli
 
Old 08-11-2011, 09:12 AM   #2
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
did you delete /tmp, or just everyfile in it?
If so, this should recreate it.
you'll need to be root (use su - or sudo)
Code:
mkdir /tmp
chmod a+rwxt /tmp
chown root.root /tmp
I welcome comments from others, I never had to perform the above commands myself

Last edited by 16pide; 08-11-2011 at 09:13 AM.
 
Old 08-11-2011, 12:53 PM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
should be root:root

Not sure about the chmod; I usually don't use it with those 'special bits'
 
Old 08-11-2011, 12:58 PM   #4
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 315

Rep: Reputation: 34
hi
files can be created with a touch command :-
sudo touch /tmp/mapping-root

The file will be now owned by root. You may set the ownership and permissions as required.

sudo chown user:group /tmp/mapping-root

user and group are placeholders for a username and his group.

But I am not sure if you will achieve much by creating the socket file. If it is auto created by an application - like gedit, Then just restarting the application will recreate the file with the appropriate permissions. If it is system file then I doubt if you know what were the permissions and ownerships, so how do you plan to fix that ?

Hope you solve the problem soon enough !
bye
nishith
 
Old 08-12-2011, 03:31 AM   #5
friuli
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
I have installed on the other computer the same applications as I had on this server of mine. I must say that I did everythink above even touched the file "/tmp/mapping-root" set "right" permissions but no srwxr-xr-x only -rwxr-xr-x I even made a file with `mkfifo -m 755 /tmp/mapping-root` but only got prwxr-xr-x as a permission of a file not a socket type of a file but named pipe type of a file.

I was just wondering should I leave it without a file and maybe application will recreate it if needed or should I try to make 1.

Thank you all for your reply
 
Old 08-13-2011, 01:09 PM   #6
nkd
Member
 
Registered: Oct 2006
Location: india
Distribution: fedora 8, ubuntu 10.10
Posts: 315

Rep: Reputation: 34
hi,
the first character a
Quote:
s
in your case indicates it is a unix socket stream file, which are files used for inter process communications.
I would recommend you to just leave it alone and let it get created on it's own.
You may tell the forum, if the removal of the file has given any problem with any application - like some application is not able to start up etc. or maybe a server / process is complaining that it is unable to communicate and so on.

hope that helps
nishith
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
detect file deletion on an operating system and trace the file history or activity? lovsis Linux - Security 2 10-19-2010 08:52 AM
deleted file by accident in fedora hillaryma Linux - Newbie 6 04-01-2010 05:47 AM
renamed mount file by accident clstanton Linux - Newbie 4 05-19-2008 02:25 PM
chsh accident; big accident. shinystuffrox *BSD 3 06-06-2005 07:06 AM
Swap file format (by accident, honest) and boot maxb Linux - General 3 08-01-2003 04:27 AM


All times are GMT -5. The time now is 12:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration