1 / 18

Module 6: The Command Line

Module 6: The Command Line. We will learn more commands for managing files and directories. Understanding file management. File Listings Normal files Directory files – a special instance of normal files. File Ownerships File Permissions. Listing File.

ashanti
Télécharger la présentation

Module 6: The Command Line

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. Module 6: The Command Line • We will learn more commands for managing files and directories Module 6: The command line

  2. Understanding file management • File Listings • Normal files • Directory files – a special instance of normal files. • File Ownerships • File Permissions Module 6: The command line

  3. Listing File ls with option) – list all the files in a directory. • ls [-option] filename -l long listing -a all files -1 single column listing (number) Module 6: The command line

  4. Changing Files’ setting • Changing ownership: chown – to change the ownership of a file to someone else. • Changing Groups: chgrp – to change the group settings • Change Mode: chmod - used to set permission values. Module 6: The command line

  5. Permissions • Permissions are divided into four parts: part1 part2 part3 part4 - rwx rwx rwx Example: -rwxr-xr-- Module 6: The command line

  6. Part1 • “-” file • “d” directory • “l” link Module 6: The command line

  7. Part2, Part3, Part4 letter permission value • “r” read 4 • “w” write 2 • “x” execute 1 Module 6: The command line

  8. Managing files • Copy files: cp [-f, -i] • Moving files: mv [-f, -i] • Linking files: ln [-s] • Finding a file: find satrt_dir [option] locate • Converting and Copying a file: dd [if, of, …] Module 6: The command line

  9. Managing files (cont.) • File compression: gzip [-c, -d]; tar [-c, -x, -z] • Displaying the contents of text files: cat • Displaying a file One Screen at a time: more; less • Locating a Command: whereis Module 6: The command line

  10. Managing directories • Change directory: cd • Creating a directory: mkdir • Removing Directory (empty): rmdir • Showing Present Working Directory: pwd Module 6: The command line

  11. Getting help & finding commands • man – format and display the on-line manual • info – read info documents • whatis – search the whatis database for complete words. Module 6: The command line

  12. Showing Disk information • Disk Utilization: du [-h, -k] • Disk Free: df [-h, -l] Module 6: The command line

  13. Tracking and Terminating Processes • Listing processes: ps [-a, -r, -u, -l] -a all processes -r running processes only -u the process owners -l long format of a list Module 6: The command line

  14. Tracking and Terminating Processes (cont.) • Showing an interactive List of Processes: top • Sending a signal to a Process: kill -n Module 6: The command line

  15. Editing Text Files • vi editor • Start vi vi filename • Save text :w • Exit vi :q (exit vi after saving text) :q! (exit vi without saving) Module 6: The command line

  16. Redirection • Take the output of a program and sent to a file automatically. command > filename > output to a file >> append to a file < send a file as input Module 6: The command line

  17. Pipes • The output of a program can be sent as the input to another program. • “ | “ • Example: printenv | grep “HOME” • grep utility • Input from another program to match the given thing and display the only matching lines. • searching both file contents and filenames Module 6: The command line

  18. Summary • General management tools • |; grep; man; whereis • File management commands • ls; cat; more; find; chown; chgrp; chmod • Directory management commands • cd; mkdir; rmdir; pwd • Disk management commands • du; df • Process management commands • ps; kill Module 6: The command line

More Related