category:

Some useful Linux shell commands
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
Share
Comments (2)

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 *

10 + = 19

Related:

Stay Updated

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