Tuesday, 28 July 2015

DAY 1.5

Now I logged in Ubuntu.

Click the Ubuntu logo in upper left corner of the screen.
In search bar type TERMINAL. select the icon of Terminal and a new window will open.

You can do almost everything from here.

Today I learned
  • how to create any file or directory  
  • applying permissions on them
  • remove file or directory 
  • move, copy, rename etc..

First we should know where we are i mean in which directory
to know this use pwd command. It will tell you your present working directory.

sumit@sumit-HCL-Notebook:~$ pwd
/home/sumit


 so i am in /home/sumit

now i want to check the contents for this directory. For that we will use the ls command.

sumit@sumit-HCL-Notebook:~$ ls
Desktop  Documents  Downloads  examples.desktop  Music  Pictures  Public  Templates  Videos



Lets change the directory by cd command

sumit@sumit-HCL-Notebook:~$ cd Desktop/
sumit@sumit-HCL-Notebook:~/Desktop$


now we are in Desktop. i am going to create a folder here and from  now on i will try to do all my learning experiment in this folder.

creating a directory

mkdir <name >

sumit@sumit-HCL-Notebook:~/Desktop$ mkdir linux_journey
sumit@sumit-HCL-Notebook:~/Desktop$ ls
12  hi  linux_journey
sumit@sumit-HCL-Notebook:~/Desktop$  



we can see there are already two folders i made it earlier and the third one i just created. linux_journey

entering in this directory now

sumit@sumit-HCL-Notebook:~/Desktop$ cd linux_journey/
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$
 

now we know how to make a directory

and now i am going to create a .txt file in it with touch <name> command.

sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ touch Day1.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls
Day1.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$


lets create some more files with the same command but this time i am going to give more names then i will use rm command to remove some of them .


 sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ touch Day11.txt Day22.txt Day33.txt Day44.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls
Day11.txt  Day1.txt  Day22.txt  Day33.txt  Day44.txt


now i have 5 .txt files here and i want to keep only one file here that is Day1.txt

sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ rm Day11.txt Day22.txt Day33.txt Day44.txt
sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls
Day1.txt


lets see what are the permissions on this file and then i will change the permissions.

command used ls -l

sumit@sumit-HCL-Notebook:~/Desktop/linux_journey$ ls -l
total 0
-rw-rw-r-- 1 sumit sumit 0 Jul 29 04:37 Day1.txt

 

i am feeling sleepy now tomorrow we will look at the permissions thing like what is this
-rw-rw-r-- and all

good night :)
 

No comments:

Post a Comment