3

I had to delete some files and whatever, long story, I ran sudo rm -rf /tmp/.

Now, on mac (might be universal, I'm not sure) it is a symlink to /private/tmp/. But my /tmp/ folder has a thumbnail which looks like a broken symlink in Finder (graphical).

But cding to tmp works. How can I see if the folder was recreated sucessfully?

$ stat -x /tmp/
File: "/tmp/"
Size: 238          FileType: Directory
Mode: (1777/drwxrwxrwt)         Uid: (    0/    root)  Gid: (    0/   wheel)
Device: 1,4   Inode: 68494519    Links: 7
Access: Wed Feb 18 14:35:10 2015
Modify: Wed Feb 18 14:31:16 2015
Change: Wed Feb 18 14:31:16 2015
2
  • I don't have much experience with OSX but it should be recreated when you reboot. As long as the /tmp mount point (folder) exists, I am guessing that everything will look normal after rebooting. Commented Feb 18, 2015 at 14:17
  • @tedon Good to hear. Commented Feb 18, 2015 at 15:23

2 Answers 2

1

Just for reference, since you pretty much answer your question yourself... On Mac OS X /tmp is a symlink to /private/tmp. Both are owned by root:wheel; /tmp has mode 0755, /private/tmp has mode 1777. There is no tmpfs-style filesystem involved.

As terdon says, if the Finder gets confused, restarting it (or rebooting) should fix things. But even without that, as long as /tmp exists as described above, the system should work fine.

-1

/tmp is a Virtual File System such as sysfs. Before any action you have to umount /tmp/, then remove it. However almost all Unix OSes need it, so I don't know why you want to remove /tmp.
UPDATE:
In GNU\Linux OS: /tmp didn't mount and if you grep in mount:

root@debian:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=751838,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=1206328k,mode=755)
/dev/sda3 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=21,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=603164k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

But some Unixes uses /tmp as tmpfs.
You can do it :

mount |grep -i tmp
3
  • It was an accident. Commented Feb 18, 2015 at 13:58
  • I update my answer. Commented Feb 18, 2015 at 14:06
  • "/tmp is a Virtual File System" - don't you meant tmpfs? Commented Mar 7, 2015 at 21:19

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.