I'm using Ubuntu 14.04 and I made an empty directory on /tmp with the mkdir command:  cd /tmp mkdir foo   and then I checked it's size using ls:  ls -ldh foo   and the result shows that the size of the directory is 4KB, although it has nothing inside!  then I created an empty file with touch:  touch empty   and then I checked its size:  ls -l empty   the result shows that the empty file is of 0B, which differs from the empty directory.  I've read about some Q&amp;A's saying that the 4KB is the metadata of the directory. But if it is the metadata, what kind of information is stored inside and why it is so huge, and why an empty file don't have such kind of metadata? If it is not the metadata, what does the 4KB mean?
22670
What does size of a directory mean in output of ls -l command?
23385
I know that touch command creates a file:  touch test1.txt   but how I can create a file and its full path?  for example my desktop contains nothing:  ~/Desktop/$ ls ~/Desktop/$   and I want to create 1.txt in ~/Desktop/a/b/c/d/e/f/g/h/1.txt. Can I do this with a simple command like:  $ touch ~/Desktop/a/b/c/d/e/f/g/h/1.txt   instead of create full path manually and then create the file?
115390
So here is what i want to pull : mmcblk0 whith it's size 15.7 GB.  C:\adb&gt;adb shell shell@android:/ $ su su shell@android:/ # fdisk -l /dev/block/mmcblk0 fdisk -l /dev/block/mmcblk0  Disk /dev/block/mmcblk0: 15.7 GB, 15758000128 bytes 1 heads, 16 sectors/track, 1923584 cylinders Units = cylinders of 16 * 512 = 8192 bytes   This is what I tried:  C:\adb&gt;adb shell su busybox cat /dev/block/mmcblk0 &gt; C:\1.bin   I only have 1KB output with content inside said "unknown id". Also tried with pull but seems also doesn't work.  What should I do to get this 15.7 GB mmcblk0  ?
86334
I want to give some scenarios:   A movie file shows 700 MB in Windows but it shows around 735 MB in Ubuntu, which is in my drive having NTFS partition. Similarly another file shows 446 MB in Windows but 467 MB in Ubuntu. Also when I download files from internet they change once downloaded in Ubuntu but do not change in Windows. I generally have to upload torrents mentioning the file sizes. Most of the time I use Ubuntu, I use Windows to play games only.   Actually my questions are:   Which size should I mention while creating torrents? Is there any tool or software or formula to calculate the file size in Ubuntu equivalent to file size in Windows?   I have already tried following links but could not find my actual answers:
46123
Using Ubuntu 11.10, I accidentally deleted a file that was approximately 700 MB. I tried to find it in the in following locations, but couldn't:  /home/user/.local/share /home/user/ &lt;-- there was no folder .Trash /home/user/Desktop/ &lt;-- there was no folder .Trash   So where did .Trash go in Ubuntu 11.10 onward? I use the Gnome environment.
114873
The root filesystem ran out of space, so I'm deleting all the extraneous junk. I already deleted everything in /var/log and /var/cache/apt/archives and did sudo apt autoremove.  This /var/tmp is using 18.5 GiB. What is it used for? Is it safe to delete the contents?  UPDATE  I found these 2 swap files:  474M    10112015.tgz.swp 19G     10022015.tgz.swp   Those swap files were generated by opening tar files in vi.   Is there a way to limit the amount of storage space used by /var/tmp?
90281
I want to get a list of the directories and their sizes in a list format like how you get when you do a ls -l.  The thing is that is there a one line command that can do this? I see others have long commands just to output this. That's just too long.  What command can do this or combination of commands that can be easily typed? du -h gives it, but it displays all of the sub-folders which is not what I want. just the current directories folders.
67809
When I first installed Ubuntu (actually ElementaryOS) I didn't think that it would take up that much space, so I made the OS partition 15GB and /home 100GB. sda5 and sda6 are my Linux partitions.  Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x1b518505     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048      823295      410624    7  HPFS/NTFS/exFAT /dev/sda2          823296   410943487   205060096    7  HPFS/NTFS/exFAT /dev/sda3       410943488   738621439   163838976    7  HPFS/NTFS/exFAT /dev/sda4       738623486   976771071   119073793    5  Extended /dev/sda5       738623488   767918079    14647296   83  Linux /dev/sda6       767920128   976771071   104425472   83  Linux     The thing is, I don't actually have anything new installed on the OS now compared to when it was fresh. Just a browser and sublime text. Over time, installing system updates, the size just keeps on going up and up.    /usr/src has 2.2 GB of folders named linux-headers-X.XX.X-XX  /lib/modules has 3.9 GB of X.XX.X-XX-generic folders  Advice on what to do would be appreciated.   If I choose to increase the size of the 15GB partition, how do I do it? What are /usr/src and /lib/modules and how do I delete them safely?
13829
This is a situation I often find myself in:  mkdir /Some/really/long/path/to/a/directory/ cd /Some/really/long/path/to/a/directory/   I know that ideally you would cd /Some/...etc.../a/ and then mkdir directory, but I've often performed mkdir first and then had to cd to the end of the same lengthy file path I just created.  Short of doing...  var="/Some/...etc.../a/" mkdir $var/directory; cd $var   ...which is even worse, is there some way to reuse the parameter passed to the previous command? I'm aware of course of tab completion, but in a series of nested directories with similar names this doesn't always help that much. Ideally, I'm hoping for a shortcut like $# or $@.  Failing this, the next best time-saving solution would be equally appreciated!
98583
CentOS 5.9   I came across an issue the other day where a directory had a lot of files.  To count it, I ran ls -l /foo/foo2/ | wc -l  Turns out that there were over 1 million files in a single directory (long story -- the root cause is getting fixed).   My question is: is there a faster way to do the count?  What would be the most efficient way to get the count?
94683
I have a 256GB SSD disk on which I converted my ext4 root FS to btrfs. I erased the ext4 backup subvolume, enabled compression and defragmented recursively to enable it on all files.  btrfs fi df / has an output that worries me though:  Data: total=148.00GB, used=106.11GB System: total=32.00MB, used=16.00KB Metadata: total=65.00GB, used=2.04GB   If I understand the output correctly, 65GB (1/4 of my disk!) is reserved for meta-data and not available for storing files. If this is correct, it would be a huge waste of my disk space. Am I understanding correctly? Can the metadata-allocated portion of my disk be resized?
80404
How can I find every empty directory, let's say, on the /home/.../Desktop. Because I am on Solaris, I can't use the find . -empty -type d command. Is there any other way?
111432
The "Trash" of a 16-GB usb2 flash drive had 3.4-GB of data. I emptied it as such:     $ cd /Volumes/FooDrive/.Trashes/501   $ rm -rf *   This took over 5-seconds. That seemed pretty long. So, as a test I just decided to empty the Trash of all of my drives via Finder. Other drives: 2-TB usb3 500-GB usb2 16-GB usb2 250-GB ssd  I measured the size of the Trash as such:       $ du -ch /Volumes/WhateverDrive/.Trashes   There was 15-GB in the Trash of the 500-GB drive, and 5-GB in the Trash of my other 16-GB flash drive. I didn't measure the other drives.  Finder appeared to take much less than 5-seconds to empty the Trash for all those drives.   Does Finder really empty the Trash so much more quickly than /bin/rm? How?   Does Finder just make the "clicking sound" (signaling the trash is empty) before the Trash on all the drives is really empty?
114469
I was wondering what could be the size of an object of an empty class. It surely could not be 0 bytes since it should be possible to reference and point to it like any other object. But, how big is such an object?  I used this small program:  #include &lt;iostream&gt; using namespace std;  class Empty {};  int main() {     Empty e;     cerr &lt;&lt; sizeof(e) &lt;&lt; endl;     return 0; }   The output I got on both Visual C++ and Cygwin-g++ compilers was 1 byte! This was a little surprising to me since I was expecting it to be of the size of the machine word (32 bits or 4 bytes).  Can anyone explain why the size of 1 byte? Why not 4 bytes? Is this dependent on compiler or the machine too? Also, can someone give a more cogent reason for why an empty class object will not be of size 0 bytes?
65833
(I'm using Windows XP but I guess it's similar in all the recent versions of Windows.)  When you create for example a new empty text document, you'll find in its properties that it has size of 0 bytes. Zero bytes means no information. No data. But still, the file has some name, it can still carry the dates of last access, modification and creation. It carries the information whether it's hidden file or not, whether it's read-only or not...  So where are all the metadata stored?
35349
How is the /tmp directory cleaned up? Is it automatic? If so, how frequently is it cleaned up?
74582
In the get info window it says 387,037,139 bytes which is 387 MB whereas the size on disk is 716.9MB which is 716,900,000 bytes.   du -sh paramgen  result (in MiB) 684M    paramgen  Why is there such a large difference?