

Reverse it, biggest to smallest: $ du -ah ~/Downloads/ | sort -rh | head -6ģ.8G /home/saml/Downloads/audible/audio_booksġ.5G /home/saml/Downloads/digital_blasphemy/db1440ppng.zipġ.5G /home/saml/Downloads/digital_blasphemyĭon't show me the directory, just the files: $ du -ah ~/Downloads/ | grep -v "/$" | sort -rh | head -6Ĩ35M /home/saml/Downloads/apps_archive/cad_cam_cae/salome/Salome-V6_5_0-LGPL-x86_64.run I'm using the head -6 just to limit the amount of output! $ du -ah ~/Downloads/ | head -6Ĥ.4M /home/saml/Downloads/kodak_W820_wireless_frame/W820_W1020_WirelessFrames_exUG_GLB_en.pdfĦ24K /home/saml/Downloads/kodak_W820_wireless_frame/easyshare_w820.pdfĤ.9M /home/saml/Downloads/kodak_W820_wireless_frame/W820_W1020WirelessFrameExUG_GLB_en.pdfĩ.8M /home/saml/Downloads/kodak_W820_wireless_frameĦ04K /home/saml/Downloads/netgear_gs724t/GS7xxT_HIG_5Jan10.pdfĮasy enough to sort it smallest to biggest: $ du -ah ~/Downloads/ | sort -h | head -6Ġ /home/saml/Downloads/apps_archive/monitoring/nagios/nagios-check_sip-1.3/usr/lib64/nagios/plugins/check_ldapsĠ /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/0/index/write.lockĠ /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/0/translog/translog-1365292480753Ġ /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/1/index/write.lockĠ /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/1/translog/translog-1365292480946Ġ /home/saml/Downloads/data/elasticsearch/nodes/0/indices/logstash-2013.04.06/2/index/write.lock If you don't want them then drop that switch. The -h will produce human readable sizes which I prefer. The command du -ah DIR will produce a list of all the files and directories in a given directory DIR. The approach: $ du -ah | grep -v "/$" | sort -rh Just to be on the safe side I'm using this version of du: $ du -version We’ll learn more about these types of commands in our next Linux post.You can also do this with just du. You can also specify directory name, by using the following command – $ grep -r -l "linux" /path/to/dir/*.cĬongratulations! Now, you know “How to Recursively Search all files for a string on a Linux”. To display print only filenames with GNU grep, use the following command – $grep -r -l "linux" Zookeeper_installation.htm:$ tar -zxf jdk-8u60- linux-圆4.gz
Find file linux recursevily download#
Please download the file on your machine. Zookeeper_installation.htm:The latest version (while writing this tutorial) is JDK 8u 60 and the file is “jdk-8u60- linux圆4.tar.gz”.

To ignore case distinctions, use the following command – $ grep -ri "linux".
Find file linux recursevily how to#
How to mount NTFS Drives on a Linux System? How to partition and format a new drive in Linux System? How to Increase the size of a Linux LVM by adding a new disk How to create a new virtual disk for an existing Linux virtual machine? How to add a New Disk Drive to a Linux System? The sample output should be like this – zookeeper_installation.htm:Any of Linux OS − Supports development and deployment. The command should be like this ~/Downloads$ grep -r "Linux" Syntax of is shown as below- $ grep -r "word"įor example, for searching “Linux” word in Downloads directory. Using the grep command, we can recursively search all files for a string on a Linux. Use grep to search for lines of text that match one or many regular expressions, and outputs only the matching lines. The grep command is used to search text or scans the given record for lines containing a match to the given strings or words.
