0% found this document useful (0 votes)
2 views25 pages

Essential Linux Commands for Beginners

m

Uploaded by

adityakhouri2001
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views25 pages

Essential Linux Commands for Beginners

m

Uploaded by

adityakhouri2001
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

20 Basic Linux Commands

for
Data Science
Beginners
1

1. ls
The ls command is used to display the list of all
the files and folders in the current directory.

/like [Link]
2

2. pwd
It will display the full path of the current
directory.

/like [Link]
3

3. cd
The cd command stands for change directory.
By typing a new directory path, you can change
the current directory. This command is
essential for exploring the directory with
multiple folders.

/like [Link]
4

4. wget
The wget allows you to download any file from
the internet. In data science, it is use for
downloading the data from data repositories.

/like [Link]
5

4. wget
Output

/like [Link]
6

5. cat
Cat (concatenate) is a frequently used
command to create, connect, and view files.
The cat command reads the CSV file and
displays the file content as output.

/like [Link]
7

5. cat

/like [Link]
8

6. wc
wc (word count) is used to get information
about word count, character count, and lines.
In our case, it displays 4 columns as an output.
The first column is line count, the second is
word count, the third is character count, and
the fourth is a file name.

/like [Link]
9

7. head
The head command shows the top n lines in a
file. In our case, it is displaying the top 5 lines
in the [Link] file.

Output

/like [Link]
10

8. find
The find command is used to find files and
folders, and by using `-exec`, you can execute
other Linux commands on files and folders. In
our case, we are finding all the files with “.dvc”
extension.

Output

/like [Link]
11

9. grep
It is used for filtering a particular pattern and
displaying all the lines containing that pattern.

We are finding all the lines that contain “vir” in


[Link]

/like [Link]
12

9. grep

/like [Link]
13

10. history
History will show the log of the past
commands. We have limited the output to
display the 5 most recent commands.

Output

/like [Link]
14

11. zip
zip is used to compress the file size and file
package utility. The first argument in the zip
command is a zip file name, and the second is a
file name or list of file names. The zip
command is primarily used to compress and
package datasets.

/like [Link]
15

12. unzip
It unzips or uncompresses the files and folders.
Just provide a `.zip` file name, and it will
extract all the files and folders in the current
directory.

/like [Link]
16

13. cp
It lets you copy a file, list of files, or directory to
the destination directory. The first argument in
the cp command is a file, and the second
argument is the destination directory path.

/like [Link]
17

14. mv
Similar to cp, the mv command lets you move
a file, list of files, or a directory to another
place. It is also used for renaming files and
directories. The first argument in the mv
command is a file, and the second is the path
of destination directory.

/like [Link]
18

15. rm
It removes files and directories from the file
system. You can add a file or list of files names
after the rm command.

/like [Link]
19

16. mkdir
It lets you create a directory of multiple
directories at once. Just write the folder path
after the mkdir command.

Note: The user must have permission to create


a folder in the parent directory.

/like [Link]
20

17. rmdir
You can remove a directory or multiple
directories by using rmdir. Just add a folder
named as the first argument.

Note: The `-v` flag indicates verbose.

/like [Link]
21

18. man
It is used to display the manual of any
command in the Linux system. In our case, we
are going to learn about the echo command.

/like [Link]
22

19. diff
It is used to display line-by-line differences
between two files. Just add both files after the
diff command to see the comparison.

/like [Link]
23

20. alias
An alias is a productivity tool. I have shortened
all your long and repetitive commands. I have
shortened all of my Linux and Git commands to
avoid making mistakes while writing the same
command.

In the example below, the terminal is


displaying the text “i love you” whenever I run
the love command.

/like [Link]
24

20. alias

/like [Link]

You might also like