Basic Linux Commands

Let’s get introduced to the basic linux commands.

1. If you want to type something, for example “hi” in the terminal.

echo hi  // this command will print “hi”

2. ls         // This command lists all the directories and files.

You can type ls -all so as to print all the hidden files and directories too. Hidden file name starts with a .(dot).

3. To create a text file “text”, with .txt extention, type

vim text.text or gedit text.txt

Save the file.

4. Now, type ls and text.txt appears in your dir/file list.

5. You can copy and move this file “text.txt” using the following commands.

cp text.txt Desktop    // to copy

mv text.txt Desktop  // to move

6. To change the directory from pwd(present working directory) to other(Desktop) , type

cd Desktop

7.  ls-> text.txt appears in Desktop

8. To make a directory “hello”, type

mkdir hello

cd hello // to change directory

rmdir hello //to remove directory( empty).

To remove directory with non empty files, type- rm -r directory

9. Choose a directory. For example Desktop.

cd Desktop

dh -H

This command gives you the details about free space available

10. Type ps //This command gives you the current running process.

Advertisements

Tagged: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s