• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

large

Split A Large File

January 7, 2020

How to split a large file.

split -b 500MB httpd.log
ll -lh
total 1.9G
-rw-r--r-- 1 root root 954M Mar 25 12:35 httpd.log
-rw-r--r-- 1 root root 477M Mar 25 12:38 xaa
-rw-r--r-- 1 root root 477M Mar 25 12:38 xab

split -b 500MB httpd.log ll -lh total 1.9G -rw-r--r-- 1 root root 954M Mar 25 12:35 httpd.log -rw-r--r-- 1 root root 477M Mar 25 12:38 xaa -rw-r--r-- 1 root root 477M Mar 25 12:38 xab

Split with an output file.

split -b 200M httpd.log split.log
ll -lh
total 1.9G
-rw-r--r-- 1 root root 954M Mar 25 12:35 httpd.log
-rw-r--r-- 1 root root 200M Mar 25 12:52 split.logaa
-rw-r--r-- 1 root root 200M Mar 25 12:52 split.logab
-rw-r--r-- 1 root root 200M Mar 25 12:52 split.logac
-rw-r--r-- 1 root root 200M Mar 25 12:52 split.logad
-rw-r--r-- 1 root root 154M Mar 25 12:52 split.logae

split -b 200M httpd.log split.log ll -lh total 1.9G -rw-r--r-- 1 root root 954M Mar 25 12:35 httpd.log -rw-r--r-- 1 root root 200M Mar 25 12:52 split.logaa -rw-r--r-- 1 root root 200M Mar 25 12:52 split.logab -rw-r--r-- 1 root root 200M Mar 25 12:52 split.logac -rw-r--r-- 1 root root 200M Mar 25 12:52 split.logad -rw-r--r-- 1 root root 154M Mar 25 12:52 split.logae

Filed Under: Linux Tagged With: file, large, output, split

List Big Files

March 13, 2019

Find out which files or directories are using up disk resources.

# display the biggest files
find -type f -exec du -Sh {} + | sort -rh | head -n 5
# display the biggest directories
du -Sh | sort -rh | head -5

# display the biggest files find -type f -exec du -Sh {} + | sort -rh | head -n 5 # display the biggest directories du -Sh | sort -rh | head -5

Filed Under: Linux Tagged With: directories, display, files, find, large

  • Home
  • About
  • Archives

Copyright © 2023