≡ Menu

head command

Linux: Sort du -h (human-readable) Output By Size

I have a large number of files stored in ~/Downloads/ directory. How do I sort and print sizes in human readable format using du -h command under Ubuntu Linux LTS version 12.04 or any other Linux distributions?
[click to continue…]

Unix / Linux: Show First 10 or 20 Lines Of a File

I have a directory with many files. I am trying to write a shell script that will only show first 10 or 20 lines of a file. How do I display first 10 or 20 lines of a file on Linux or Unix-like systems?
[click to continue…]

Linux / Unix: Display First Line of a File

How do I display first line of a text file called foo.txt on Linux or Unix-like operating systems?
[click to continue…]

How Do I Find The Largest Top 10 Files and Directories On a Linux / UNIX / BSD?

How do I find the largest top files and directories on a Linux or Unix like operating systems?
[click to continue…]