Linux Daily Uses & Advance Commands – Part 2

 


11. How to lock and unlock the user account?

    passwd -l  (lock user account)
    passwd -u  (unlock user account)


    12. What is the command to view and change the expiry date for any user?

      chage -l username
      chage -E YYYY-MM-DD username


      13. What are the field of /etc/passwd file? 
      7 filelds
      test:x:1000:1000:test:/home/test:/bin/bash (grep test /etc/passwd)

      username:password(encrypted stored in  etc/shadow):UID:GID:description:user-home-directory:default-login-shell


      14. What is the difference between .bash_profile and .bashrc?
      Ans. When you log on the system .bash_profile is executed but if you already logged in or open any new terminal .bashrc is executed.


      15. What are the details you get the finger command?

      Ans. It is not pre-install with OS, we are to install finger. It give the login and shell information of a user.


      16. Name 3 files which automatically created inside any user’s home directory when a user is added?
      Ans.
      .bashrc 
      .bash_profile 
      Bash_history 



      17. What is the command to view all the currently logged in users?
        w   (gives a lot information than who)
        who


        18. How to display hidden folder?

          ls -a


          19. What is the difference between $ and # prompt on CLI? 
          Ans.
          # is for root and $ is for user


          20. How to find an error in a file?

            grep error filename

            Popular posts from this blog

            How to Convert PEM KeyFile into PPK KeyFile and vice versa?

            How to transfer Google Cloud Storage One account data to Google Cloud another account?

            MySQL Commands, Administration, Backup, Restore