Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

To make Medium work, we log user data. By using Medium, you agree to our Privacy Policy, including
cookie policy.

Basic Linux command line tutorial to start


developing in Ubuntu Linux
Syed Monowarul Islam
Sep 18, 2018 · 4 min read

This article is meant to give you a basic idea about Linux command line codes . By
reading this you will learn how to navigate through Linux directories , create a
directory or file as well as some common methodologies used in Linux .Because I use
Windows I am going to show you the Linux commands by opening “Ubuntu on
Windows”.

Clear the terminal screen:

clear

cleans the terminal .

Directory navigation
See the location of the pointer :

pwd

https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 1/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

To make Medium work, we log user data. By using Medium, you agree to our Privacy Policy, including
cookie policy.

Show contents of folder :

ls

Move up:

cd ..

Move to specific folder :

cd folderName

navigating

In the above scenario I used pwd,ls and cd to illustrate how we can move from from
one folder to another.

Move to root:

cd /

https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 2/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

Seeing
To the contents
make Medium of adata.
work, we log user folder : Medium, you agree to our Privacy Policy, including
By using
cookie policy.
Show all files (hidden also):

ls -a

See all files and also details :

ls -l

ls -l provides us with details about the contents of the folder

In the privilege section of the owner section we can see that drwxr is written it means :

first letter is “-”for File, d for Directory, l for Link

r — read

w — The file can be modified (write/delete/edit)

x — execute

Changing permissions of a file or folder is a different topic altogether .We will skip that
in this article.
https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 3/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

make
To a newwork,
make Medium directory
we log user data. By using Medium, you agree to our Privacy Policy, including
cookie policy.

mkdir directoryName

delete

rm -r directoryName
rm nameOfFile
rmdir directoryName

created and deleed a directory

rm -r is used when the directory is not empty.

make a file

touch f.txt

Open with an editor :

(I will open the file using vscode)

being in the same directory as file you want to open type:

https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 4/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

To make Medium work, we log user data. By using Medium, you agree to our Privacy Policy, including
code f.txt
cookie policy.

another important thing you want is the use of tab button. when writing long
filenames press tab and it will suggest names that exist in the directory.

see contents of a text file in the terminal :

cat f.txt

this helps when you need to look inside a small file.to see larger files use :

less f.txt

quit pressing “q”.

Renaming a file :

mv f.txt newName

rename

copy a file :

cp newName.txt copied.txt
https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 5/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

To make Medium work, we log user data. By using Medium, you agree to our Privacy Policy, including
cookie policy.

new le is created with the same contents of the old one

locating a file/folder:

which fileName/foldername

it outputs the path .

see what commands you used upto 500 :

history

update Ubuntu :

sudo apt-get update

https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 6/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

it didnt work the rst time


To make Medium work, we log user data. By using Medium, you agree to our Privacy Policy, including
cookie policy.
sudo means super user do .

See network information :

ifconfig

ping a website :

ping google.com

see own os information :

uname -a

See system usage data :

top

See disk space :

https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 7/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

df Medium work, we log user data. By using Medium, you agree to our Privacy Policy, including
To make
cookie policy.

Install software :

sudo apt-get install Name

Remove/uninsall :

sudo apt-get remove Name

Restart computer :

sudo reboot

Shutdown Computer : (try anyone)

sudo shutdown -h now


sudo poweroff

. . .

This is by no means a comprehensive tutorial . My target was to introduce you to the


commands that will start you off . For further reading you can explore here .

https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 8/9
6/7/2020 Basic Linux command line tutorial to start developing in Ubuntu Linux

Share
To make your
Medium opinions
work, we. log
:) and
user please
data. By leave a clap or
using Medium, you50 :P :)
agree to our Privacy Policy, including
cookie policy.

BYE!! .

Terminal Ubuntu Development

About Help Legal

Get the Medium app

https://medium.com/@zibon/basic-linux-command-lines-to-get-started-developing-in-ubuntu-linux-b54def1c2190 9/9

You might also like