It is very important for every Data Analyst/Scientist to be able to interact with the Command Line Shell. Let’s start with a “cheat sheet” of Basic Linux Commands. This list includes a bunch of different commands that are useful to know when working with Linux.

Managing files and directories

  • cd directory: changes the current working directory to the specified one
  • pwd: prints the current working directory
  • ls: lists the contents of the current directory
  • ls directory: lists the contents of the received directory
  • ls -l: lists the additional information for the contents of the directory
  • ls -a: lists all files, including those hidden
  • ls -la: applies both the -l and the -a flags
  • mkdir directory: creates the directory with the received name
  • rmdir directory: deletes the directory with the received name (if empty)
  • **rm **file: deletes the file, we can either go one-by-one or we delete them all together using the *
  • cp old_name new_name: copies old_name into new_name
  • mv old_name new_name: moves old_name into new_name
  • touch file_name: creates an empty file or updates the modified time if it exists
  • chmod modifiers files: changes the permissions for the files according to the provided modifiers; we’ve seen +x to make the file executable
  • chown user files: changes the owner of the files to the given user
  • chgrp group files: changes the group of the files to the given group

#cheatsheet #data-science #ai #unix-command #unix

My Unix Commands Cheatsheet
1.50 GEEK