Day 20 Learnings: Help and Information Commands in Linux

Today's Linux session focused on commands for retrieving system information, file system management, and creating shortcuts for repetitive tasks. These utilities are essential for efficient system administration and navigation.


What I Learned This Week

  • apropos Command: Finds commands related to a specific keyword.

  • info Command: Displays detailed documentation about a command.

  • Alias Command: Creates shortcuts for commands.

  • uname Command: Displays system information.

  • df Command: Shows disk space usage.

  • du Command: Displays directory and file space usage.

  • mount Command: Mounts a file system.

  • ln Command: Creates symbolic and hard links.


Steps I Followed

Using the apropos Command

  1. Search Commands by Keyword:
    Found commands related to file permissions:

     apropos permissions
    
  2. Filter Results:
    Narrowed results using specific keywords.

Using the info Command

  1. View Detailed Documentation:
    Accessed information about the ls command:

     ls
    
  2. Navigate Sections:
    Used the arrow keys and q to quit.

Creating and Using Aliases

  1. Create Temporary Aliases:
    Shortened ls -la to ll:

     alias ll='ls -la'
    
  2. Persist Aliases:
    Added the alias to the .bashrc file for permanence.

Using the uname Command

  1. Display System Information:
    Retrieved the OS name and kernel version:

     uname -a
    

Using the df Command

  1. Show Disk Space Usage:
    Displayed available space in human-readable format:

     df -h
    

Using the du Command

  1. View Directory Size:
    Checked the size of the current directory:

     du -sh .
    
  2. Analyze File Sizes Recursively:
    Displayed sizes of all subdirectories:

     du -h --max-depth=1
    

Using the mount Command

  1. Mount a File System:
    Mounted a USB drive to /mnt/usb:

     sudo mount /dev/sdb1 /mnt/usb
    
  2. Unmount a File System:
    Used the umount command:

     sudo umount /mnt/usb
    

Using the ln Command

  1. Create a Symbolic Link:
    Linked file.txt to link.txt:

     ln -s file.txt link.txt
    
  2. Create a Hard Link:

     ln file.txt hardlink.txt
    

Problems I Encountered

  1. Forgot to Persist Aliases:
    Aliases reset after the terminal session ended.

  2. Incorrect Mount Points:
    Specified an invalid mount point, causing errors.


How I Solved These Problems

  1. Persisting Aliases:
    Edited the .bashrc file to add aliases and reloaded it using:

     source ~/.bashrc
    
  2. Verified Mount Points:
    Ensured the mount point directory existed before using the mount command.


Resources I Used

  • Linux Handbook: apropos Command

  • The Linux Documentation Project

  • GeeksforGeeks: Mount Command Examples

  • TutorialsPoint: Linux Aliases


Conclusion

Today’s exploration provided a comprehensive understanding of commands that enhance efficiency and system awareness. Tools like alias, df, and du are invaluable for day-to-day operations, while mount and ln allow seamless file system management.

Looking forward to diving deeper into advanced Linux topics in the coming sessions!