Important Linux Commands

 

  1. ls -lrt → command lists the contents of the directory with all the details, in reverse order of their modification time (older files will be displayed first)

  2. ls -lrth → This will list the contents of the current directory showing more information and sorting them so the most recently modified file will be displayed last. The h flag makes the file sizes more human friendly!

  3. chmod 755 <name> → chmod 755 sets the 755 permission for a file. 755 means full permissions for the owner and read and execute permission for others.

  4. ln -s 14.9.0-SNAPSHOT current → Create a current tag and mapped to current version. To link files in the same directory

  5. Update Any File → sed -i 's/10.46.87.148/10.46.87.115/g' journal.sch textToFind → 10.46.87.148 replaceText → 10.46.87.115 FileName → journal.sch . SED is a text stream editor used on Unix systems to edit files quickly and efficiently

  6. Untar a tar file → tar -xvzf filename.tar

  7. Rmove a folder → rm -r folderName

  8. netstat -anpe | grep "1234" | grep "LISTEN" → Application listening to the specific port.

  9. grep -Ril "text-to-find-here" / → Find a test in all the files in linux.

  10. Generate a keystore → keytool -genkey -alias Anykeystore -keyalg RSA -keystore keystore

  11. Add certificate to key store → keytool -importcert -file any.cer -keystore keystore -alias "Anycertificate"

  12. Copy a file from one AMS to another AMS → scp filename user@10.46.87.146:/path

  13. To check port on which application is running → ps -ef | grep appcrm

  14. grep -irl "BalanceMgr&interval" * → To get the files that have this text.

  15. Change owner of a file/directory → chown -R username filename. -R is for recursive it will change all the files and directory inside. Ex. chown -R rkadm ngrc.

  16. Change grp of a file/directory → chgrp -R groupName fileName. Ex.chgrp -R any ngrc.

Comments

Popular posts from this blog

Java 8 : Find the number starts with 1 from a list of integers

Optional Vs Null Check

How to prevent Singleton Class from Reflection and Serialization