1 / 11

Linux Essentials

isecur1ty training center Presented by : Eng. Mohammad Khreesha. Linux Essentials. Table of contents. Introduction file touch rm cp mv rename. Introduction.

Télécharger la présentation

Linux Essentials

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. isecur1ty training center Presented by : Eng. Mohammad Khreesha Linux Essentials

  2. Table of contents • Introduction • file • touch • rm • cp • mv • rename

  3. Introduction • In this chapter we learn how to recognize, create, remove, copy and move files using commands like file, touch, rm, cp, mv and rename. • Linux is case sensitive, this means that FILE1 is different from file1, and /etc/hosts is different from /etc/Hosts . • A directory is a special kind of file, but it is still a file. It will become clear that everything on Linux is a file.

  4. file • The file utility determines the file type. Linux does not use extensions to determine the file type. Your editor does not care whether a file ends in .TXT or .DOC. • The file command uses a magic file that contains patterns to recognize file types. The magic file is located in /usr/share/file/magic. Type man 5 magic for more information. • It is interesting to point out file -s for special files like those in /dev and /proc.

  5. continue….. • Examples: • file pic33.png • file /etc/passwd • file hello.c • file /proc/cpuinfo • file -s /proc/cpuinfo • file /dev/sda • file -s /dev/sda

  6. touch • Its is an easy way to create a file is with touch. • Examples: • touch file1 • touch file2 • touch file1.txt • touch file1.c

  7. rm • When you no longer need a file, use rm to remove it. • Unlike some graphical user interfaces, the command line in general does not have a waste bin or trash can to recover files. • When you use rm to remove a file, the file is gone. Therefore, be careful when removing files! • Examples: • rm file1 • rm–i file1 • rm–rf dir1

  8. cp • To copy a file, use cp with a source and a target argument. • If the target is a directory, then the source files are copied to that target directory.

  9. continue…. • Examples: • cp FileAFileB copy FileA and paste it with new name Fileb • cp FileAMyDir/  copy FileA to MyDir directory • cp -r MyDirMyDirB copy complete directories • cp file1 file2 dir1/file3 dir1/file55 dir2  cp multiple files to directory • cp -i fire water  To prevent cp from overwriting existing files (-i == interactive) • cp -p file* cpp preserve permissions and time stamps from source files

  10. mv • Use mv to rename a file or to move the file to another directory. • When you need to rename only one file then mv is the preferred command to use. • Examples: • mv file100 ABC.txt • mv file100 mydir/ • mv file100 mydir/ABC.txt

  11. The End 

More Related