Day02 - Basic Linux commands

Sabiha MominSabiha Momin
2 min read

Let's learn more about the Basic commands of Linux...

What does any Linux command mean❓

The Linux command is a utility of the Linux operating system. All basic and advanced tasks can be done by executing commands. The commands are executed on the Linux terminal. The terminal is a command-line interface to interact with the system, which is similar to the command prompt in the Windows OS. Commands in Linux are case-sensitive*.*

Basic Linux commands

Listing commands

ls option_flag arguments --> List the subdirectories and files available in the present directory

Examples:

  • ls -l--> List the files and directories in long list format with extra information

  • ls -a --> List all including hidden files and directory

  • ls *.sh --> list all the files having .sh extension.

  • ls -i --> List the files and directories with index numbers Inodes

  • ls -d */ --> list only directories.(we can also specify a pattern)

Directory commands

  • pwd --> print work directory. Gives the present working directory.

  • cd path_to_directory --> Change the directory to the provided path

  • cd ~ or just cd --> change directory to the home directory

  • cd - --> Go to the last working directory.

  • cd .. --> change directory to one step back.

  • cd ../.. --> Change directory to 2 levels back.

  • mkdir directoryName --> to make a directory in a specific location

Now, have a look at the below-given tasks with their solutions to have a clear idea of some Linux Commands.

Task 1:Check your present working directory.

Task 2:List all the files or directories including hidden files

Task 3:Create a nested directory A/B/C/D/E

Now, that you have got slight idea of how to execute a few commands as shown in the tasks above, practice more of the Linux commands.

Hope, you understood the basic Linux commands.

Let's learn more about Linux in my upcoming blogs, until then practice and 🔁.

0
Subscribe to my newsletter

Read articles from Sabiha Momin directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sabiha Momin
Sabiha Momin

I'm looking for an opportunity to start a career in DevOps where I can enhance my knowledge and skills. Having knowledge and hands-on DevOps tools like Git, Ansible, Docker, Jenkins, CI/CD pipelines and also having knowledge in Cloud technologies like AWS and Azure.