This may seem like a long command, but it is great for making sure all file permissions are kept in tact. What it is doing is streaming the files in a sub-shell and then untarring them in the target directory. Please note that the -z command should not be used for local files and no perfomance increase will be visible as overhead processing (CPU) will be evident, and will slow down the copy.
You also may keep simple with, but you don't have the progress info:
cp -rpf /some/directory /other/path
Show Sample Output
If a directory name contains space xargs will do the wrong thing. Parallel https://savannah.nongnu.org/projects/parallel/ deals better with that. Show Sample Output
shows only folders, that are MB or GB in total size
This command lists all the directories in SEARCHPATH by size, displaying their size in a human readable format. Show Sample Output
The pipe to head removes the listing of . as the largest directory.
Found this one little more for me. This one removes the perl dependency (from command 2535). Source for command : http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/ Show Sample Output
Built-in function in linux, should work on any distro Show Sample Output
biggest->small directories, then biggest->smallest files Show Sample Output
When you do a ls -1 | xargs rm it wouldn't workd because those files have spaces. So you must use find -print0 and xargs -0
Displays only the subtotal size of a directory with the -s option, and in human readable format. Show Sample Output
this command shows the space used in postgres directory. Show Sample Output
Parsing the output of ls is never a good idea for any reason. Using find this way: - works with files that have spaces in their names. - actually lists "sub folders" and not of all files and folders. - does not break if there are a huge number of files in the current directory.
Prints the size of Directory in human readable format like KB MB or GB. If you want to see size each files and directories inside the directory use -a option as shown in second output and if you want a total sum then add -c option :) Show Sample Output
Sometimes you want to know the summary of the sizes of directories without seeing the details in their subdirectories. Especially if it is going to just scroll off the screen. This one liner summarizes the disk usage of any number of directories in a directory without giving all the details of whats happening underneath. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: