You are on page 1of 2

--> $pwd (print working directory)- shows present directory

--> Prompt: [user@machinename dirname]


--> $ls (list all directories/files in present directory)
The contents can be recognised as dir or file by any coloring
convention scheme in that environment.Eg:all dir can b blue

--> $cd newdirname( Change frm present dir to newdirectory specified)


--> $cd .. ( Moves dir level to one level up)

-->$ cp filename newfilename (copies one file to another file)


-->Hit 'Up','Down' arrows to browse through previous cmds
-->$ clear ( clears screen)

-->$ rm filename (Removes file)


-->$ rm -i filename (Inquires to confirm before deleting the file,yes/no)
-->$ mv filename newfilnme (Remove filename and move to newfilename)
-->$ mkdir newdir (Creates new directory)
-->$ rmdir dirname (Removes dir.Dir having atleast 1file cant b deleted)
-------------------------------------------------------------------------
EDITORS: VI vs EMACS
-------------------------------------------------------------------------
Emacs EDITOR:
-------------
--> '~' rep your home dir
--> ~/dirname/filname.txt ( Opens the file editor)
After making changes,Goto Files--Save Buffer to Save
--> To exit Emacs editor, goto Files--Exit Emacs
------------------------------------------------------------------
VI EDITOR : A VI program is much smaller than a Emacs program.
------------
-->$ vi filname ( Opens file in VI editor)
VI has three modes and can be in any one of the modes at any time.
Mode 1:Command Mode (executes command. Insert or delete lines etc)
Mode 2: X Mode (Write the file or quit the file)
Mode 3: Write Mode (Changing like adding text to the file etc)
When u hit "Ecs" key, ull goto Command Mode frm any mode.
When u hit 'I', ull goto Insert Mode.
To save changes, hit 'Shift'+':' and type w/wq/q!(write and quit)
Hit 'dd', whole text lines get deleted.
-->$ cat filename ( Displays text in file)
------------------------------------------------------------------
--> $ man ls ( Gets manual of the specified command,'ls' here)

You might also like