Ubuntu Command Line - Ubuntu

What is Ubuntu Command line?

Ubuntu is a Linux based operating system and most Linux clients are more comfortable with the command line interface. In this section, we will experience a portion of the well-known command line's utilized in Ubuntu.

Invoking the Command Line

To invoke the command line, go to the search alternative and enter the command directory in the search box.

invoking_command_line

The search result will give the Terminal alternative. Twofold lick to get the command line as appeared in the following screen shot.

terminal_option

Directory Listing

The least demanding command to begin with, is the directory posting command which is utilized to list the directory substance.

Syntax

Parameters

  • Option − These are the options to be specified with the ls command.
  • Directoryname − This is the optional directory name that can be specified along with the ls command.

Output

The output will be the listing of the directory contents.

Example

In the following example, we just issue the ls command to list the directory contents.

list_directory_contents

The directory listing of the current directory will be shown as the output.

Another variant of the ls command is to list the directory, but with more details on each line item. This is shown in the following screenshot with the ls –l command.

another_variant

Clearing the Screen

To clear the screen, we can use the clear command.

Syntax

Parameters

None

Output

The command line screen will be cleared.

Command Help

To get more information on a command, we can use the ‘man’ command.

Syntax

Parameters

Commandname − This is the name of the command for which more information is required.

Output

The information on the command will be displayed.

Example

Following is an example of the ‘man’ command. If we issue the ‘man ls’ command, we will get the following output. The output will contain information on the ls command.

command_help

Finding For Files

Use this command to find files.

Syntax

Parameters

Filepattern – To find files use this pattern.

Output

The files based on the file pattern will be displayed.

Example

It will issue the below command as mentioned in the following example.

This command will list all the files which start with the word ‘Sample’.

sample

whoami

This command is helped to list out the current logged on user.

Syntax

Parameters

None

Output

It display the name of the current logged on user.

Example

It will issue the following command as mentioned in below example.

whoami

Present Working Directory

It displays the current working directory.

Syntax

Parameters

None

Output

It displays the current working directory.

Example

Find the following example which provides below command.

present_working_directory

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Ubuntu Topics