Question 3.30: You want to run a command, but you don’t want the output fil......

You want to run a command, but you don’t want the output filling up your screen.

Step-by-Step
The 'Blue Check Mark' means that this solution was answered by an expert.
Learn more on how do we answer questions.

Redirect the output to /dev/null using >.

For example:

$ ls > /dev/null

Discussion

This example illustrates the syntax, but is otherwise pretty useless. A more common use is where you’re running a program and the developer has left a lot of trace messages in her code, which you don’t really want to see. The following example hides superfluous output from the find command (see Recipe 3.22).

$ find / -name gemgem.py 2>/dev/null
/home/pi/python_games/gemgem.py

See Also

For more information about redirecting standard output, see Recipe 3.27.

Related Answered Questions

Question: 3.34

Verified Answer:

Use the Linux df command: $ df -h Filesystem   ...
Question: 3.33

Verified Answer:

Use the Linux date command. The date and time form...
Question: 3.32

Verified Answer:

Edit the file ~/.bashrc using nano (Recipe 3.6), a...
Question: 3.31

Verified Answer:

Run the program or command in the background using...
Question: 3.24

Verified Answer:

Use the Task Manager utility, which you’ll find on...
Question: 3.29

Verified Answer:

Use the pipe command, which is the bar symbol (|) ...
Question: 3.27

Verified Answer:

Use the > command to redirect output that would...
Question: 3.28

Verified Answer:

Use the cat command to concatenate a number of fil...
Question: 3.26

Verified Answer:

Use the lsusb command. This will list all the devi...
Question: 3.25

Verified Answer:

Depending on the file type, you will need to use t...