AI Features

I/O Redirection

Learn how redirection works in Bash.

We'll cover the following...

Redirecting text data

Let’s suppose that we are looking for the files on the disk. We want to save the search results in a file. We use the find utility and the redirection operator 1>. Then, the utility call looks like this:

find / -path */doc/* -name README 1> readme_list.txt

We run cat readme_list.txt to view readme_list.txt.

Run the commands discussed in this lesson in the terminal below.

Terminal 1
Terminal
Loading...

The command creates the readme_list.txt file in the current directory and writes the find utility’s output there. The file contents look the same because they are printed on the ...