So, now that you know how to get to command line the next step is to start using it. We will discuss 5 basic Linux commands for beginners.
Understanding the General Command Syntax
Any command will have the following syntax
command options arguments
options: are used to adjust the behaviour of a command
arguments: specify additional arguments like file name
$ls -l linux.c
Next, we focus on 5 basic Linux commands for beginners to start with
Now, once you are in the command mode you probably do not know where you are? What I mean by this is that if you are using the GUI you know exactly in which directory/folder you are working. So, the first thing you must know is the current working directory. Whatever happens by default happens in the user’s working directory.
1. pwd – print working directory
pwd command prints the working directory. It is one of the important things you know because whenever you create/delete new files/directories you must know where you are doing it. For example:
In this case the working directory is /home/baljit.
2. cal – calendar
cal command prints the calendar. By default it prints the current month. For example:
3. date – system date and time
date command prints the current system date and time
For more details on date command click here
4. ls – list directory contents
ls command lists the contents of a directory. Some examples of using ls command are shown below
$ls $ls -l $ls -l abc.txt
For details on ls command click here
5. history – displays list of previously executed commands
history command displays list of previously executed commands prefixed with command number. This is helpful when you want to see the recent commands that you have executed.
You can also use ! sign along with the command number to re-execute the command. For example
will rerun the ls command