Basic Linux commands

Introduction to Raspberry Pi 4 Linux Fundamentals for Raspberry Pi
7 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€67.18
List Price:  €95.97
You save:  €28.79
£55.85
List Price:  £79.79
You save:  £23.94
CA$98.21
List Price:  CA$140.31
You save:  CA$42.09
A$107.62
List Price:  A$153.75
You save:  A$46.13
S$94.24
List Price:  S$134.64
You save:  S$40.39
HK$544.83
List Price:  HK$778.36
You save:  HK$233.53
CHF 62.54
List Price:  CHF 89.34
You save:  CHF 26.80
NOK kr774.97
List Price:  NOK kr1,107.14
You save:  NOK kr332.17
DKK kr501
List Price:  DKK kr715.75
You save:  DKK kr214.74
NZ$119.95
List Price:  NZ$171.37
You save:  NZ$51.41
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.19
৳8,361.58
List Price:  ৳11,945.63
You save:  ৳3,584.04
₹5,909.84
List Price:  ₹8,442.99
You save:  ₹2,533.15
RM312.71
List Price:  RM446.75
You save:  RM134.04
₦118,484.88
List Price:  ₦169,271.38
You save:  ₦50,786.49
₨19,443.22
List Price:  ₨27,777.22
You save:  ₨8,334
฿2,412.28
List Price:  ฿3,446.26
You save:  ฿1,033.98
₺2,418.32
List Price:  ₺3,454.90
You save:  ₺1,036.57
B$406.01
List Price:  B$580.04
You save:  B$174.03
R1,270.71
List Price:  R1,815.38
You save:  R544.66
Лв131.35
List Price:  Лв187.66
You save:  Лв56.30
₩98,301.65
List Price:  ₩140,436.95
You save:  ₩42,135.30
₪260.01
List Price:  ₪371.46
You save:  ₪111.45
₱4,125.14
List Price:  ₱5,893.31
You save:  ₱1,768.17
¥10,832.35
List Price:  ¥15,475.45
You save:  ¥4,643.10
MX$1,429.79
List Price:  MX$2,042.64
You save:  MX$612.85
QR255.18
List Price:  QR364.56
You save:  QR109.38
P956.90
List Price:  P1,367.06
You save:  P410.16
KSh9,061.51
List Price:  KSh12,945.58
You save:  KSh3,884.06
E£3,475.01
List Price:  E£4,964.52
You save:  E£1,489.50
ብር8,566
List Price:  ብር12,237.67
You save:  ብር3,671.66
Kz63,900.87
List Price:  Kz91,290.87
You save:  Kz27,390
CLP$68,444.99
List Price:  CLP$97,782.75
You save:  CLP$29,337.76
CN¥506.93
List Price:  CN¥724.22
You save:  CN¥217.29
RD$4,217.06
List Price:  RD$6,024.63
You save:  RD$1,807.57
DA9,397.90
List Price:  DA13,426.15
You save:  DA4,028.25
FJ$159.29
List Price:  FJ$227.57
You save:  FJ$68.27
Q540.13
List Price:  Q771.64
You save:  Q231.51
GY$14,638.82
List Price:  GY$20,913.50
You save:  GY$6,274.67
ISK kr9,773.54
List Price:  ISK kr13,962.80
You save:  ISK kr4,189.25
DH703.91
List Price:  DH1,005.63
You save:  DH301.72
L1,275.33
List Price:  L1,821.98
You save:  L546.64
ден4,132.76
List Price:  ден5,904.20
You save:  ден1,771.43
MOP$561.01
List Price:  MOP$801.48
You save:  MOP$240.46
N$1,268.91
List Price:  N$1,812.81
You save:  N$543.90
C$2,574.70
List Price:  C$3,678.31
You save:  C$1,103.60
रु9,449.77
List Price:  रु13,500.25
You save:  रु4,050.48
S/265.32
List Price:  S/379.05
You save:  S/113.72
K281.71
List Price:  K402.47
You save:  K120.75
SAR262.77
List Price:  SAR375.40
You save:  SAR112.63
ZK1,934.92
List Price:  ZK2,764.29
You save:  ZK829.37
L334.42
List Price:  L477.77
You save:  L143.34
Kč1,702.59
List Price:  Kč2,432.37
You save:  Kč729.78
Ft27,646.05
List Price:  Ft39,496.05
You save:  Ft11,850
SEK kr772.42
List Price:  SEK kr1,103.50
You save:  SEK kr331.08
ARS$70,251.41
List Price:  ARS$100,363.46
You save:  ARS$30,112.05
Bs483.50
List Price:  Bs690.75
You save:  Bs207.24
COP$307,238.59
List Price:  COP$438,931.09
You save:  COP$131,692.49
₡35,641.51
List Price:  ₡50,918.63
You save:  ₡15,277.11
L1,768.23
List Price:  L2,526.16
You save:  L757.92
₲546,248.87
List Price:  ₲780,388.98
You save:  ₲234,140.10
$U2,983.14
List Price:  $U4,261.82
You save:  $U1,278.67
zł291.40
List Price:  zł416.31
You save:  zł124.90
Already have an account? Log In

Transcript

Video basic Linux commands. In this video we will learn about some basic Linux commands for the Raspberry Pi. The first thing we need to learn with Linux is how to navigate the file and folder structure in Linux. In Windows. We do this by just clicking on pictures of folders and files. The file structure in Linux operates the same way.

We have a top level folder we call the root folder, and then we have folders and files inside of folders. And then those folders can have more folders and files. It is a tree tap structure that you are already familiar with. What is different is we navigate through the files in Linux from the command lines and not by clicking on the pictures of windows and folders. Once you master the command line, you will prefer that to clicking on the pictures method of Windows. The first command we can learners pwd by typing pwd in the command line.

It will show you what folder you are presently in. The pwd command displays the name of the present working directory for the Raspberry Pi, entering pwd will output something like forward slash home forward slash pi. That is useful as you're learning to navigate, as it will always show you where you are. The next command is LS. ls simply lists the files and folders in the present folder like shown here. The final commander's CD, which stands for change directory.

After the command, you give the where which is the path to where you want to do the command. When you press enter, your current directory will be changed to this path. To create a new directory in Linux, we can use the Mk dir command let's create a directory named new dir with MK dir and use ls command to list the directories you can see that the directory is created. To remove an empty directory, you can use the RM dir command followed by the directory name. Remember that this will only delete an empty directory like shown here. But what if we want to delete a non empty directory as a whole or just a file, then we have to use rm command followed by hyphen RF and directory or file name.

Here I will show you with an example please use the ls command to check the files in the directory regularly while trying out the RM and RM dir commands. Now let's say you want to copy files or directories then you have to use the CP command followed by Two parts. The first part is the source path, and the second is the destination path, we can use the CP command to copy both files and directories across. The move command called envy can also be used like the CP command to move a file or directory permanently. Another great tool to analyze your current location is the File Stream. Tapping the tree command will show you the entire lower tree as shown here.

Now let's move on to file manipulation commands. You can use the cat command to list the contents of a file or files. Cat followed by file name will print out all the contents of the file to the terminal. If you have multiple files of the same type, and want to view all the contents of all the files Go use cat asterisk dot p y. In this example, all the files have extension dot p y. But let's say you want to create a new file or edit an existing files contents.

In this case, you will use the nano command to create a file type nano followed by filename and extension. If you want to edit an existing file, you have to use the same command followed by the name of the file with an extension. Once edited, press Ctrl plus O to save any changes and press enter and exit the nano text editor by pressing Ctrl plus x. Next is one of the most important commands in Linux. It's called sudo. You have come across this in previous sections.

The sudo command enables you to run a command as a super user with full user access All hardware and software sources. If any of the previous commands mentioned in this video throws a Permission denied error, use sudo as a preface command to them to get around the problem. The sudo reboot command will restart the PI immediately and sudo shutdown hyphen hedge now will shut down the pie immediately. You can replace now by a specified time like Trello five to make the pie to a sheduled shutdown. The command df hyphen hatch is used to display the disk space and file system information of partitions in human readable format. A must know Linux command to get information about your network, like IP address, gateway etc, is the ifconfig command.

Another command to test whether the host is alive is to send ping packets to its IP address by the ping command after The ping keyword, type the IP address of the host device. If you want to download a file from the internet with just a URL, you can use the Wk command, followed by the URL to the file. Just after the network configuration, you'll have to update your system. To get the latest version of each default packages installed. You have already come across these sets of commands, the sudo apt hyphen, get update and sudo apt hyphen get upgrade. Whenever you start your pie.

It's recommended to upgrade the packages to the latest version. To install new packages, you must use the sudo apt hyphen get install command followed by the package name. Similarly, to remove a specific package You have to use the sudo apt hyphen get remote command, followed by the package name summary. In this video we have learned basic Linux commands for the Raspberry Pi and its function. In the next video, we will learn some advanced Linux commands for the Raspberry Pi

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.