Browsing linux filesystem

Spread the love

Browsing The Filesystem
Some Important Directories
Red hat root (main)directory: /
Home Directories:                /root                       (
home directory of root only )
                                            /home/username      ( for all users )
User Excecution :                /bin, /usr/bin, /usr/local/bin
system Excecution :             /sbin, /user/sbin, /usr/local/sbin
Other Mountpoints :             /media, /mnt
Configuration :                     /etc
Temporary files :                  /tmp
Kernels and Bootloader      /boot
Server Data :                      /var, /sys
System Information :           /proc,
Shared Libraries :               /lib,
/usr/lib, /usr/local/lib
=> pwd                                 to
see current working directory
Note :   1) Names may
be up to 255 characters
                2) All
characters are valid, except the forward-slash
Names are case-sensitive
=> mkdir dirname             to
make a dir
=> mkdir 1 2 3 4      
       to make multipal dir
=> mv o-name n-name     
to rename dir
=> touch filename             to
make a empty file
=> touch {a,s,d,f}.{jpg,doc,mp3}
=> mv o-name n-name    
to rename file
=> vi filename                   to
see or edit the file
=> cat filename                 to see the contant of file
(cat > , cat >>)
=> nano filename              to
edit in text file
=> cd dirname                  to
change dir
=> cd ..                            to a directory one level up
=> cd                               to
goto home directory
=> cd –                             to your previous directory
=> ls -a                             to list of file and dir with
hidden file 
=> ls -l                              to see long listing of file and
dir (ll)
=> cp sourcefile destination             ( cp file1 /home/macho )
                to copy
=> cp -r sourcedir destination          ( cp -r dir1
/home/macho )
                to copy
dir recursively   
=> cp -r -v sourcedir destination     ( cp
-r -v dir1 /home/macho )
                to copy
dir & show process         
=> mv sourcefile destination            ( mv file1
/home/macho )
                to move
file into elesewhere
=> mv dirname destination               ( mv dir1 /home/macho )

=> rm filename                                 (to remove any file)
=> rm -rf *.mp3        
remove all file which extension .mp3)
=> rmdir directoryname                    ( to remove dir )
=> Backing-up your system configuration
      -cp -r -v
/etc/sysconfig /root/backup-20100415
Vishal Vyas
Linux guru.

Leave a Comment