fbpx
Linux 101

Four Linux disk and file commands that aren’t that unique, and two important commands for finding content in command output or text files

Let us summarize four really basic commands, that are the same in Linux and Windows:

cd – Change directory.

dir – List directory contents.

mkdir – Make a directory.

rmdir – Remove a directory.

Now let us find specific words in command output

Okay, that much is clear. But during your daily work, you often want to find specific words from the output from other commands.

In Windows you would use the FindStr command as follows:

<command that prints output> | Findstr <search string>

But in Linux you will use grep.

<command that prints output> | grep <search string>

Let us find content in text files

But what if you want to find content in plain text files? Then you have the type command in Windows, and can use it as follows:

type <filename> | Findstr <search string>

In Linux you can use the cat command, as follows:

cat <filename> | grep <search string>

Curious to find out more about Linux network commands that are similar to Windows? Check this out.