Linux
 Basic
 Commands


Directory 
commands: 


1. #
mkdir

 ‐
   For 
creating 
directory.

2. #
cd

 
 ‐
          change
 directory.

3. #
cd
..
 
 ‐
        to
 come
 out 
from
 working 
directory.

4. #
rmdir
 
 ‐

    to
 remove 
directory


File
 Commands: 


1. #
touch
<filename>
  ‐
  creates 
a 
blank
 file.
2. #
cat
 >filename      
 
 ‐
 creates 
a
 file
 and
 for 
saving
 this
 file
 (ctrl
+
D)
3. #
cat

 
                          
 ‐
 to
 see
 the
 content 
of
 the
 file.
4. #
cat 
file1
>>
file2
        ‐
 to
 move
 file1 
matter 
in
 file2
5. #
cat
‐n
 filename
       ‐
 to
 see 
how
 many
 lines
 are
 written
 in 
that 
file.

Commands
 for 
deleting: 


1. #
rm

filename
 
 ‐
 deletes

 a
 file.
2. #
rm
‐i

 
 
 ‐


 deletes
 file/folder 
in
 interactive
 mode
(asking
 mode)
3. #
rm
‐r
 
 
 ‐
 deletes
 directory.
4. #
rm
‐f
 
 
 ‐
 deletes
 files/folders
 forcefully.

Help
 Commands: 


1. #
whatis    

<command>
 
 
             These 
all 
are
 the
 help
 commands.
2. #
man         
<command>
3. #
info           
<command>
4. #
<command>
‐‐help
5. #
which
         <command>
6. #
cd
/usr/share/doc

Rename
 &
 Move: 


1. #
mv
<oldfile>
<newfile>








 
 
 
                                                              (Rename)
2. #
mv
<filename>

<where 
we 
have 
to 
move 
the
 file>
              (Move)

Listing 
Commands: 


1. #
ls
 
 
           ‐
        listing 
files/folders
2. #
ls
‐l
(ll)
     
 ‐
       long
 listing 
of 
files/folders 
with 
whole 
information
3. #
ls
‐a
         
 
 ‐       lists 
all 
files/folders
(hidden 
also)
4. #
ls
???
 
 
       ‐       
 all 
files/folders
 named 
with
 3 
characters
5. #
ls
m*
 
 
        ‐       
 files
 &
 directories 
started
 with 
letter  m.

************************

Advertisements

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