Most commonly used Linux commands

Photo by Cornelius Ventures on Unsplash

If you are starting out in any branch of computer science, whether software development, data science, software, and data engineering, should at the least become familiar with basic Linux commands.
Here I am listing a few of them:

  • man

Short for ‘manual’: it provides the details about any command in Linux, for example, to know about ‘cp’ command in Linux:

$ man ls
  • pwd

Short for ‘present working directory’, gives the directory the user is in currently

  • cd

Stands for ‘change directory’, to change the current directory to another

  • echo

To print anything to the terminal

  • whoami

Gives the name of the current user

  • sudo

This allows making admin-level changes, which the current user might not have permission to do.

  • ls

List all files in the current directory.

  • touch

Create a new file in the current directory

  • nano or vi

Opens any text file in edit mode.

  • cp

Copies a file from one directory to another

  • mv

Moves a file from one directory to another

  • rm

Removes a file from the current directory

  • mkdir

Creates a new directory

  • rmdir

Removes an existing empty directory

  • cat

Shows the contents of a text file

  • grep

Looks for a text in a text file

  • ls -l

Lists all the files and folders along with the permissions of the Users, Groups, and Others

Users : The user who creates the files.

Groups: The group the users belong to.

Other: Any other user who is not the user and not in the group

The first part above specifies the permissions of the file/folder.

‘d’ denotes a directory. For files, this will be shown as ‘-’.

The first three letters after ‘d’ denote the User level permissions, where

‘r’ denotes the read permissions

‘w’ denotes the write permission

‘x’ denotes execute permissions

The next three letters denote Group level permissions

and the last three letters before @ denote other’s permissions

https://www.guru99.com/file-permissions.html#:~:text=Linux%20divides%20the%20file%20permissions,ownership%20of%20a%20file%2Fdirectory.
  • chown

Stands for ‘change owner’. Changes the owner of a file as shown below

  • chmod

Changes the read-write-execute permissions of a file. For example, ‘chmod 777’ changes the permissions of the file to give read-write-execute access to all the users.

The details for the numbers is given below:

https://www.guru99.com/file-permissions.html#:~:text=Linux%20divides%20the%20file%20permissions,ownership%20of%20a%20file%2Fdirectory.

There are many more, but these should be enough to get anyone started with Linux.

--

--

--

Data Scientist, Kode Tiger

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Launch Your App in 10 Simple Steps

What’s Flutter? Is it worth learning Flutter in 2021?

Flutter google trends.

Unity: Building and Deploying WebGL game

DevStack LDAP plugin — Part 2

Setup PHP MongoDB Extension On MAC And Windows

Scala 3: Contextual Abstractions, Part I

The Power of Golang Keyword "defer"

How To Fix Micromax Canvas Amaze 2 E457 Not Charging [Troubleshooting Guide]

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Prakhar S

Prakhar S

Data Scientist, Kode Tiger

More from Medium

Pure Functions vs Impure Functions in Python.

Python Programming From Beginner to Advanced Level

Python for Beginners

A quick introduction to four great Python features!