Thursday, November 2, 2017

Getting familiar with Linux terminal commands

Day1: (2017/01/11)Getting familiar with Linux terminal commands


  1. Create a new user (preferably using your name as login name)
    Use the command : adduser newuser.
  2. Reset password of user
    Use the command : sudo passwd newuser.
  3. Create a directory called my_group at home and give permissions to user and group
    Use the command mkdir my_group (This will create a folder call my_group).
    And then use the chmod to provide permission
  4. Create a directory called my_user at home and give permissions to user only
    Use the command : chmod
  5. How many network interfaces your computer has?
    Use the command : ls /sys/class/net
  6. Install xmind on your desktop without using yum.
    Steps followed
            1.Download xmind zip folder
            2.Unzip the folder
            3.type the command sudo then drag nad drop the setup.sh file to the terminal.
  7. How you get last 5 entries of /var/log/messages
    Use the command : tail -n 5 /var/log/syslog  (in latest Linux versions /var/log/messages is replaced with /var/log/syslog  ).

  8. How you get first 5 entries of /var/log/messages
    Use the command : head -n 5 /var/log/syslog 
  9. Sort directory/file list based on time inside your home directory.
     Use the command : gsettings set org.gnome.nautilus.preferences     default-sort-order "mtime"
  10. Rename your directory my_group to my_group1
     Use the command : mv my_group my_group1.
  11. How you view partition information?
      Use the command : sudo lsblk -o     NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
  12. How you get total sizes of sub directories inside /var using single command?
    Use the command : du -sh
  13. Change system date to yesterday using command line
    Use the command : sudo date 110114232017.24 (here the format is MMddhhmmyyyy.ss. eg: here mention date and time is 2017/11/01  14:23:24)
  14. Remove directory my_group
     Use the command: rm my_group1
  15. What are the following utilizations of your desktop
    1. CPU : sudo apt-get install htop
              then to run type ‘htop
    2. Memory: watch -n 5 free -m
    3. Disk: df -h

No comments:

Post a Comment