Some useful Linux shell commands

2 Comment(s)

Below are some useful commands in Linux (applicable for RedHat Enterprise Linux, Fedora and CentOS) for regular server admin activities.
  • To find a word string in the files under a folder(s).
# find . | xargs grep ‘your-string’ -sl
  • To get the disk usages for the individual sub-directory run:
# ls -d /your/path/* | xargs du -sH
  • Replace a word string with another word string in all files in a folder.
Using ‘sed’ command: # sed -i ‘s/ string1/ string2/g’ *.html Using ‘find’ command: # find ./ -type f -exec sed -i ’s/string1/string2/’ {} ;
  • When you deleting huge number of files in a folder, you might receive an error like “/bin/rm: Argument list too long
Comments

2 responses to “Some useful Linux shell commands”

  1. Hi
    Ankur

    I have visited your blog. It’s really a very good effort.
    I will add some value regarding oracle on linux.

    Thanks

  2. Good collection of useful commands!

    Thanks Much

Leave a Reply

Your email address will not be published. Required fields are marked *

+ 75 = 78

Looking for any specific topic / article?


Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

Most popular searches: Technology, Website, AI

Enjoy this blog?

Your may interested in our latest blogs

Stay Updated

Please enter your details below to get
A Free Trial
x + x* =