Day 20 Learnings: Help and Information Commands in Linux
Table of contents
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
Search Commands by Keyword:
Found commands related to file permissions:apropos permissions
Filter Results:
Narrowed results using specific keywords.
Using the info
Command
View Detailed Documentation:
Accessed information about thels
command:ls
Navigate Sections:
Used the arrow keys andq
to quit.
Creating and Using Aliases
Create Temporary Aliases:
Shortenedls -la
toll
:alias ll='ls -la'
Persist Aliases:
Added the alias to the.bashrc
file for permanence.
Using the uname
Command
Display System Information:
Retrieved the OS name and kernel version:uname -a
Using the df
Command
Show Disk Space Usage:
Displayed available space in human-readable format:df -h
Using the du
Command
View Directory Size:
Checked the size of the current directory:du -sh .
Analyze File Sizes Recursively:
Displayed sizes of all subdirectories:du -h --max-depth=1
Using the mount
Command
Mount a File System:
Mounted a USB drive to/mnt/usb
:sudo mount /dev/sdb1 /mnt/usb
Unmount a File System:
Used theumount
command:sudo umount /mnt/usb
Using the ln
Command
Create a Symbolic Link:
Linkedfile.txt
tolink.txt
:ln -s file.txt link.txt
Create a Hard Link:
ln file.txt hardlink.txt
Problems I Encountered
Forgot to Persist Aliases:
Aliases reset after the terminal session ended.Incorrect Mount Points:
Specified an invalid mount point, causing errors.
How I Solved These Problems
Persisting Aliases:
Edited the.bashrc
file to add aliases and reloaded it using:source ~/.bashrc
Verified Mount Points:
Ensured the mount point directory existed before using themount
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!