Linux command line: Useful User Update-type functions

Discussion in 'Linux' started by jimkd1yv, Nov 17, 2010.

  1. jimkd1yv

    jimkd1yv Well-Known Member

    Joined:
    Jul 6, 2010
    Messages:
    64
    Likes Received:
    0
    As promised, here are my presentation notes from tonight's Linux SIG. Hope you enjoy them, and experiment with the Linux command line.

    Be sure to come out for next month's exciting conclusion of this series, and another topic which will probably involve Linux servers.

    Jim Ritterbusch
    Linux SIG Leader
     

    Attached Files:

  2. jimkd1yv

    jimkd1yv Well-Known Member

    Joined:
    Jul 6, 2010
    Messages:
    64
    Likes Received:
    0
    I found another useful application of the find command which we discussed in this series.

    Suppose your disk is filling and the df command reports much of the space is used in your home directory. However, this directory has tens of thousands of files spread over a dozen levels of subdirectories.

    Further suppose that you suspect that the fullness is caused by a single very large file or group of very large files. You could use the du command, but that will list every file within each directory that it searches, and it is up to you to separate the wheat from the chaff.

    Now here is a way to search files by file size

    find /home -size +200000 -exec ls -l {} \;

    This is similar to what we discussed about searching based on time last modified, but this one will find all files larger than 100 MB, and then perform a ls -l on that result to give you full details. The "size" parameter is in 512 byte blocks, so 200000 * 512 is about 100 MB.

    Even though I told you that you needed single quotes around the braces, I just tried it on my machine and results are the same with or without. YMMV.

    Good luck,
    Jim
     

Share This Page