This document provides an overview of Linux commands and concepts. It begins with a brief history of Linux and its origins from Unix. It then covers Linux structure, principles, views, the filesystem hierarchy standard, common commands, text tools, permissions, packages, manual pages, system information commands, process management, archiving and more. The document is intended to help users learn the essentials of the Linux operating system.
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
001 linux revision
1. Linux Commands Revision
Facebook group: Learn To Be
Official website: www.L2b-egypt.org
Prepared By: SHATRIX
E-Mail: eng.shatrix@gmail.com
Learn To Be Embedded Linux Training
2. 2
Linux 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 author's code
Learn To Be Embedded Linux Training
3. 3
Linux Structure
• BootLoader (grub, uboot, vivi)
• Kernel (www.kernel.org)
• Filesystem (FHS)
• shell (bash & ash & sh)
• init process
• Scripts & Environment variables
• Applications
• GUIs & TUI
Learn To Be Embedded Linux Training
4. 4
Linux 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 text
Learn To Be Embedded Linux Training
5. 5
Linux 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
Filesystem 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 lot
Learn To Be Embedded Linux Training
7. 7
Commands & help
• command [option(s)] [parameter(s)]
• man
• info
• --help
• sudo
Learn To Be Embedded Linux Training
8. 8
Common 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 user's password
• Absolute and Relative Pathnames
Learn To Be Embedded Linux Training
9. 9
Text tools
• nano
• vim
▫ modes
▫ keyboard shortcuts
• gedit
Learn To Be Embedded Linux Training
10. 10
Permissions
• ls -l
- | --- | --- | ---
- | rwx | rwx | rwx
t | own | grp | other
• chmod
▫ letter mode
▫ numeric mode
• Users & Groups
▫ chown
▫ chgrp
Learn To Be Embedded Linux Training
11. 11
Programs Packages (debian)
• apt-get
▫ install update remove
• dpkg
▫ Binary packages
• Source packages
▫ ./configure [options]
▫ make
▫ make install
Learn To Be Embedded Linux Training
12. 12
man
• 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 pattern
Learn To Be Embedded Linux Training
13. 13
System information commands
• whoami print effective user
• hostname show or set the system's 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-name
Learn To Be Embedded Linux Training
14. 14
Pipe & Redirection
• cat file-name | less
• Standard output
▫ command > file
• Standard error
▫ command 2> file
• The Black hole
▫ /dev/null
Learn To Be Embedded Linux Training
15. 15
File 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-word
Learn To Be Embedded Linux Training
16. 16
Text 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: -f7
Learn To Be Embedded Linux Training
17. 17
Process 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-name
Learn To Be Embedded Linux Training
18. 18
Archiving
• 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.gz
Learn To Be Embedded Linux Training
19. Thank You
Facebook group: Learn To Be
Official website: www.L2b-egypt.org
Prepared By: SHATRIX
E-Mail: eng.shatrix@gmail.com
Learn To Be Embedded Linux Training