7.5 Linux Application Management

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

chmod

* Change mode of a file system object - r=read w=write x=execute - can also use octal notation - set for the file owner (u), the group(g), others(o), or all(a) ''allows for seperate persimiossions to files'' * chmod mode FILE > chmod 744 script.sh

cp - Copy a file

* Copy a file - duplicates files or directories (create another version / copy) * cp SOURCE DEST > cp first.txt second.txt ls cd Documents/ ls -l mv first.txt second.txt ls -l (will show file was renamed to 2nd.txt) cp second.txt third.txt ls-l (will then show duplicate files called second.txt and third.txt)

mkdir

* Make a directory - create a folder for file storage - similar to windows mkdir notes ls -l Notes directory will show

shutdown

* Shut the system down - safely turn off the computer in software - similar to the windows shutdown command * sudu shutdown 2 - shuts down and turns off the computer in 2 mins * sudo shutdown -r 2 - will shut down & reboot in 2 mins - important when not on site * CTRL-C or shutdown -c to cancel

su vs sudu command

* Some command requires elevated rights - There are some things normal users can't do * su - become super user - or change to a different user - you continue to be that user until you exit *sudo - Execute a command as a super user - Or as a different user ID - Only that command executes as the super user !! shutdown requires elevated rights.

ps (processes status)

* View the current processes - and the process ID (PID) - similar to tskmgr * View User Processes -ps * View all processes -ps -e | more (shows all, at a readable level) * ps - elf (shows a LOT of information)

How can you get help with a Linux command?

// syntax for help command in example: help pwd

What is a software package?

A software package is a group of programs which are bundled together to serve a common purpose. Examples: Microsoft Office package, which includes individual applications such as Word, Excel, Access and PowerPoint.

Linux

An open source and freely distributed operating system based on UNIX that was created by Linus Torvalds of Finland.

As a part of your daily maintenance, you scan for and kill any zombie processes on the system. How do you do that?

First check all processes currently running, e.x. ps aux Followed by: kill -9 PID Refresh ps aux to make sure that all z processes are gone.

yum

Installs packages on Linux systems that use the Red Hat Package Manager (RPM). - the yum command can automatically locate and download RPM packages for you by searching one or more repositories on the internet. It can install the package and all its dependencies at the same time.

apt-get

Linux command for installing or updating a program using the advanced packaging tool. - uses the Debian Package Manager (dpkg). - can automatically locate and download Debian packages by searching one or more repositories on the internet. It installs the package and all its dependencies at the same time. The syntax for using apt-get is as follows: apt-get install package_name installs the specified package. > sudo apt-get install wireshark > sudo apt-get install net-tools apt-get remove package_name uninstalls the specified package. Displays info / Upgrades all to newest versions apt-get update displays information about all packages available within the internet repositories apt-get is configured to use. apt-get dist-upgrade upgrades all installed packages to the newest version.

grep command

Linux command for searching and filtering input. This can be used as a file search tool when combined with ls. * Find txt in a file - Search through one or many files to find a piece of txt that you are looking for e.x. grep failed auth.log (looks for the word failed in that file)

Which Linux distributions use the yum command to manage software? Which distributions use apt-get or apt?

Linux uses yum and Ubuntu uses the apt-get command.

ls

Lists files, directories - May support color coding; blue is directory, red is an archive file etc Lists directory contents - similar to dir in windows For long output, pipe through more: ls -l (shows more) (use q or ctrl c to exit)

What is proc filesystem?

Proc file system (procfs) is virtual file system created on fly when system boots and is dissolved at time of system shut down. It contains useful information about the processes that are currently running, it is regarded as control and information center for kernel.

RPM Package Management

RPM Package Manager (also known as RPM), originally called the Red-hat Package Manager, is an open source program for installing, uninstalling, and managing software packages in Linux. -Linux - yum

The syntax for using yum is as follows:

Removes and installs packages yum install package_name installs the specified package. yum remove package_name uninstalls the specified package. Lists packages / Authenticates Packages yum list installed lists all packages installed. yum list installed package_name checks to see if the specified package is installed. Lists all packages yum list available displays a list of all packages available for installation within the internet repositories yum is configured to use. Lists updates yum list updates generates a list of updates available for all installed packages. yum update package_name installs updates for the specified package. Displays Info on Packages yum info package_name displays information about the specified package, including its version and dependencies. Searches for specific packages yum search keyword searches for any packages that contain the specified keyword in the description, summary, or package name fields within the internet repositories yum is configured to use.

apt (Advanced Package Tool) command

Similar in design and function to the apt-get suite of tools. It manages dpkg packages on Debian and Ubuntu-based distributions. You can also use it for locating, downloading, and installing packages found in online repositories. The syntax for using apt is as follows: apt install package_name installs the specified package. apt remove package_name uninstalls the specified package. apt search search_term searches for packages with the earch term found in the configured repositories. apt update updates repositories with the latest list of available packages found in the configured repositories. apt dist-upgrade upgrades all installed packages with any available updated packages.

mv (move command)

The command used to move/rename files and directories. * Move a file - rename a file * mv source dest > mv first.txt second.txt - changes the file name from first to 2nd ls cd Documents/ ls -l mv first.txt second.txt ls -l (will show file was renamed to 2nd.txt)

rm (remove command)

The command used to remove files and directories. * Remove files or directories - Delete the files * Does NOT remove directories by default - Directories must be empy to be removed or must be removed with -r rm second.txt asks to remove: y ls-l (shows no more file)

su/sudo

The su command switches to the super user — or root user — when you execute it with no additional options. - must enter root accounts password - you can use it to switch to any user account - when done running commands type EXIT to leave the root shell and go back to limited-privileges mode. Sudo runs a single command with root privileges. - when execute sudo command, the system prompts you for your current user account's password before running command as the root user. !! By default, Ubuntu remembers the password for fifteen minutes and won't ask for a password again until the fifteen minutes are up. This is a key difference between su and sudo. Su switches you to the root user account and requires the root account's password. Sudo runs a single command with root privileges — it doesn't switch to the root user or require a separate root user password.

Tilde

The tilde (~) is a Linux "shortcut" to denote a user's home directory. Thus tilde slash (~/) is the beginning of a path to a file or directory below the user's home directory. For example, for user01, file /home/user01/test. file can also be denoted by ~/test.

man command (an online manual)

Used to view the syntax along with all options that you can use with these commands. - use the man command for help - e.x. man grep (pulls up the online manual on grep)

Linux, apt or yum?

Uses Yum

Software Packages on Linux

When installing software on a Linux system, you usually install a precompiled application or service from a software package. - a package is a set of software that contains executables (and other files) that have been precompiled and configured for a specific hardware architecture and Linux distribution.

Ubuntu, apt or yum?

Yum

On a Linux system using the Debian Package Manager, which of the following commands would you use to search online repositories for an installable Firefox package? apt-get search firefox apt search firefox rpm -s firefox yum search firefox

apt search firefox Explanation Since you are working with a Debian Package Manager system, the correct answer is the apt search firefox command. The rpm command only searches against installed packages. The yum search firefox command would work for an RPM Linux system. The apt-get search firefox command is incorrect in this scenario.

Which of the following commands can you use to install updated packages (found in configured repositories) that are currently installed on a Debian Package Manager-based system? (Select two.) yum update apt-get dist-upgrade apt update yum upgrade apt dist-upgrade

apt-get dist-upgrade apt dist-upgrade Explanation The correct answers are the apt dist-upgrade and apt-get dist-upgrade commands. Both perform a distribution upgrade of all packages available in the repositories. Both the yum update and yum upgrade commands apply to RPM-based systems. The apt update command refreshes repositories to look for new, updatable packages. However, the command itself does not upgrade them.

You use a Linux distribution that employs Debian Package Manager (dpkg) for package management. Which command would you use to install httpd (the Apache HTTP Server package) and all its dependencies? apt-get install httpd yum install httpd -dep ps -ef ps -e yum install httpd dpkg install httpd apt-get install httpd -dep

apt-get install httpd Explanation On a Linux distribution that uses Debian Package Manager (dpkg) for package management, enter apt-get install httpd on the command line to install the Apache HTTP Server package and all its dependencies. The apt-get command can automatically locate and download Debian packages for you by searching one or more repositories on the internet. This command installs the package and all of its dependencies at the same time.

Which apt-get or apt command uninstalls a package from the system?

apt-get remove

Which apt-get or apt command updates all the installed packages on a system?

apt-get update

cd

change directory' - identical to windows - forward // instead of \\ To use the CD command we type in the cd command and then the name of the directory. e.x. cd / var / log

ps aux (linux terminal command)

displays all processes running on your terminal with user names

Debian Package Manager (dpkg)

dpkg is the software at the base of the package management system in the free operating system Debian and its numerous derivatives. dpkg is used to install, remove, and provide information about .deb packages. dpkg itself is a low-level tool. - Ubuntu System - apt-get

Which command would you use to display a simple list of all processes running on a Linux distribution that use either RPM or dpkg for package management? apt-get -ef yum info ps -e ps -ef apt-get -e yum process info yum -ef yum -e

ps -e Explanation The ps utility displays running processes on a Linux system. Enter ps -e to display a simple list (without extended information) of all processes running on the system. ps -ef displays a list (with extended information) of all the processes running on the system. yum and apt-get are package management tools. They are not used for process management.

While working on a Linux system that has been underperforming, you notice that there is one process that is utilizing a significant amount of CPU time. The name of the process is "hidden.sh". Which of the following ps commands would you use to ensure that you can see who owns that process? ps -el ps aux ps ax ps -ef

ps aux Explanation The correct answer is ps aux. The u option lists the user/owner field in the output. All of the other commands list the processes, but these commands do not include the user/owner.

ps commands

ps displays only those processes associated with the current shell session. ps -e displays all processes running on the system. ps -f displays extended information about processes. ps -l displays information about processes in long format. This option can be combined with the -e and -f options to display extended process information in long format. There are some commonly used combinations of options: ps aux displays all running processes and includes the user (owner) column in the output. ps -ef displays all processes and includes extended information. You can display the following fields in the output of the ps command, depending on which options are included with the command: PID displays the process ID of the process. TTY displays the name of the shell session the process is running within. TIME displays the amount of CPU time used by the process. CMD displays the name of the command that was run to create the process. UID displays the user ID that owns the process. PPID displays the PID of the process's parent. C displays the amount of CPU utilization consumed by the process. STIME displays the time that the process started. F displays any flags associated with the process. S displays the current state of the process. PRI displays the priority of the process. NI displays the nice value of the process. SZ displays the size of the process in RAM.

Which option can you use with the ps command to view all processes running on the system?

ps-e

During a routine audit of a web server running on an RPM-based Linux system, you notice a package that is not installed from the standard server template. This is an error. Before you do anything, however, you need to find the package's dependencies. The package's name is orleans. Which of the following commands lists dependencies? yum info orleans apt search orleans yum list orleans apt info orleans

yum info orleans Explanation The correct answer is the yum info orleans command. This is the only command listed that provides a list of dependencies for an RPM system. The apt commands are specific to Debian Package Management systems. The yum list orleans command only gives information on the orleans package. This command does not provide dependencies.

Which yum command searches online repositories for a particular package, downloads it, and installs it?

yum install

You use a Linux distribution that uses RPM for package management. Which command would you use to install httpd (the Apache HTTP Server package) and all its dependencies? apt-get install httpd apt-get update httpd yum update httpd yum install httpd -dep yum install httpd

yum install httpd Explanation On a Linux distribution that uses RPM for package management, enter yum install httpd on the command line to install the Apache HTTP Server package and all its dependencies. yum automatically locates and downloads RPM packages for you by searching one or more repositories on the internet. This command can install a software package and all of its dependencies at the same time.

You use a Linux distribution that uses RPM for package management. Which command would you use to display a list of all packages available for installation within the internet repositories configured on the system? yum list available ps -e yum list all yum show all apt-get list apt-get list available ps -ef yum show available

yum list available Explanation On a Linux distribution that uses RPM for package management, enter yum list available in the command line to display a list of all packages available for installation within the internet repositories configured on the system.

You use a Linux distribution that utilizes RPM for package management. Which command would you use to verify that the httpd package (the Apache HTTP Server package) is installed? yum info httpd yum search httpd yum list installed httpd yum list installed

yum list installed httpd Explanation On a Linux distribution that uses RPM for package management, enter yum list installed httpd in the command line to verify that the Apache HTTP Server package is installed.

On a Linux system using RPM for package management, which of the following commands would you use to search online repositories for an available Firefox package? apt search firefox yum search firefox apt-get search firefox rpm -s firefox

yum search firefox Explanation The correct answer in this scenario is yum search firefox. The rpm command only searches the local system for previously installed files; the -s option is not used for this purpose. The apt-get search firefox and apt search firefox commands are both utilized on Debian Package Management systems. The apt-get command does not have a search function.

Which yum command downloads and installs the latest updates for packages installed on the system?

yum updates

pwd vs passwd (print working directory vs password)

• pwd - Print Working Directory - Displays the current working directory path - Useful when changing directories often • passwd - Change a user account password - Yours or another • passwd [username]


Set pelajaran terkait

Exercise science final w/ meghans quizlet

View Set

Integer Operations - Adding and Subtracting

View Set

concepts 1 nursing chapter 2, concepts 1 nursing chapter 1

View Set

Wellness Chap. 5 Flexibility & low back health.

View Set