Browsing The Filesystem
Some Important Directories
Red hat root (main)directory: /
Home Directories: /root (
home directory of root only )
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,
/sys
/sys
Shared Libraries : /lib,
/usr/lib, /usr/local/lib
/usr/lib, /usr/local/lib
=> pwd to
see current working directory
see current working directory
Note : 1) Names may
be up to 255 characters
be up to 255 characters
2) All
characters are valid, except the forward-slash
characters are valid, except the forward-slash
3)
Names are case-sensitive
Names are case-sensitive
=> mkdir dirname to
make a dir
make a dir
=> mkdir 1 2 3 4
to make multipal dir
to make multipal dir
=> mv o-name n-name
to rename dir
to rename dir
=> touch filename to
make a empty file
make a empty file
=> touch {a,s,d,f}.{jpg,doc,mp3}
=> mv o-name n-name
to rename file
to rename file
=> vi filename to
see or edit the file
see or edit the file
=> cat filename to see the contant of file
(cat > , cat >>)
=> nano filename to
edit in text file
edit in text file
=> cd dirname to
change dir
change dir
=> cd .. to a directory one level up
=> cd to
goto home directory
goto home directory
=> cd – to your previous directory
=> ls -a to list of file and dir with
hidden file
hidden file
=> ls -l to see long listing of file and
dir (ll)
dir (ll)
=> cp sourcefile destination ( cp file1 /home/macho )
to copy
file
file
=> cp -r sourcedir destination ( cp -r dir1
/home/macho )
/home/macho )
to copy
dir recursively
dir recursively
=> cp -r -v sourcedir destination ( cp
-r -v dir1 /home/macho )
-r -v dir1 /home/macho )
to copy
dir & show process
dir & show process
=> mv sourcefile destination ( mv file1
/home/macho )
/home/macho )
to move
file into elesewhere
file into elesewhere
=> mv dirname destination ( mv dir1 /home/macho )
=> rm filename (to remove any file)
=> rm -rf *.mp3
(to
remove all file which extension .mp3)
(to
remove all file which extension .mp3)
=> rmdir directoryname ( to remove dir )
=> Backing-up your system configuration
-mkdir
/root/backups-20100415
/root/backups-20100415
-cp -r -v
/etc/sysconfig /root/backup-20100415
/etc/sysconfig /root/backup-20100415
Thanks,
Vishal Vyas
Linux guru.
Linux guru.
Linuxguru