Intro to the Linux basic command Console


The beauty of linux is that it has a console that allows you to do whatever you want with the OS. Today we are going to do a brief introduction to some of the basic commands for the most versions of the linux console.

Before we start to talk about file system commands and how to work with files on the command line we need to take a look at some of the most basic commands:

General Commands

whoamidisplay the name of the user logged in
sudoexecute a command as super user
suswitch user to root
manmanual pages for any command
logoutexits the user
clearclears the console to blank
passwordchange the password for the current user

Now is time to talk see some of the commands for the file system

File System Commands

lsList current directory and items
ls -lList current directory and items, including permissions
cdChange to a different directory

Okay, this is good, we have seen commands that will allows us to browse through the file system, but how do we work with the files? how to create them, edit them and more? Here is a list for those commands:

Working with Files

echoDisplays on screen a text string
nanoText editor(CTRL+X to exit and save)
lessDisplay file contents with fixed length
mvMove or rename file or directory
rm -rRemove or delete, -r removes content firs (recursive)
mkdirMake a directory
catDisplays the file output to the screen
touchCreate file

We can also control the output of the commands, here are some of the commands for it:

Control Command Output

|pipe, directs command output to next command
grepSearch for matching strings
>Send output to file
>>Append output to file
<Send input to a program


We have seen 4 different groups of commands that will help us to get started with the console, this are some basic commands, you can always get more documentation on the official ubuntu wiki

Leave a Reply