Unix Commands — III find

You can always look more from the official manual, or you can basically run the man command yourself for the find and see what it offers more.

We have an example directory with some subdirectories and files for this post now let’s take a look at it with the tree command. If you are using macOS it doesn’t come built-in yet you can easily install it via “brew install tree”. I’ll not provide a GitHub repo for that because you can create some similar structure within minutes if not seconds yourself.

#macos #linux #unix #terminal #linux-tutorial

Unix Commands — III find
Virgil  Hagenes

Virgil Hagenes

1603265760

My Unix Commands Cheatsheet

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

Basic Commands II — Unix Commands VII

  • Tar: The first one we’ll talk about today is tar, with tar you can archive and unarchive directories.
  • Gzip: Gzip is being used for similar reasons but instead, it works on files for compressing purposes, the use of it also fairly simple.
  • whoami: It’s quite simple, prints the name of the user who ran the command.
  • who: Unlike “whoami”, the who command prints all the currently logged-in users, for example below here I have 2 terminals opened with 2 users and I get both of them with the terminals they opened.
  • Date: Sometimes when you connect to a remote server over ssh knowing the current system date can be so important to see that you can simply run that command and the system date is at your service.

#linux #unix commands #basic commands

Basic Commands II — Unix Commands VII

Unix Commands — III find

You can always look more from the official manual, or you can basically run the man command yourself for the find and see what it offers more.

We have an example directory with some subdirectories and files for this post now let’s take a look at it with the tree command. If you are using macOS it doesn’t come built-in yet you can easily install it via “brew install tree”. I’ll not provide a GitHub repo for that because you can create some similar structure within minutes if not seconds yourself.

#macos #linux #unix #terminal #linux-tutorial

Unix Commands — III find
Luna  Mosciski

Luna Mosciski

1598070540

Find All files Larger Than 1GB Size in Linux

Generally on the development and staging environments have disk issues where multiple application’s are running. Sometimes we also face low disk space on production systems.

Few days back my production application goes down. After searching for half an hour, I found the application was down due to disk full on my server. So I had searches all files greater than 1 GB and then all files greater than 100 MB. There was few logs files which was large in size, which caused disk full.

In this tutorial, you will learn how to search file by their size using find command.

#linux commands #command #file #find #linux

Find All files Larger Than 1GB Size in Linux

How To Find Files Modified in Last 30 Days in Linux

Find files modified in last X days

Use below command to search all files and directories modified in last 30 days. Here dot (.) is used to search in current directory. And -30 defines to search files modified in last 30 day. Change this number with your search requirements.

find . -mtime -30

You can also customize search based on file type. Use -type followed with -f (file) or -d (directory). Below command will search for files only.

find . -type f -mtime -30

#linux commands #command #find #search

How To Find Files Modified in Last 30 Days in Linux