Basic Linux Commands - CompTIA A+ 220-902 - 2.1

Professor Messer
1 Feb 201613:31

Summary

TLDRThis script offers an in-depth guide to Linux command line essentials, highlighting similarities with Mac OS due to their Unix roots. It covers accessing the command line, using live CDs or virtualization, and essential commands like 'man', 'ls', 'grep', 'cd', 'shutdown', 'pwd', 'passwd', 'mv', 'cp', 'rm', 'mkdir', 'chmod', 'chown', 'iwconfig', 'ifconfig', 'ps', 'apt-get', 'vi', and 'dd'. The tutorial is tailored for Linux users, with practical examples and tips for navigating, managing files, and system administration tasks.

Takeaways

  • ๐Ÿ’ป The Linux command line provides powerful tools for system management and file operations.
  • ๐Ÿ” The 'man' command is crucial for accessing the manual pages and understanding command options.
  • ๐Ÿ› ๏ธ Users typically start with normal user permissions and can elevate to superuser mode using 'su' or 'sudo' for specific commands.
  • ๐Ÿ“ The 'ls' command lists directory contents, with the '-l' option providing detailed information.
  • ๐Ÿ”Ž 'grep' is a versatile search tool for finding text patterns within files.
  • ๐Ÿ“‚ The 'cd' command is used to change directories, using forward slashes to separate paths.
  • ๐Ÿ”„ The 'shutdown' command allows for system shutdown or restart with a specified countdown, often run as a superuser.
  • ๐Ÿ“ The 'pwd' command reveals the current working directory, aiding in navigation.
  • ๐Ÿ”‘ 'passwd' is used to change user passwords, while 'chown' changes file ownership.
  • ๐Ÿ”„ 'mv' can move or rename files, and 'cp' is used for copying file contents to a new file.
  • ๐Ÿ—‘๏ธ 'rm' is used to delete files, with '-r' allowing for directory removal, while 'rmdir' is for empty directories only.
  • ๐Ÿ“ 'mkdir' creates new directories for file storage.
  • ๐Ÿ› ๏ธ 'chmod' changes file permissions using numeric or symbolic notation, affecting read, write, and execute access.
  • ๐Ÿ”ฎ 'iwconfig' and 'ifconfig' are used for configuring wireless networks and viewing network interface details.
  • ๐Ÿ” 'ps' lists current processes and their IDs, offering insight into system activity.
  • ๐Ÿ“ฅ 'apt-get' is a package handling utility for installing, updating, or removing software packages.
  • โœ๏ธ 'vi' is a popular text editor in Linux, allowing for file creation and editing.
  • ๐Ÿ”„ 'dd' is a low-level command for data conversion, copying, and backup/restore of entire partitions.

Q & A

  • How can I access the command line in Linux?

    -You can access the command line in Linux by using the Terminal, XTerm, or a similar terminal program.

  • Why are Linux commands similar to those in Mac OS?

    -Linux commands are similar to those in Mac OS because Mac OS is derived from a Unix version called BSD (Berkeley Software Distribution).

  • What is a live CD and how can it be used with Linux?

    -A live CD is a live version of an operating system that you can run from a CD or DVD without installing it on your normal system. You can download a Linux live CD to try out Linux without making any changes to your current system.

  • What is the purpose of the 'man' command in Linux?

    -The 'man' command stands for manual and is used to display the user manual pages for a specific command, showing different options and usage examples.

  • What does the 'su' command do and when might I need to use it?

    -The 'su' command starts a session as the superuser, allowing you to execute tasks that require elevated privileges. You would use 'su' when you need to perform actions that are restricted to the superuser.

  • How can I execute a single command as a superuser without starting a new superuser session?

    -You can use the 'sudo' command followed by the specific command you want to run as a superuser. This executes only the single command with superuser privileges and then returns to your normal user permissions.

  • What does the 'ls' command do and how does it differ from the 'dir' command in Windows?

    -The 'ls' command in Linux provides a listing of directory contents, similar to the 'dir' command in Windows. However, 'ls' may support additional features like color coding to differentiate between file types.

  • What is the difference between the 'cd' command in Linux and Windows?

    -The 'cd' command in Linux and Windows both allow you to change directories. The difference is that Linux uses forward slashes (e.g., /var/log) to separate directories, whereas Windows uses backward slashes.

  • How can I shut down or restart a Linux system using the command line?

    -You can use the 'shutdown' command with a specified number of minutes for the countdown to shut down or restart the system. For example, 'sudo shutdown -r now' will restart the system immediately.

  • What command should I use to find out the current directory I am working in on the Linux command line?

    -You can use the 'pwd' command, which stands for 'Print Working Directory', to find out the current directory you are working in.

  • How can I change the password for my user account in Linux?

    -You can change the password for your user account by using the 'passwd' command followed by your username. You will be prompted to enter your current password, then enter and confirm your new password.

  • What is the 'mv' command used for and how does it work?

    -The 'mv' command is used for moving a file from one directory to another or renaming a file. You specify the source file and the destination, and the command moves or renames the file accordingly.

  • How do I copy a file in Linux using the command line?

    -You can copy a file using the 'cp' command followed by the source file name and the destination file name. For example, 'cp first.txt second.txt' will create a copy of 'first.txt' named 'second.txt'.

  • What command is used to delete files and directories in Linux, and what is the difference between its options?

    -The 'rm' command is used to delete files and directories in Linux. The basic 'rm' command is used to delete individual files, while 'rm -r' is used to delete entire directories and their contents. 'rmdir' is used specifically to remove empty directories.

  • How can I create a new directory in Linux?

    -You can create a new directory in Linux using the 'mkdir' command followed by the name of the directory you want to create. For example, 'mkdir notes' will create a directory named 'notes'.

  • What is the 'chmod' command and how is it used to change file permissions in Linux?

    -The 'chmod' command is used to change the read, write, and execute permissions of a file or directory in Linux. You can use octal notation or letters to specify the permissions for the user, group, and others.

  • How can I change the ownership of a file using the command line in Linux?

    -You can change the ownership of a file using the 'chown' command with elevated rights, typically 'sudo chown', followed by the new owner and group, and then the file name.

  • What command is used to view or change wireless configuration settings in Linux?

    -The 'iwconfig' command is used to view or change wireless configuration settings, such as connecting to an SSID, on a Linux system.

  • How can I view the IP address configurations of network adapters in Linux?

    -You can view the IP address configurations of network adapters using the 'ifconfig' command followed by the adapter name, such as 'ifconfig eth0'.

  • What does the 'ps' command do and how can I view all processes on a Linux system?

    -The 'ps' command lists all current processes and their process IDs. To view all processes for every user, you can use 'ps -e' and pipe the output to 'more' to page through the results.

  • What is 'apt-get' and how is it used to manage applications on a Linux system?

    -'Apt-get' is the Advanced Packaging Tool used to install, update, or remove applications on a Linux system from the command line. For example, 'sudo apt-get install wireshark' installs the Wireshark application.

  • How do I start using the 'vi' editor in Linux to edit a file?

    -To start the 'vi' editor, use the 'vi' command followed by the filename you want to edit, such as 'vi script.sh'. Inside the editor, press 'I' to enter insert mode, make your changes, and then use ':wq' to save and quit.

  • What is the 'dd' command used for and how can it be used to create a disk image?

    -The 'dd' command is used for converting and copying files, and can also be used to backup and restore entire partitions. To create a disk image, use 'dd' with the input file being the partition name and the output file being the image file name.

Outlines

00:00

๐Ÿ”ง Linux Command Line Basics

This paragraph introduces the power of the Linux command line, accessible through terminals like Terminal or XTerm. It highlights the similarities between Linux and Mac OS due to their Unix roots and focuses on Linux-specific commands. The video offers guidance on accessing Linux, such as using a live CD or virtualization software, and emphasizes the importance of the 'man' command for accessing manuals. It also covers user permissions, the use of 'su' for superuser mode, and 'sudo' for executing single commands with elevated rights. The 'ls' command is introduced for directory listings, with options for detailed views and color coding, and 'grep' is explained for searching text within files. Additionally, the paragraph touches on changing directories with 'cd', shutting down or restarting with 'shutdown', and navigating directories with 'pwd' and 'passwd'.

05:02

๐Ÿ“ File Management in Linux

This section delves into file management in Linux, starting with the 'mv' command for moving and renaming files. It provides an example of changing a file name from 'first.txt' to 'second.txt' and explains the command's use for moving files between directories. The 'cp' command is introduced for copying files, with an illustration of duplicating the contents of 'first.txt' to 'second.txt'. The paragraph continues with the 'rm' command for file deletion, warning of its power and potential risks, and contrasts it with 'rmdir' for removing empty directories. The 'mkdir' command is then covered for directory creation, followed by 'chmod' for changing file permissions, explaining the use of numbers and letters to set permissions for users, groups, and others. The paragraph concludes with 'chown' for changing file ownership, requiring superuser rights, and an example of changing ownership from 'backup' to 'professor'.

10:05

๐Ÿ›  Advanced Linux Commands and Utilities

The final paragraph covers advanced Linux commands and utilities. It begins with changing file ownership using 'ls -l' to view current ownership and 'chown' to alter it. The 'iwconfig' command is introduced for managing wireless configurations, including connecting to an SSID. 'ifconfig' is explained for viewing IP address configurations of network adapters. The 'ps' command is detailed for listing current processes and process IDs, with options to view processes for all users. The paragraph then discusses 'apt-get' for installing, updating, or removing applications, using Wireshark as an example. 'Vi' is introduced as a popular Linux text editor, with instructions for editing files, inserting text, and saving changes. Lastly, the 'dd' command is explained for file conversion, copying, and partition backup and restoration, with examples of creating and restoring disk images.

Mindmap

Keywords

๐Ÿ’กCommand Line

The command line is a text-based interface used to interact with the operating system by typing commands. In the context of this video, it is emphasized as a powerful tool in both Linux and Mac OS, allowing users to perform various tasks such as navigating directories and managing files through commands.

๐Ÿ’กTerminal

A terminal is a program that provides a command line interface. Examples include Terminal and XTerm, which are used to access the command line in Linux. The video mentions it as a primary way to enter commands and execute various operations in the Linux operating system.

๐Ÿ’กLive CD

A Live CD is a bootable media containing a complete operating system that can run without being installed on a computer's hard drive. The video suggests using a Live CD to run Linux directly from a CD or DVD, providing a way to try out the OS without altering the current system.

๐Ÿ’กVirtualization Software

Virtualization software allows you to run multiple operating systems on a single physical machine by creating virtual machines. The video mentions VMware Player and VirtualBox as tools to install and run Linux in a virtual environment, facilitating the testing and use of Linux alongside other systems.

๐Ÿ’กsudo and su Commands

These commands are used to gain elevated privileges in Linux. 'sudo' allows a user to execute a single command as a superuser, while 'su' initiates a session as a superuser. The video highlights their importance in executing tasks that require administrative rights, emphasizing how they provide controlled access to critical system functions.

๐Ÿ’กls Command

The 'ls' command in Linux lists the contents of a directory. It is similar to the 'dir' command in Windows. The video describes how it can display files and directories, with options for detailed views and color coding, making it a fundamental command for navigating and managing the file system.

๐Ÿ’กgrep Command

The 'grep' command is used to search for specific text patterns within files. The video explains how it helps find lines containing particular words or phrases, making it a powerful tool for analyzing logs and other text files by specifying patterns and file names to search through.

๐Ÿ’กchmod Command

The 'chmod' command changes the file permissions in Linux. It allows users to set read, write, and execute permissions for the owner, group, and others. The video details how this command is crucial for managing access to files and directories, using both numeric and symbolic representations to define permissions.

๐Ÿ’กchown Command

The 'chown' command changes the ownership of a file or directory in Linux. It assigns a new owner and optionally a new group. The video discusses its role in ensuring proper file ownership and access control, highlighting how it's used to modify user and group ownership, often requiring superuser privileges.

๐Ÿ’กapt-get Command

The 'apt-get' command is a package management tool in Debian-based Linux distributions. It allows users to install, update, and remove software packages. The video explains its use in easily managing software installations and updates, making it a vital tool for maintaining and expanding the capabilities of a Linux system.

Highlights

Linux's powerful command line can be accessed via Terminal, XTerm, or similar programs.

Commands in Linux and Mac OS share similarities due to Unix's influence on Mac OS.

Mac OS users should consult documentation for command line differences.

A live CD allows running a live version of an OS from a CD or DVD.

Virtualization software like VMware or VirtualBox can be used to install Linux distributions.

The 'man' command in Linux provides a manual for command usage.

Normal users in Linux may need to run commands in elevated mode using 'su'.

The 'sudo' command allows executing a single command as a superuser.

The 'ls' command lists directory contents with optional details using '-l'.

The 'grep' command searches for text patterns within files.

The 'cd' command changes directories using forward slashes.

The 'shutdown' command can be used to shut down or restart a Linux device.

The 'pwd' command reveals the current working directory.

The 'passwd' command is used to change a user's password.

The 'mv' command moves or renames files.

The 'cp' command copies file contents from one file to another.

The 'rm' command is used to delete files or directories.

The 'rmdir' command removes empty directories.

The 'mkdir' command creates new directories.

The 'chmod' command changes file permissions using numeric or letter-based syntax.

The 'chown' command changes the file owner and group.

The 'iwconfig' command manages wireless network configurations.

The 'ifconfig' command displays IP address configurations for network adapters.

The 'ps' command lists current processes and their IDs.

The 'apt-get' command installs, updates, or removes applications.

Vi editor is used for editing files in Linux with insert and save commands.

The 'dd' command is used for file conversion, copying, backup, and restoration.

Transcripts

play00:02

The Linux operating system has a lot

play00:03

of power at the command line.

play00:05

You would normally access this command line

play00:07

by using the Terminal, XTerm, or some similar terminal program.

play00:11

The commands that we're going to look at in this video

play00:14

are very similar in both Linux, and Mac OS.

play00:17

That's because Mac OS derived from a Unix version

play00:20

called BSD-- Berkeley Software Distribution.

play00:23

This video is going to be very specific to Linux however,

play00:26

so if you're planning to do any of this in Mac OS,

play00:29

make sure you check the documentation.

play00:31

If you'd like to do this yourself,

play00:32

you can download what's called a live CD, where

play00:35

you would connect a live version of an operating system

play00:38

that you can run from a CD, or DVD,

play00:41

rather than running it from your normal system.

play00:43

Another popular option is to install virtualization software

play00:47

like VMware player, or VirtualBox,

play00:49

and install a Linux distribution in that virtual machine.

play00:53

And of course, if you're already at the command line,

play00:55

you can always use the all important man command,

play00:58

this stands for manual.

play01:00

So if you use to for instance, man grep,

play01:03

it would show you all of the different options for the grep

play01:05

command.

play01:07

In Linux you're normally logging in,

play01:08

and running as a normal user.

play01:10

You don't have any special supervisory rights,

play01:13

so sometimes you may need to run things in elevated mode.

play01:16

If you have a number of tasks that you

play01:17

need to execute as the superuser,

play01:20

you can start this mode by simply typing in su.

play01:23

And then everything else in the session

play01:25

will run as the superuser.

play01:27

To get back to your original set of rights and permissions,

play01:30

you can type the exit command, and it will exit out

play01:33

of the super user mode.

play01:35

If you'd like to execute just one command in the super user

play01:38

mode, you can use the sudo command,

play01:40

and run this particular command as the super user.

play01:44

This will only run the single command as a super user,

play01:47

and once that command is completed ,

play01:49

you're back to your normal rights and permissions.

play01:52

One popular Linux command is the ls command.

play01:55

This gives us a listing of directory contents.

play01:58

If you are in Windows, you would be using the dir command

play02:01

to provide a similar function.

play02:02

This will list files and directories,

play02:04

and your terminal may even support color coding.

play02:07

For example, in mine, the blue color is a directory,

play02:09

and the red color is an archive file.

play02:11

If you want to see the details of a directory,

play02:14

you can use the ls command with a -l,

play02:16

this will show you a lot more details

play02:18

about what's in the directory, and often as many pages.

play02:21

So you may want to pipe this through the more command

play02:24

by using the vertical bar, and then more,

play02:27

so that you can page through one at a time.

play02:30

The grep command is a search function

play02:32

that allows you to look for some text that may be

play02:34

located in one or more files.

play02:36

To use grep, we would use the grep command,

play02:38

we would specify a pattern, and then

play02:40

specify what files we wanted to look inside.

play02:43

For example, if you had a file off.log,

play02:46

and you were looking for the word failed,

play02:48

you could grep the word failed from off.log,

play02:51

and any lines that showed up with the word failed

play02:54

would be listed as the results of that grep.

play02:57

The cd command in Linux is very similar to the cd command

play03:01

in Windows that allows you to change directory.

play03:03

One difference in Linux is that we are using forward

play03:06

slashes to separate directories, rather than

play03:09

the backward slashes you might use in Windows.

play03:11

So if you wanted to change directory to the var/log

play03:14

directory, you would use the cd command space /var /log.

play03:20

Another similar command between Windows and Linux,

play03:22

is the shutdown command.

play03:24

This allows you to shut down, or restart, a Linux device.

play03:27

To use the shutdown command, we need

play03:28

to specify how many minutes the countdown will be so.

play03:32

It's common to do something like shut down two,

play03:34

and it will wait two minutes before the shutdown.

play03:36

You usually are going to run this as a super user.

play03:39

So to run shutdown, you'll probably

play03:41

use this as sudo shutdown and then the number of minutes.

play03:45

If you wanted to restart the computer,

play03:47

rather than shutting it down completely,

play03:49

you can use exactly the same command, but use the -r.

play03:53

So, sudo shutdown -r two means that we're

play03:56

going to shut down in two minutes,

play03:58

but then the system will restart after that.

play04:00

If any time in the middle of this countdown,

play04:03

you feel that you don't want to shut down the system,

play04:05

or you don't want to restart it, you can always

play04:07

stop this entire process by using the Control-C command,

play04:11

and it will cancel the shutdown process.

play04:13

When you're using the Linux command line,

play04:15

or moving back and forth from one system to another,

play04:18

you may not realize exactly what directory

play04:20

you happen to be in at any particular time.

play04:23

If that's the case, you can use the pwd command.

play04:26

This means Print Working Directory , and by typing pwd,

play04:30

and hitting Enter, it will tell you exactly what directory

play04:32

you're in.

play04:33

This is very different than the passwd command.

play04:36

Passwd is when you would like to change the password

play04:39

on an existing account.

play04:41

So, if you wanted to change your password,

play04:43

you would type in passwd.

play04:44

It would say that it's changing the password

play04:46

for the current user, in my case professor.

play04:49

I would put in my current password,

play04:51

I would enter a new password, retype the new password,

play04:54

and then it tells me the password

play04:55

is updated successfully.

play04:57

If you're the administrator, you could also

play04:59

use the passwd command with a separate username,

play05:02

and change another user's password.

play05:05

The mv command stands for moving a file.

play05:08

And if you're not moving a file from one directory to another,

play05:11

you can move a file from one name to another,

play05:13

or rename the file.

play05:15

One way to do this is to type the mv command,

play05:18

the source of the file that you'd

play05:19

like to move, and then the destination.

play05:21

So if you wanted to change the name of the file called first,

play05:24

to a file name called second, you

play05:26

would use mv, first.txt second.txt.

play05:29

Here's an example of this-- I listed out the directory that

play05:32

shows that first.txt file.

play05:34

I ran the command mv first.tx second.txt,

play05:38

and you can see as I list the files again,

play05:40

first.txt is no longer in that directory.

play05:43

Instead it has been moved, or renamed, to second.txt.

play05:47

The mv command is also used for moving

play05:49

a file to different places in the directory structure.

play05:52

So if you're moving a file, you can simply

play05:54

move it from one folder to another with the mv command.

play05:57

Instead of moving a file, or renaming it, why don't we

play06:00

copy a file from one file name to another.

play06:03

To do that, we use the cp command.

play06:05

The syntax for this is cp, the source,

play06:08

and then the destination name.

play06:09

So cp first.txt space second.txt will

play06:13

copy the contents of the first file into a second file.

play06:17

So we'll take the example I used earlier,

play06:19

where I had a first.txt file.

play06:21

I use the copy command-- cp first.txt second.txt--

play06:25

and if we list the directory now,

play06:27

we can see there is a first.txt and there is also

play06:30

a second.txt file which is identical to the contents

play06:33

of first.txt.

play06:35

To delete a file from the file system,

play06:37

we would use the rm command.

play06:39

This stands for removing a file.

play06:41

We can remove individual files by specifying rm

play06:44

him and the name of the file.

play06:45

We can also remove an entire directory, and everything

play06:48

inside of it, by using rm -r.

play06:51

You want to be very careful when using that,

play06:53

because you're removing a lot of information at one time,

play06:56

and you can accidentally remove files you weren't expecting.

play06:59

If we wanted to remove an empty directory by itself,

play07:01

we can use the rmdir command and that

play07:04

will remove just a directory that's already empty.

play07:07

Here's an example of using the rm command.

play07:10

If I list out a directory, you can see temp-1 and temp-2.

play07:13

If I use rm then temp-1.doc, and perform another ls,

play07:18

you'll see that the temp-1.doc is no longer part of the file

play07:21

system.

play07:22

To make a directory in Linux, we use the mkdir command.

play07:26

This will make a folder that we can then store files into.

play07:29

And you would use the syntax mkdir

play07:31

and the name of the directory.

play07:33

So if you wanted to create a directory called notes,

play07:35

you simply mkdir space notes.

play07:39

If you've ever need to change the read

play07:41

or write permissions of a file in Linux,

play07:43

then you've probably used the chmod command.

play07:45

Chmod changes the mode.

play07:47

That's where the name comes from of that particular system

play07:50

object, and you're usually changing the mode

play07:53

to be either read, write, or execute.

play07:55

You can also use an octal notation,

play07:57

or even specify other parameters,

play08:00

in the change mode command.

play08:02

It's very common to use numbers to specify

play08:04

the permissions for a file.

play08:06

If you were to look at all of the different permissions,

play08:08

you'll notice there are a bunch of Rs and Ws and Xs and dashes.

play08:12

These are separated out into a user, a group,

play08:15

and an other section.

play08:16

And you would set the user group, and other number,

play08:19

based on the permissions that you see here.

play08:22

So if we set a chmod of 744 for the file script.sh,

play08:27

we are setting the first three characters here to RWX.

play08:30

That's the 7, so that's read, write, and execute,

play08:33

and that will be the permissions for the person who

play08:35

is the owner of the file.

play08:37

Everyone who is a member of the group associated

play08:40

with this file, will be assigned the number four.

play08:42

Four is read only, and you can see

play08:44

the r is listed under those characters.

play08:46

And then everyone else has the access also of four,

play08:50

which means everyone else can read this file as well.

play08:53

There are many different forms of syntax

play08:55

for the chmod command.

play08:56

We just looked at the one that use numbers

play08:58

to specify the user, the group, and the other permissions.

play09:01

You can also use letters.

play09:03

So a chmod of a-w for the file means that all users would not

play09:08

be able to write to first.txt.

play09:10

We could try even chmod u + x, which

play09:13

means that the user, or the owner of the file,

play09:16

can execute the file.

play09:18

Whenever you're working at the command line with these files,

play09:20

and you need to change these rights and permissions,

play09:22

the chmod will be the utility that you use to do that.

play09:26

In Linux, every file is owned by a particular user,

play09:29

and there are also rights and permissions

play09:31

associated with a group that may be associated with that file.

play09:34

For example, in my system, I have a script.sh,

play09:38

and you can see there is a backup, and staff, listed

play09:41

as part of the file name.

play09:43

That means that this file is owned by the user backup,

play09:46

and anybody who is in the staff group

play09:48

has also rights and permissions associated with this file.

play09:52

To be able to change the file owner, or the group owner,

play09:55

we would use the chown command, and usually you

play09:57

have to use elevated rights.

play09:59

So we would use a sudo chown, and then

play10:02

specify the owner, and the group,

play10:04

and then what the file name Is.

play10:06

So if we want to change the ownership of a file,

play10:09

we may want to look at who owns the file currently.

play10:12

If we use the ls -l command, we can

play10:14

see that script.sh is owned by backup,

play10:17

and is part of the group staff.

play10:19

But if we use the sudo chown professor script.sh,

play10:24

it's now going to change the user from backup,

play10:27

to now owned by professor.

play10:30

If you want to view, or change, any

play10:31

of the wireless configuration settings of a wireless adapter

play10:34

inside of your Linux device, you want

play10:36

to use the iwconfig command.

play10:38

For example, if you want to connect to an SSID,

play10:41

you can specify iwconfig, the name of the network adapter,

play10:45

in this case my wireless network adapter is eth0,

play10:49

specify that you want to connect to an ESSID,

play10:51

and then name the SSID that you'd like to connect to.

play10:55

If you want to see the IP address

play10:56

configurations of any of your network adapters,

play10:59

you can use ifconfig.

play11:01

For example, ifconfig eth0 will give you

play11:04

all of the information for that particular adapter card.

play11:07

So you can see IP address, broadcast information,

play11:09

subnet mask, and much more.

play11:12

The ps command lists out all of the current processes,

play11:15

and process IDs.

play11:16

This is very similar to looking at processes that might

play11:19

be in the Windows Task Manager.

play11:21

To be able to view these processes,

play11:23

we simply use the ps command by itself.

play11:25

If you'd like to view every process for every user,

play11:28

we can use ps -e.

play11:30

And if you want to pipe it to more, you'll be able to page

play11:33

through, because you'll probably see a large number of processes

play11:36

go by.

play11:38

One common command to install, update, or remove applications

play11:41

from the command line is apt-get.

play11:43

Apt stands for Advanced Packaging Tool.

play11:46

This allows you to easily find packages, and install them

play11:49

into your Linux distribution.

play11:51

For example, if you wanted to install Wireshark

play11:54

you would run sudo, apt-get, install, and then

play11:58

the name of the application you'd like to install--

play12:00

such as wireshark.

play12:02

Vi is the visual mode editor.

play12:04

And it's a popular editor that's found in almost every Linux

play12:07

distribution.

play12:08

To start the visual editor, use the vi command, and then

play12:11

the filename that you'd like to edit.

play12:13

For example, vi script.sh.

play12:15

Once you're inside the editor, you

play12:18

can insert text by pressing the I key,

play12:20

and then specifying what text you'd like to have input.

play12:23

When you're finished with the input process,

play12:25

you usually will press Escape to get out of input mode.

play12:28

If you like to then save the file,

play12:30

you can use a colon command with wq,

play12:32

which stands for write and quit, and it will exit the editor.

play12:37

The dd command is used for converting, and copying, files.

play12:41

But it can also be used to backup, and restore,

play12:43

entire partitions.

play12:44

The syntax of the dd command uses an input file name

play12:48

for and if, then you specify the file name, and an output file

play12:52

name, or of.

play12:53

And if you want to add additional options,

play12:55

you can do that as well.

play12:56

If you'd like to create a disk image for example,

play12:58

you would use the dd command, an input file,

play13:01

and the name of that particular partition, for instance SGA,

play13:06

and then the output file.

play13:07

In this case, we can put it in the temp directory,

play13:09

and specify the image file name here.

play13:12

To be able to restore from that image,

play13:14

we simply reverse the process with dd.

play13:16

The input file would then be the image,

play13:18

and the output file would be that partition name.

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
Linux CommandsSystem AdminTerminal UseCommand LineMac OSUnix BSDLive CDVirtualizationFile ManagementPermissionsNetwork ConfigProcess ManagementScriptingEditorsFile BackupDisk ImagesPackage Management