This weekend, I decided to spend some time sharpening my Linux command-line skills. There's something satisfying about getting comfortable with the basics, and it helps build a strong foundation for more advanced tasks. Here’s a quick recap of what I practiced:
Displaying the Date and Time
The first command I explored was the date command. It’s straightforward but essential for checking the current date and time.
To simply display the current date and time:
$ date
If you need the time in GMT/UTC:
$ date -u
This command is particularly handy when working with servers across different time zones.
Echoing Text with Quotes
Next up was the echo command, which is used to print text to the terminal. It’s often used in scripts to display messages or output variables.
Using double quotes to print a simple message:
$ echo "Hello World"
It’s a simple command, but understanding how to use quotes can be important, especially when working with strings that contain spaces or special characters.
Listing Directory Contents with ls
The ls command is one of the most frequently used in Linux. It lists the contents of a directory and comes with several useful options.
To list files and directories in the current directory:
$ ls
For a more detailed list, showing file permissions, ownership, and size:
$ ls -l
To list files with sizes in a human-readable format (like KB, MB):
$ ls -lh
Practicing these commands reinforced my understanding of basic file and system management in Linux. It was a productive weekend, and these small exercises reminded me of the power and simplicity of the command line. I’m looking forward to diving deeper into more complex commands and scripting in the coming weeks!
Top comments (0)