001 linux revision

1,417 views
1,190 views

Published on

Published in: Education
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
1,417
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
115
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

001 linux revision

  1. 1. Linux Commands Revision Facebook group: Learn To Be Official website: www.L2b-egypt.org Prepared By: SHATRIX E-Mail: eng.shatrix@gmail.comLearn To Be Embedded Linux Training
  2. 2. 2Linux History • Unix (Ken Thompson & Dennis Ritchie) AT&T company • FSF & GNU (Gnu is Not Unix) & GPL (Richard Stallman) 1984 ▫ Hurd Kernel • Minix (Andrew Tanenbaum) • Linux (Linus Torvalds) 1991 • GNU/Linux (complete, open source, UNIX-like operating system) • Open source: software and source code available to all ▫ The freedom to distribute software and source code ▫ The ability to modify and create derived works ▫ Integrity of authors codeLearn To Be Embedded Linux Training
  3. 3. 3Linux Structure • BootLoader (grub, uboot, vivi) • Kernel (www.kernel.org) • Filesystem (FHS) • shell (bash & ash & sh) • init process • Scripts & Environment variables • Applications • GUIs & TUILearn To Be Embedded Linux Training
  4. 4. 4Linux principles • Everything is a file (including hardware) • Small, single-purpose programs • Ability to chain programs together to perform complex tasks • Avoid user interfaces • Configuration data stored in textLearn To Be Embedded Linux Training
  5. 5. 5Linux View • Gnome & Kde (X Window system) • root & users • Common applications ▫ gedit, open office, totem, nautilus • Internet • Terminal • Virtual console • file types ▫ normal (text, audio, document) ▫ directory ▫ special (node, pipe, link (symbolic & hard))Learn To Be Embedded Linux Training
  6. 6. 6Filesystem Hierarchy Standard • / root directory • /bin commands & executable files • /sbin system commands & executable files • /boot kernel & bootloader • /dev hardware device files (nodes) • /etc configuration files and startup scripts • /home users home directories • /root root home directory • /lib shared library files • /media mount points for storage media • /opt third parity applications • /proc virtual process files • /usr other users applications & libraries • /var files that change a lotLearn To Be Embedded Linux Training
  7. 7. 7Commands & help • command [option(s)] [parameter(s)] • man • info • --help • sudoLearn To Be Embedded Linux Training
  8. 8. 8Common commands • cd change directory • pwd print current working directory • ls list files in current directory • cp copy • mv move & rename • touch create a new file • mkdir create a directory • rm remove files • file file type • cat print file contents • less view file contents in pages • passwd change users password • Absolute and Relative PathnamesLearn To Be Embedded Linux Training
  9. 9. 9Text tools • nano • vim ▫ modes ▫ keyboard shortcuts • geditLearn To Be Embedded Linux Training
  10. 10. 10Permissions • ls -l - | --- | --- | --- - | rwx | rwx | rwx t | own | grp | other • chmod ▫ letter mode ▫ numeric mode • Users & Groups ▫ chown ▫ chgrpLearn To Be Embedded Linux Training
  11. 11. 11Programs Packages (debian) • apt-get ▫ install update remove • dpkg ▫ Binary packages • Source packages ▫ ./configure [options] ▫ make ▫ make installLearn To Be Embedded Linux Training
  12. 12. 12man • man sections 1 5 8 • Display manual page descriptions ▫ man -f command ▫ whatis what? • Search the manual page names and descriptions ▫ man -k pattern ▫ apropos patternLearn To Be Embedded Linux Training
  13. 13. 13System information commands • whoami print effective user • hostname show or set the systems host name • date print or set the system date and time • cal displays a calendar and the date of Easter ▫ cal [[month] year] • uptime Tell how long the system has been running • w Show who is logged on and what they are doing • finger user information lookup program ▫ finger user-name • uname print system information ▫ uname -a • free Display amount of free and used memory • df report file system disk space usage • du estimate file space usage ▫ du -sh file-or-folder-nameLearn To Be Embedded Linux Training
  14. 14. 14Pipe & Redirection • cat file-name | less • Standard output ▫ command > file • Standard error ▫ command 2> file • The Black hole ▫ /dev/nullLearn To Be Embedded Linux Training
  15. 15. 15File Search tools • whereis locate the location for a command ▫ whereis command ▫ whereis -b command • locate find files by name ▫ locate file-name ▫ updatedb update a database for mlocate • find search for files in a directory hierarchy ▫ find path-to-search-in -name search-wordLearn To Be Embedded Linux Training
  16. 16. 16Text files search tools • grep print lines matching a pattern ▫ grep search-pattern file-name ▫ grep -v ▫ cat file-name | grep pattern • cut remove sections from each line of files ▫ cut -d”delimiter” -f”field” file-name ▫ cut -d: -f1 /etc/passwd • Print the shell for a user ▫ grep root /etc/passwd | cut -d: -f7Learn To Be Embedded Linux Training
  17. 17. 17Process Management • ps report a snapshot of the current processes ▫ ps axu ▫ ps axo • top display Linux tasks • pidof find the process ID of a running program • kill send a signal to a process ▫ kill pid ▫ kill -s signal-number pid • killall kill processes by name ▫ killall process-nameLearn To Be Embedded Linux Training
  18. 18. 18Archiving • tar The GNU version of the tar archiving utility ▫ tar cf myfile.tar myfolder ▫ tar xvf myfile.tar ▫ tar xvf myfile.tar.bz2 ▫ tar xvfz myfile.tar.gzLearn To Be Embedded Linux Training
  19. 19. Thank You Facebook group: Learn To Be Official website: www.L2b-egypt.org Prepared By: SHATRIX E-Mail: eng.shatrix@gmail.comLearn To Be Embedded Linux Training

×